Skip to content

Commit

Permalink
chore: pre-commit autoupdate (#1889)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Edgar Ramírez Mondragón <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and edgarrmondragon authored Aug 1, 2023
1 parent 611d50d commit 4e92424
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:
- id: check-readthedocs

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.280
rev: v0.0.282
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand All @@ -64,7 +64,7 @@ repos:
)$
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.0
rev: 0.23.3
hooks:
- id: check-dependabot
- id: check-github-workflows

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.269
rev: v0.0.282
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.4.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class {{ cookiecutter.source_name }}Stream({{ cookiecutter.stream_type }}Stream)
def get_url_params(
self,
context: dict | None, # noqa: ARG002
next_page_token: Any | None,
next_page_token: Any | None, # noqa: ANN401
) -> dict[str, Any]:
"""Return a dictionary of values to be used in URL parameterization.

Expand All @@ -181,7 +181,7 @@ class {{ cookiecutter.source_name }}Stream({{ cookiecutter.stream_type }}Stream)
def prepare_request_payload(
self,
context: dict | None, # noqa: ARG002
next_page_token: Any | None, # noqa: ARG002
next_page_token: Any | None, # noqa: ARG002, ANN401
) -> dict | None:
"""Prepare the data payload for the REST API request.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import typing as t
from pathlib import Path

from singer_sdk import typing as th # JSON Schema typing helpers
Expand Down Expand Up @@ -54,7 +55,7 @@ class UsersStream({{ cookiecutter.source_name }}Stream):
),
),
).to_dict()
primary_keys = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]
replication_key = None
graphql_query = """
users {
Expand All @@ -81,7 +82,7 @@ class GroupsStream({{ cookiecutter.source_name }}Stream):
th.Property("id", th.StringType),
th.Property("modified", th.DateTimeType),
).to_dict()
primary_keys = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]
replication_key = "modified"
graphql_query = """
groups {
Expand All @@ -104,7 +105,7 @@ class UsersStream({{ cookiecutter.source_name }}Stream):
{%- if cookiecutter.stream_type == "REST" %}
path = "/users"
{%- endif %}
primary_keys = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]
replication_key = None
# Optionally, you may also use `schema_filepath` in place of `schema`:
# schema_filepath = SCHEMAS_DIR / "users.json" # noqa: ERA001
Expand Down Expand Up @@ -143,7 +144,7 @@ class GroupsStream({{ cookiecutter.source_name }}Stream):
{%- if cookiecutter.stream_type == "REST" %}
path = "/groups"
{%- endif %}
primary_keys = ["id"]
primary_keys: t.ClassVar[list[str]] = ["id"]
replication_key = "modified"
schema = th.PropertiesList(
th.Property("name", th.StringType),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.0
rev: 0.23.3
hooks:
- id: check-dependabot
- id: check-github-workflows

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.269
rev: v0.0.282
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.4.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
7 changes: 4 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import annotations

import glob
import os
import shutil
import sys
Expand All @@ -23,9 +22,11 @@

RUFF_OVERRIDES = """\
extend = "./pyproject.toml"
extend-ignore = ["TD002", "TD003"]
extend-ignore = ["TD002", "TD003", "FIX002"]
"""

COOKIECUTTER_REPLAY_FILES = list(Path("./e2e-tests/cookiecutters").glob("*.json"))

package = "singer_sdk"
python_versions = ["3.11", "3.10", "3.9", "3.8", "3.7"]
main_python_version = "3.10"
Expand Down Expand Up @@ -185,7 +186,7 @@ def docs_serve(session: Session) -> None:
session.run("sphinx-autobuild", *args)


@nox.parametrize("replay_file_path", glob.glob("./e2e-tests/cookiecutters/*.json"))
@nox.parametrize("replay_file_path", COOKIECUTTER_REPLAY_FILES)
@session(python=main_python_version)
def test_cookiecutter(session: Session, replay_file_path) -> None:
"""Uses the tap template to build an empty cookiecutter.
Expand Down
4 changes: 3 additions & 1 deletion singer_sdk/testing/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ def target_input(self) -> t.IO[str]:
if self.input_io:
self._input = self.input_io
elif self.input_filepath:
self._input = Path(self.input_filepath).open(encoding="utf8")
self._input = Path(self.input_filepath).open( # noqa: SIM115
encoding="utf8",
)
return t.cast(t.IO[str], self._input)

@target_input.setter
Expand Down

0 comments on commit 4e92424

Please sign in to comment.