diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 8fd3ffa14..580a19e62 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -3,7 +3,7 @@ current_version = 0.5.0 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? -serialize = +serialize = {major}.{minor}.{patch}-{release}{build} {major}.{minor}.{patch} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8b8b638f..c2b65f61d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - { tox-env: py, python-version: "3.9", os: "ubuntu-latest" } - { tox-env: py, python-version: "3.10", os: "ubuntu-latest" } - { tox-env: doctest, python-version: "3.10", os: "ubuntu-latest" } - - { tox-env: lint, python-version: "3.8", os: "ubuntu-latest" } + - { tox-env: mypy, python-version: "3.8", os: "ubuntu-latest" } steps: - name: Check out the repository diff --git a/.gitignore b/.gitignore index 9583389cc..d78cdb1d2 100644 --- a/.gitignore +++ b/.gitignore @@ -81,4 +81,3 @@ venv.bak/ .dmypy.json dmypy.json .DS_Store - diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a078bdce7..ea773a0ad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,16 +71,6 @@ build_and_test: poetry run pytest tests/cookiecutters fi -lint: - stage: test - parallel: - matrix: - - PYTHON_VERSION: ["3.8"] - image: python:${PYTHON_VERSION} - script: - - poetry run tox -e lint - - version_bump_trigger: # This job triggers for any branches named like `release/vX.Y.Z` # The job will automatically flush the changelog, bump version refs, diff --git a/.gitlab/issue_templates/Feature Request.md b/.gitlab/issue_templates/Feature Request.md index 5598d4ed5..51e4699d6 100644 --- a/.gitlab/issue_templates/Feature Request.md +++ b/.gitlab/issue_templates/Feature Request.md @@ -12,4 +12,3 @@ ## Best reasons not to build [//]: # (Will this negatively affect any existing functionality? Do you anticipate any breaking changes versus what may already be working today? Make the counter-argument to your proposal here.) - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index de8dce657..d4b6e1514 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,34 +1,67 @@ +ci: + autofix_prs: false + autoupdate_schedule: weekly + autoupdate_commit_msg: 'chore: pre-commit autoupdate' + repos: - - repo: local - hooks: - - id: black - name: black - entry: poetry run black - language: system - types: [python] +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-json + - id: check-toml + exclude: | + (?x)^( + cookiecutter/.*/pyproject.toml + )$ + - id: check-yaml + exclude: | + (?x)^( + cookiecutter/.*/meltano.yml + )$ + - id: end-of-file-fixer + exclude: (cookiecutter/.*|docs/.*|samples/.*\.json) + - id: trailing-whitespace + exclude: | + (?x)^( + singer_sdk/helpers/_simpleeval.py| + tests/core/test_simpleeval.py + )$ - - id: isort - name: isort - entry: poetry run isort - language: system - types: [python] +- repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + language_version: python3.10 + exclude: | + (?x)^( + cookiecutter/.*| + singer_sdk/helpers/_simpleeval.py| + tests/core/test_simpleeval.py + )$ - - id: flake8 - name: flake8 - entry: poetry run flake8 - language: system - types: [python] - files: 'singer_sdk/.*' +- repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + exclude: (cookiecutter/.*|singer_sdk/helpers/_simpleeval/.*) - - id: mypy - name: mypy - entry: poetry run mypy - language: system - types: [python] - exclude: tests/.* +- repo: https://github.com/pycqa/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + additional_dependencies: + - darglint==1.8.1 + - flake8-annotations==2.9.0 + - flake8-docstrings==1.6.0 + files: 'singer_sdk/.*' - - id: pyupgrade - name: pyupgrade - entry: poetry run pyupgrade --py37-plus - language: system - types: [python] +- repo: https://github.com/asottile/pyupgrade + rev: v2.32.1 + hooks: + - id: pyupgrade + args: [--py37-plus] + exclude: | + (?x)^( + singer_sdk/helpers/_simpleeval.py| + tests/core/test_simpleeval.py + )$ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf4e7d884..437defb7a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,6 +36,6 @@ Optionally, you may use the expanded syntax to specify a scope in the form ` sqlalchemy.types.TypeEngine: """Returns a JSON Schema equivalent for the given SQL type. - + Developers may optionally add custom logic before calling the default implementation inherited from the base class. """ diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/meltano.yml b/cookiecutter/target-template/{{cookiecutter.target_id}}/meltano.yml index 07de47f4e..000712603 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/meltano.yml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/meltano.yml @@ -1,11 +1,11 @@ version: 1 send_anonymous_usage_stats: true -project_id: {{cookiecutter.target_id}} +project_id: "{{cookiecutter.target_id}}" plugins: extractors: [] loaders: - - name: {{cookiecutter.target_id}} - namespace: {{cookiecutter.library_name}} + - name: "{{cookiecutter.target_id}}" + namespace: "{{cookiecutter.library_name}}" pip_url: -e . capabilities: - state diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/sinks.py b/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/sinks.py index 854031c94..237448d9b 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/sinks.py +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/{{cookiecutter.library_name}}/sinks.py @@ -18,7 +18,7 @@ def process_record(self, record: dict, context: dict) -> None: def start_batch(self, context: dict) -> None: """Start a batch. - + Developers may optionally add additional markers to the `context` dict, which is unique to this batch. """ diff --git a/docs/_templates/footer.html b/docs/_templates/footer.html index f3a36c931..2ce7aaa27 100644 --- a/docs/_templates/footer.html +++ b/docs/_templates/footer.html @@ -4,6 +4,6 @@ The SDK is built with love by the Meltano core team and contributors, with contributions from developers across the Singer open source community. - {% endblock %} diff --git a/docs/faq.md b/docs/faq.md index a61399d68..e0b18c5e0 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -7,13 +7,13 @@ Most likely you should delete the project and start over. ## What are all of the Property options? The property types are documented in the [JSON Schema builder docs](./typing). -However, if you're using an IDE such as VSCode, you should be able to set up the environment to give you autocompletion prompts or hints. +However, if you're using an IDE such as VSCode, you should be able to set up the environment to give you autocompletion prompts or hints. Ensure your interpreter is set to poetry if you've followed the [Dev Guide](./dev_guide.md). Checkout this [gif](https://visualstudiomagazine.com/articles/2021/04/20/~/media/ECG/visualstudiomagazine/Images/2021/04/poetry.ashx) for how to change your interpreter. ## I'm having trouble getting the base class to __init__. -Ensure you're using the `super()` method to inherit methods from the base class. +Ensure you're using the `super()` method to inherit methods from the base class. ```python class MyStream(Stream): diff --git a/docs/implementation/metrics.md b/docs/implementation/metrics.md index e919cfa99..c6a0a13f2 100644 --- a/docs/implementation/metrics.md +++ b/docs/implementation/metrics.md @@ -1,6 +1,6 @@ # [SDK Implementation Details](./index.md) - Tap Metrics -Metrics logging is specified in the +Metrics logging is specified in the [Singer Spec](https://hub.meltano.com/singer/spec#metrics). The SDK will automatically emit two types of metrics `record_count` and `http_request_duration`. diff --git a/docs/parent_streams.md b/docs/parent_streams.md index 5bee8b733..235dbfac8 100644 --- a/docs/parent_streams.md +++ b/docs/parent_streams.md @@ -25,11 +25,11 @@ from a parent record each time the child stream is invoked. Here is an abbreviated example from the Gitlab sample (also in this repo) which uses the above techniques. -In this example, EpicIssuesStream is a child of EpicsStream. +In this example, EpicIssuesStream is a child of EpicsStream. ```py class GitlabStream(RESTStream): - # Base stream definition with auth and pagination logic + # Base stream definition with auth and pagination logic # This logic works for other base classes as well, including Stream, GraphQLStream, etc. @@ -49,13 +49,13 @@ class EpicsStream(GitlabStream): class EpicIssuesStream(GitlabStream): - # Note that this class inherits from the GitlabStream base class, and not from + # Note that this class inherits from the GitlabStream base class, and not from # the EpicsStream class. name = "epic_issues" # EpicIssues streams should be invoked once per parent epic: - parent_stream_type = EpicsStream + parent_stream_type = EpicsStream # Assume epics don't have `updated_at` incremented when issues are changed: ignore_parent_replication_keys = True diff --git a/poetry.lock b/poetry.lock index 49bb76aef..e17bb43b5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -363,20 +363,6 @@ category = "dev" optional = false python-versions = "*" -[[package]] -name = "isort" -version = "5.10.1" -description = "A Python utility / library to sort Python imports." -category = "dev" -optional = false -python-versions = ">=3.6.1,<4.0" - -[package.extras] -pipfile_deprecated_finder = ["pipreqs", "requirementslib"] -requirements_deprecated_finder = ["pipreqs", "pip-api"] -colors = ["colorama (>=0.4.3,<0.5.0)"] -plugins = ["setuptools"] - [[package]] name = "jinja2" version = "3.0.3" @@ -846,17 +832,6 @@ category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -[[package]] -name = "pyupgrade" -version = "2.34.0" -description = "A tool to automatically upgrade syntax for newer versions." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -tokenize-rt = ">=3.2.0" - [[package]] name = "pyyaml" version = "6.0" @@ -1108,14 +1083,6 @@ category = "dev" optional = false python-versions = "*" -[[package]] -name = "tokenize-rt" -version = "4.2.1" -description = "A wrapper around the stdlib `tokenize` which roundtrips." -category = "dev" -optional = false -python-versions = ">=3.6.1" - [[package]] name = "toml" version = "0.10.2" @@ -1262,7 +1229,7 @@ docs = ["sphinx", "sphinx-rtd-theme", "sphinx-copybutton", "myst-parser"] [metadata] lock-version = "1.1" python-versions = "<3.11,>=3.7.1" -content-hash = "dc7c6b632865d65e00cb072fd137468f64d92681cfc0bd96fb779ee90f72344c" +content-hash = "9203074daae402941803e2252789f70cf5f19b76f661b994f947a4c35cd14caa" [metadata.files] alabaster = [ @@ -1512,7 +1479,6 @@ greenlet = [ {file = "greenlet-1.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:97e5306482182170ade15c4b0d8386ded995a07d7cc2ca8f27958d34d6736497"}, {file = "greenlet-1.1.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e6a36bb9474218c7a5b27ae476035497a6990e21d04c279884eb10d9b290f1b1"}, {file = "greenlet-1.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:abb7a75ed8b968f3061327c433a0fbd17b729947b400747c334a9c29a9af6c58"}, - {file = "greenlet-1.1.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b336501a05e13b616ef81ce329c0e09ac5ed8c732d9ba7e3e983fcc1a9e86965"}, {file = "greenlet-1.1.2-cp310-cp310-win_amd64.whl", hash = "sha256:14d4f3cd4e8b524ae9b8aa567858beed70c392fdec26dbdb0a8a418392e71708"}, {file = "greenlet-1.1.2-cp35-cp35m-macosx_10_14_x86_64.whl", hash = "sha256:17ff94e7a83aa8671a25bf5b59326ec26da379ace2ebc4411d690d80a7fbcf23"}, {file = "greenlet-1.1.2-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:9f3cba480d3deb69f6ee2c1825060177a22c7826431458c697df88e6aeb3caee"}, @@ -1525,7 +1491,6 @@ greenlet = [ {file = "greenlet-1.1.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9d29ca8a77117315101425ec7ec2a47a22ccf59f5593378fc4077ac5b754fce"}, {file = "greenlet-1.1.2-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:21915eb821a6b3d9d8eefdaf57d6c345b970ad722f856cd71739493ce003ad08"}, {file = "greenlet-1.1.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eff9d20417ff9dcb0d25e2defc2574d10b491bf2e693b4e491914738b7908168"}, - {file = "greenlet-1.1.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:b8c008de9d0daba7b6666aa5bbfdc23dcd78cafc33997c9b7741ff6353bafb7f"}, {file = "greenlet-1.1.2-cp36-cp36m-win32.whl", hash = "sha256:32ca72bbc673adbcfecb935bb3fb1b74e663d10a4b241aaa2f5a75fe1d1f90aa"}, {file = "greenlet-1.1.2-cp36-cp36m-win_amd64.whl", hash = "sha256:f0214eb2a23b85528310dad848ad2ac58e735612929c8072f6093f3585fd342d"}, {file = "greenlet-1.1.2-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:b92e29e58bef6d9cfd340c72b04d74c4b4e9f70c9fa7c78b674d1fec18896dc4"}, @@ -1534,7 +1499,6 @@ greenlet = [ {file = "greenlet-1.1.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e12bdc622676ce47ae9abbf455c189e442afdde8818d9da983085df6312e7a1"}, {file = "greenlet-1.1.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8c790abda465726cfb8bb08bd4ca9a5d0a7bd77c7ac1ca1b839ad823b948ea28"}, {file = "greenlet-1.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f276df9830dba7a333544bd41070e8175762a7ac20350786b322b714b0e654f5"}, - {file = "greenlet-1.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c5d5b35f789a030ebb95bff352f1d27a93d81069f2adb3182d99882e095cefe"}, {file = "greenlet-1.1.2-cp37-cp37m-win32.whl", hash = "sha256:64e6175c2e53195278d7388c454e0b30997573f3f4bd63697f88d855f7a6a1fc"}, {file = "greenlet-1.1.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b11548073a2213d950c3f671aa88e6f83cda6e2fb97a8b6317b1b5b33d850e06"}, {file = "greenlet-1.1.2-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:9633b3034d3d901f0a46b7939f8c4d64427dfba6bbc5a36b1a67364cf148a1b0"}, @@ -1543,7 +1507,6 @@ greenlet = [ {file = "greenlet-1.1.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e859fcb4cbe93504ea18008d1df98dee4f7766db66c435e4882ab35cf70cac43"}, {file = "greenlet-1.1.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00e44c8afdbe5467e4f7b5851be223be68adb4272f44696ee71fe46b7036a711"}, {file = "greenlet-1.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec8c433b3ab0419100bd45b47c9c8551248a5aee30ca5e9d399a0b57ac04651b"}, - {file = "greenlet-1.1.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2bde6792f313f4e918caabc46532aa64aa27a0db05d75b20edfc5c6f46479de2"}, {file = "greenlet-1.1.2-cp38-cp38-win32.whl", hash = "sha256:288c6a76705dc54fba69fbcb59904ae4ad768b4c768839b8ca5fdadec6dd8cfd"}, {file = "greenlet-1.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:8d2f1fb53a421b410751887eb4ff21386d119ef9cde3797bf5e7ed49fb51a3b3"}, {file = "greenlet-1.1.2-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:166eac03e48784a6a6e0e5f041cfebb1ab400b394db188c48b3a84737f505b67"}, @@ -1552,7 +1515,6 @@ greenlet = [ {file = "greenlet-1.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1692f7d6bc45e3200844be0dba153612103db241691088626a33ff1f24a0d88"}, {file = "greenlet-1.1.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7227b47e73dedaa513cdebb98469705ef0d66eb5a1250144468e9c3097d6b59b"}, {file = "greenlet-1.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ff61ff178250f9bb3cd89752df0f1dd0e27316a8bd1465351652b1b4a4cdfd3"}, - {file = "greenlet-1.1.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0051c6f1f27cb756ffc0ffbac7d2cd48cb0362ac1736871399a739b2885134d3"}, {file = "greenlet-1.1.2-cp39-cp39-win32.whl", hash = "sha256:f70a9e237bb792c7cc7e44c531fd48f5897961701cdaa06cf22fc14965c496cf"}, {file = "greenlet-1.1.2-cp39-cp39-win_amd64.whl", hash = "sha256:013d61294b6cd8fe3242932c1c5e36e5d1db2c8afb58606c5a67efce62c1f5fd"}, {file = "greenlet-1.1.2.tar.gz", hash = "sha256:e30f5ea4ae2346e62cedde8794a56858a67b878dd79f7df76a0767e356b1744a"}, @@ -1577,10 +1539,6 @@ iniconfig = [ {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, ] -isort = [ - {file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"}, - {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, -] jinja2 = [ {file = "Jinja2-3.0.3-py3-none-any.whl", hash = "sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8"}, {file = "Jinja2-3.0.3.tar.gz", hash = "sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7"}, @@ -1612,9 +1570,6 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad"}, {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d"}, {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a"}, {file = "MarkupSafe-2.0.1-cp310-cp310-win32.whl", hash = "sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28"}, {file = "MarkupSafe-2.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51"}, @@ -1626,9 +1581,6 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145"}, - {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd"}, - {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f"}, - {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-win32.whl", hash = "sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567"}, @@ -1640,9 +1592,6 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864"}, - {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207"}, - {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9"}, - {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-win32.whl", hash = "sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914"}, {file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9"}, @@ -1655,9 +1604,6 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6"}, - {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f"}, - {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194"}, - {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee"}, {file = "MarkupSafe-2.0.1-cp38-cp38-win32.whl", hash = "sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64"}, {file = "MarkupSafe-2.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833"}, {file = "MarkupSafe-2.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26"}, @@ -1670,9 +1616,6 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1"}, {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac"}, {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6"}, - {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047"}, - {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e"}, - {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1"}, {file = "MarkupSafe-2.0.1-cp39-cp39-win32.whl", hash = "sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74"}, {file = "MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8"}, {file = "MarkupSafe-2.0.1.tar.gz", hash = "sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a"}, @@ -1943,10 +1886,6 @@ pytzdata = [ {file = "pytzdata-2020.1-py2.py3-none-any.whl", hash = "sha256:e1e14750bcf95016381e4d472bad004eef710f2d6417240904070b3d6654485f"}, {file = "pytzdata-2020.1.tar.gz", hash = "sha256:3efa13b335a00a8de1d345ae41ec78dd11c9f8807f522d39850f2dd828681540"}, ] -pyupgrade = [ - {file = "pyupgrade-2.34.0-py2.py3-none-any.whl", hash = "sha256:16617805b8d1138f96a1ff9cdb4b302b39b51804b3fc5474dc36c0326387445a"}, - {file = "pyupgrade-2.34.0.tar.gz", hash = "sha256:ed0d9f282fa6282d0ca3bc0596a022aeb95435edab9daf3fc04c2ba118687b68"}, -] pyyaml = [ {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, @@ -2057,7 +1996,6 @@ sqlalchemy = [ {file = "SQLAlchemy-1.4.37-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:d9050b0c4a7f5538650c74aaba5c80cd64450e41c206f43ea6d194ae6d060ff9"}, {file = "SQLAlchemy-1.4.37-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b4c92823889cf9846b972ee6db30c0e3a92c0ddfc76c6060a6cda467aa5fb694"}, {file = "SQLAlchemy-1.4.37-cp27-cp27m-win32.whl", hash = "sha256:b55932fd0e81b43f4aff397c8ad0b3c038f540af37930423ab8f47a20b117e4c"}, - {file = "SQLAlchemy-1.4.37-cp27-cp27m-win_amd64.whl", hash = "sha256:4a17c1a1152ca4c29d992714aa9df3054da3af1598e02134f2e7314a32ef69d8"}, {file = "SQLAlchemy-1.4.37-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:ffe487570f47536b96eff5ef2b84034a8ba4e19aab5ab7647e677d94a119ea55"}, {file = "SQLAlchemy-1.4.37-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:78363f400fbda80f866e8e91d37d36fe6313ff847ded08674e272873c1377ea5"}, {file = "SQLAlchemy-1.4.37-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ee34c85cbda7779d66abac392c306ec78c13f5c73a1f01b8b767916d4895d23"}, @@ -2099,10 +2037,6 @@ text-unidecode = [ {file = "text-unidecode-1.3.tar.gz", hash = "sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93"}, {file = "text_unidecode-1.3-py2.py3-none-any.whl", hash = "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8"}, ] -tokenize-rt = [ - {file = "tokenize_rt-4.2.1-py2.py3-none-any.whl", hash = "sha256:08a27fa032a81cf45e8858d0ac706004fcd523e8463415ddf1442be38e204ea8"}, - {file = "tokenize_rt-4.2.1.tar.gz", hash = "sha256:0d4f69026fed520f8a1e0103aa36c406ef4661417f20ca643f913e33531b3b94"}, -] toml = [ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, diff --git a/pyproject.toml b/pyproject.toml index c9820a3f8..b42c26d82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,28 +55,28 @@ docs = ["sphinx", "sphinx-rtd-theme", "sphinx-copybutton", "myst-parser"] [tool.poetry.dev-dependencies] # snowflake-connector-python = "2.0.4" # Removed: Too many version conflicts! pytest = "^7.1.2" -black = {version = "^22.3", allow-prereleases = true} mypy = "^0.961" cookiecutter = "^2.1.1" PyYAML = "^6.0" -flake8-docstrings = "^1.6.0" -flake8 = "^3.9.0" pyarrow = "^8.0.0" pandas = ">=1.2.0" numpy = ">=1.20.0" tox = "^3.25.0" freezegun = "^1.2.1" viztracer = "^0.15.3" -flake8-annotations = "^2.9.0" -darglint = "^1.8.0" -isort = "^5.9.3" -pyupgrade = "^2.34.0" requests-mock = "^1.9.3" sqlalchemy2-stubs = {version = "^0.0.2a24", allow-prereleases = true} types-python-dateutil = "^2.8.17" types-requests = "^2.27.30" coverage = {extras = ["toml"], version = "^6.4"} +# Cookiecutter tests +black = "^22.3" +darglint = "^1.8.0" +flake8 = "^3.9.0" +flake8-annotations = "^2.9.0" +flake8-docstrings = "^1.6.0" + [tool.black] exclude = ".*simpleeval.*" diff --git a/samples/sample_tap_gitlab/gitlab-config.sample.json b/samples/sample_tap_gitlab/gitlab-config.sample.json index e7b502ee2..fe514a582 100644 --- a/samples/sample_tap_gitlab/gitlab-config.sample.json +++ b/samples/sample_tap_gitlab/gitlab-config.sample.json @@ -2,6 +2,6 @@ "auth_token": "dummy_key", "project_ids": [ "meltano/sdk", - "meltano/meltano", + "meltano/meltano" ] } \ No newline at end of file diff --git a/singer_sdk/helpers/_classproperty.py b/singer_sdk/helpers/_classproperty.py index 73816cec7..c14256a5e 100644 --- a/singer_sdk/helpers/_classproperty.py +++ b/singer_sdk/helpers/_classproperty.py @@ -9,10 +9,10 @@ class classproperty(property): """Class property decorator.""" def __get__(self, obj, objtype=None): - return super(classproperty, self).__get__(objtype) + return super().__get__(objtype) def __set__(self, obj, value): - super(classproperty, self).__set__(type(obj), value) + super().__set__(type(obj), value) def __delete__(self, obj): - super(classproperty, self).__delete__(type(obj)) + super().__delete__(type(obj)) diff --git a/tests/core/test_target_input.py b/tests/core/test_target_input.py index bcdb91831..f4e91133d 100644 --- a/tests/core/test_target_input.py +++ b/tests/core/test_target_input.py @@ -51,5 +51,5 @@ def test_input_arg(cli_runner, config_file_path, target): assert result.exit_code == 0 output = Path(target.config["target_folder"]) / "./users.csv" - with open(output, "r") as f: + with open(output) as f: assert f.read() == EXPECTED_OUTPUT diff --git a/tests/external_snowflake/.secrets/snowflake-config.json.template b/tests/external_snowflake/.secrets/snowflake-config.json.template index 9e26dfeeb..0967ef424 100644 --- a/tests/external_snowflake/.secrets/snowflake-config.json.template +++ b/tests/external_snowflake/.secrets/snowflake-config.json.template @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/tox.ini b/tox.ini index c8d7ee3ad..6d6c4ff4c 100644 --- a/tox.ini +++ b/tox.ini @@ -35,12 +35,15 @@ commands = poetry run coverage html open ./htmlcov/index.html +[testenv:mypy] +commands = + poetry run mypy singer_sdk --exclude='tests' + [testenv:lint] commands = poetry run black --check --diff singer_sdk/ tests/ samples/ poetry run isort --check singer_sdk tests samples poetry run flake8 singer_sdk tests samples - poetry run mypy singer_sdk --exclude='tests' [testenv:combine_coverage] commands =