diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f946d098..e0257a902 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,6 @@ on: pull_request: types: [opened, synchronize, reopened] paths: - - "cookiecutter/**" - "samples/**" - "singer_sdk/**" - "tests/**" @@ -18,7 +17,6 @@ on: - main - v* paths: - - "cookiecutter/**" - "samples/**" - "singer_sdk/**" - "tests/**" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db4016c54..072e6dca8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,6 +59,6 @@ repos: )$ - repo: https://github.com/python-poetry/poetry - rev: 2.0.1 + rev: 2.0.0 hooks: - id: poetry-check diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/build.yml b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/build.yml index d0bc4e129..006842d16 100644 --- a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/build.yml +++ b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/build.yml @@ -10,11 +10,12 @@ permissions: jobs: build: runs-on: ubuntu-latest + outputs: + version: {{ '${{ steps.baipp.outputs.package_version }}' }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: hynek/build-and-inspect-python-package@v2 + id: baipp publish: name: Publish to PyPI @@ -23,7 +24,13 @@ jobs: ## TODO: optionally provide the name of the environment for the trusted ## publisher on PyPI ## https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment - # environment: pypi + # environment: + # name: pypi + {%- if cookiecutter.variant != "None (Skip)" %} + # url: https://pypi.org/project/"{{cookiecutter.variant}}-{{cookiecutter.mapper_id}}"/{{ '${{ steps.baipp.outputs.package_version }}' }} + {%- else %} + # url: https://pypi.org/project/"{{cookiecutter.mapper_id}}"/{{ '${{ steps.baipp.outputs.package_version }}' }} + {%- endif %} if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v4 diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.pre-commit-config.yaml b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.pre-commit-config.yaml index 32362f61e..62d553fa9 100644 --- a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.pre-commit-config.yaml +++ b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.pre-commit-config.yaml @@ -18,19 +18,19 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.30.0 + rev: 0.31.0 hooks: - id: check-dependabot - id: check-github-workflows - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.3 + rev: v0.9.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.1 hooks: - id: mypy diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml index 966ba82e9..b277fe637 100644 --- a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml +++ b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml @@ -1,4 +1,4 @@ -[tool.poetry] +[project] {%- if cookiecutter.variant != "None (Skip)" %} name = "{{cookiecutter.variant}}-{{cookiecutter.mapper_id}}" {%- else %} @@ -7,7 +7,7 @@ name = "{{cookiecutter.mapper_id}}" version = "0.0.1" description = "Singer mapper {{cookiecutter.name}}, built with the Meltano Singer SDK." readme = "README.md" -authors = ["{{ cookiecutter.admin_name }} <{{ cookiecutter.admin_email }}>"] +authors = [{ name = "{{ cookiecutter.admin_name }}", email = "{{ cookiecutter.admin_email }}" }] keywords = [ "ELT", "Mapper", @@ -15,6 +15,7 @@ keywords = [ ] classifiers = [ "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -23,6 +24,11 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] license = "Apache-2.0" +license-files = [ "LICENSE" ] +requires-python = ">=3.9" +dynamic = ["dependencies"] + +[tool.poetry] {%- if cookiecutter.variant != "None (Skip)" %} packages = [ { include = "{{cookiecutter.library_name}}" }, @@ -30,7 +36,6 @@ packages = [ {%- endif %} [tool.poetry.dependencies] -python = ">=3.9" singer-sdk = { version="~=0.43.1"{{ ', extras = ["faker"]' if cookiecutter.faker_extra }} } fs-s3fs = { version = "~=1.1.1", optional = true } @@ -42,7 +47,9 @@ singer-sdk = { version="~=0.43.1", extras = ["testing"] } s3 = ["fs-s3fs"] [tool.pytest.ini_options] -addopts = '--durations=10' +addopts = [ + "--durations=10", +] [tool.mypy] python_version = "3.12" @@ -65,7 +72,7 @@ allow-star-arg-any = true convention = "google" [build-system] -requires = ["poetry-core"] +requires = ["poetry-core>=2,<3"] build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] diff --git a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/tox.ini b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/tox.ini index 90c122a54..04ffbb6af 100644 --- a/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/tox.ini +++ b/cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/tox.ini @@ -6,6 +6,8 @@ requires = tox>=4.19 [testenv] +pass_env = + MAPPER_* deps = pytest commands = diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/build.yml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/build.yml index d0bc4e129..03824b143 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/build.yml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/build.yml @@ -10,11 +10,12 @@ permissions: jobs: build: runs-on: ubuntu-latest + outputs: + version: {{ '${{ steps.baipp.outputs.package_version }}' }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: hynek/build-and-inspect-python-package@v2 + id: baipp publish: name: Publish to PyPI @@ -23,7 +24,13 @@ jobs: ## TODO: optionally provide the name of the environment for the trusted ## publisher on PyPI ## https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment - # environment: pypi + # environment: + # name: pypi + {%- if cookiecutter.variant != "None (Skip)" %} + # url: https://pypi.org/project/"{{cookiecutter.variant}}-{{cookiecutter.tap_id}}"/{{ '${{ steps.baipp.outputs.package_version }}' }} + {%- else %} + # url: https://pypi.org/project/"{{cookiecutter.tap_id}}"/{{ '${{ steps.baipp.outputs.package_version }}' }} + {%- endif %} if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v4 diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml index e786131a2..e9466880e 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml @@ -18,20 +18,20 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.30.0 + rev: 0.31.0 hooks: - id: check-dependabot - id: check-github-workflows - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.3 + rev: v0.9.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.1 hooks: - id: mypy additional_dependencies: diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/README.md b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/README.md index fd45e8697..3aa834221 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/README.md +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/README.md @@ -121,7 +121,8 @@ Now you can test and orchestrate using Meltano: ```bash # Test invocation: meltano invoke {{ cookiecutter.tap_id }} --version -# OR run a test `elt` pipeline: + +# OR run a test ELT pipeline: meltano run {{ cookiecutter.tap_id }} target-jsonl ``` diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml index 72a9e8c3f..d44a2e78a 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml @@ -1,4 +1,4 @@ -[tool.poetry] +[project] {%- if cookiecutter.variant != "None (Skip)" %} name = "{{cookiecutter.variant}}-{{cookiecutter.tap_id}}" {%- else %} @@ -7,13 +7,14 @@ name = "{{cookiecutter.tap_id}}" version = "0.0.1" description = "Singer tap for {{cookiecutter.source_name}}, built with the Meltano Singer SDK." readme = "README.md" -authors = ["{{ cookiecutter.admin_name }} <{{ cookiecutter.admin_email }}>"] +authors = [{ name = "{{ cookiecutter.admin_name }}", email = "{{ cookiecutter.admin_email }}" }] keywords = [ "ELT", "{{cookiecutter.source_name}}", ] classifiers = [ "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -22,6 +23,11 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] license = "Apache-2.0" +license-files = [ "LICENSE" ] +requires-python = ">=3.9" +dynamic = ["dependencies"] + +[tool.poetry] {%- if cookiecutter.variant != "None (Skip)" %} packages = [ { include = "{{cookiecutter.library_name}}" }, @@ -29,7 +35,6 @@ packages = [ {%- endif %} [tool.poetry.dependencies] -python = ">=3.9" singer-sdk = { version="~=0.43.1", extras = [ {%- if cookiecutter.auth_method == "JWT" -%}"jwt", {% endif -%} {%- if cookiecutter.faker_extra -%}"faker",{%- endif -%} @@ -54,7 +59,9 @@ singer-sdk = { version="~=0.43.1", extras = ["testing"] } s3 = ["fs-s3fs"] [tool.pytest.ini_options] -addopts = '--durations=10' +addopts = [ + "--durations=10", +] [tool.mypy] python_version = "3.12" @@ -82,7 +89,7 @@ allow-star-arg-any = true convention = "google" [build-system] -requires = ["poetry-core"] +requires = ["poetry-core>=2,<3"] build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/tox.ini b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/tox.ini index 90c122a54..179548390 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/tox.ini +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/tox.ini @@ -6,6 +6,8 @@ requires = tox>=4.19 [testenv] +pass_env = + TAP_* deps = pytest commands = diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/build.yml b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/build.yml index d0bc4e129..89514da3e 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/build.yml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/build.yml @@ -10,11 +10,12 @@ permissions: jobs: build: runs-on: ubuntu-latest + outputs: + version: {{ '${{ steps.baipp.outputs.package_version }}' }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: hynek/build-and-inspect-python-package@v2 + id: baipp publish: name: Publish to PyPI @@ -23,7 +24,13 @@ jobs: ## TODO: optionally provide the name of the environment for the trusted ## publisher on PyPI ## https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment - # environment: pypi + # environment: + # name: pypi + {%- if cookiecutter.variant != "None (Skip)" %} + # url: https://pypi.org/project/"{{cookiecutter.variant}}-{{cookiecutter.target_id}}"/{{ '${{ steps.baipp.outputs.package_version }}' }} + {%- else %} + # url: https://pypi.org/project/"{{cookiecutter.target_id}}"/{{ '${{ steps.baipp.outputs.package_version }}' }} + {%- endif %} if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v4 diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml b/cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml index 3ca45cbc8..8c77d1c10 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml @@ -18,20 +18,20 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.30.0 + rev: 0.31.0 hooks: - id: check-dependabot - id: check-github-workflows - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.3 + rev: v0.9.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.1 hooks: - id: mypy additional_dependencies: diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/README.md b/cookiecutter/target-template/{{cookiecutter.target_id}}/README.md index 0b6b20569..b4fd87fbc 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/README.md +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/README.md @@ -66,8 +66,8 @@ You can easily run `{{ cookiecutter.target_id }}` by itself or in a pipeline usi ```bash {{ cookiecutter.target_id }} --version {{ cookiecutter.target_id }} --help -# Test using the "Carbon Intensity" sample: -tap-carbon-intensity | {{ cookiecutter.target_id }} --config /path/to/{{ cookiecutter.target_id }}-config.json +# Test using the "Smoke Test" tap: +tap-smoke-test | {{ cookiecutter.target_id }} --config /path/to/{{ cookiecutter.target_id }}-config.json ``` ## Developer Resources @@ -122,8 +122,9 @@ Now you can test and orchestrate using Meltano: ```bash # Test invocation: meltano invoke {{ cookiecutter.target_id }} --version -# OR run a test `elt` pipeline with the Carbon Intensity sample tap: -meltano run tap-carbon-intensity {{ cookiecutter.target_id }} + +# OR run a test ELT pipeline with the Smoke Test sample tap: +meltano run tap-smoke-test {{ cookiecutter.target_id }} ``` ### SDK Dev Guide diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml b/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml index 9b9d19945..da39e1d94 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml @@ -1,4 +1,4 @@ -[tool.poetry] +[project] {%- if cookiecutter.variant != "None (Skip)" %} name = "{{cookiecutter.variant}}-{{cookiecutter.target_id}}" {%- else %} @@ -7,13 +7,14 @@ name = "{{cookiecutter.target_id}}" version = "0.0.1" description = "Singer target for {{cookiecutter.destination_name}}, built with the Meltano Singer SDK." readme = "README.md" -authors = ["{{ cookiecutter.admin_name }} <{{ cookiecutter.admin_email }}>"] +authors = [{ name = "{{ cookiecutter.admin_name }}", email = "{{ cookiecutter.admin_email }}" }] keywords = [ "ELT", "{{cookiecutter.destination_name}}", ] classifiers = [ "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -22,6 +23,11 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] license = "Apache-2.0" +license-files = [ "LICENSE" ] +requires-python = ">=3.9" +dynamic = ["dependencies"] + +[tool.poetry] {%- if cookiecutter.variant != "None (Skip)" %} packages = [ { include = "{{cookiecutter.library_name}}" }, @@ -29,7 +35,6 @@ packages = [ {%- endif %} [tool.poetry.dependencies] -python = ">=3.9" singer-sdk = { version="~=0.43.1"{{ ', extras = ["faker"]' if cookiecutter.faker_extra }} } fs-s3fs = { version = "~=1.1.1", optional = true } {%- if cookiecutter.serialization_method != "SQL" %} @@ -43,9 +48,6 @@ singer-sdk = { version="~=0.43.1", extras = ["testing"] } [tool.poetry.extras] s3 = ["fs-s3fs"] -[tool.pytest.ini_options] -addopts = '--durations=10' - [tool.mypy] python_version = "3.12" warn_unused_configs = true @@ -67,7 +69,7 @@ allow-star-arg-any = true convention = "google" [build-system] -requires = ["poetry-core"] +requires = ["poetry-core>=2,<3"] build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini b/cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini index 90c122a54..dd0579b01 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini @@ -6,6 +6,8 @@ requires = tox>=4.19 [testenv] +pass_env = + TARGET_* deps = pytest commands =