From 1079131df901357877baa9cd17f35a2e2cbd3fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Mon, 20 Jan 2025 16:57:49 -0600 Subject: [PATCH] chore: Update templates (#2820) * chore: Update templates * Update `pass_env` * Use uv to install all Python tools in e2e workflow --- .github/dependabot.yml | 2 +- .github/workflows/api-changes.yml | 2 +- .github/workflows/cookiecutter-e2e.yml | 22 ++++++++----------- .../requirements.txt} | 0 .github/workflows/test.yml | 18 +++++++-------- .pre-commit-config.yaml | 2 +- .../.github/workflows/build.yml | 13 ++++++++--- .../.pre-commit-config.yaml | 6 ++--- .../{{cookiecutter.mapper_id}}/pyproject.toml | 18 ++++++++++----- .../{{cookiecutter.mapper_id}}/tox.ini | 2 ++ .../.github/workflows/build.yml | 13 ++++++++--- .../.pre-commit-config.yaml | 6 ++--- .../{{cookiecutter.tap_id}}/README.md | 3 ++- .../{{cookiecutter.tap_id}}/pyproject.toml | 18 ++++++++++----- .../{{cookiecutter.tap_id}}/tox.ini | 2 ++ .../.github/workflows/build.yml | 13 ++++++++--- .../.pre-commit-config.yaml | 6 ++--- .../{{cookiecutter.target_id}}/README.md | 9 ++++---- .../{{cookiecutter.target_id}}/pyproject.toml | 17 +++++++------- .../{{cookiecutter.target_id}}/tox.ini | 2 ++ 20 files changed, 105 insertions(+), 69 deletions(-) rename .github/workflows/{constraints.txt => resources/requirements.txt} (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8625a873a..5ea6b4257 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,7 +17,7 @@ updates: - "patch" versioning-strategy: increase-if-necessary - package-ecosystem: pip - directory: "/.github/workflows" + directory: "/.github/workflows/resources" schedule: interval: weekly time: "12:00" diff --git a/.github/workflows/api-changes.yml b/.github/workflows/api-changes.yml index 108d5b6f0..7f18d056f 100644 --- a/.github/workflows/api-changes.yml +++ b/.github/workflows/api-changes.yml @@ -34,7 +34,7 @@ jobs: - name: Install tools env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | python -Im pip install -U pip pipx install griffe nox diff --git a/.github/workflows/cookiecutter-e2e.yml b/.github/workflows/cookiecutter-e2e.yml index ebf054c61..21b08bff0 100644 --- a/.github/workflows/cookiecutter-e2e.yml +++ b/.github/workflows/cookiecutter-e2e.yml @@ -30,36 +30,32 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Upgrade pip - env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt - run: | - pip install pip - pip --version + + - uses: astral-sh/setup-uv@v5 + with: + version: ">=0.4.30" - name: Install Poetry env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | - pipx install poetry + uv tool install poetry poetry --version - uses: actions/setup-python@v5 with: python-version: 3.x - - uses: astral-sh/setup-uv@v5 - with: - version: ">=0.4.30" - - name: Install pre-commit + env: + UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | uv tool install --with=pre-commit-uv pre-commit pre-commit --version - name: Install Nox env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | uv tool install nox nox --version diff --git a/.github/workflows/constraints.txt b/.github/workflows/resources/requirements.txt similarity index 100% rename from .github/workflows/constraints.txt rename to .github/workflows/resources/requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f946d098..1f4f3de2f 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/**" @@ -12,13 +11,12 @@ on: - "poetry.lock" - "pyproject.toml" - ".github/workflows/test.yml" - - ".github/workflows/constraints.txt" + - ".github/workflows/resources/requirements.txt" push: branches: - main - v* paths: - - "cookiecutter/**" - "samples/**" - "singer_sdk/**" - "tests/**" @@ -26,7 +24,7 @@ on: - "poetry.lock" - "pyproject.toml" - ".github/workflows/test.yml" - - ".github/workflows/constraints.txt" + - ".github/workflows/resources/requirements.txt" workflow_dispatch: inputs: {} @@ -73,14 +71,14 @@ jobs: - name: Upgrade pip env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | pip install pip pip --version - name: Install Nox env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | pipx install 'nox[uv]' nox --version @@ -128,14 +126,14 @@ jobs: - name: Upgrade pip env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | pip install pip pip --version - name: Install Nox env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | pipx install 'nox[uv]' nox --version @@ -161,7 +159,7 @@ jobs: - name: Upgrade pip env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | pip install pip pip --version @@ -173,7 +171,7 @@ jobs: - name: Install Nox env: - PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt + PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt run: | pipx install 'nox[uv]' nox --version 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..d274826b3 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.2 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..9d18052ca 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" @@ -54,7 +61,6 @@ target-version = "py39" [tool.ruff.lint] ignore = [ "COM812", # missing-trailing-comma - "ISC001", # single-line-implicit-string-concatenation ] select = ["ALL"] @@ -65,7 +71,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..632c513b0 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 = + {{cookiecutter.mapper_id.replace('-', '_').upper()}}_* 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..25155cf73 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.2 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..10b87e0a2 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" @@ -71,7 +78,6 @@ target-version = "py39" [tool.ruff.lint] ignore = [ "COM812", # missing-trailing-comma - "ISC001", # single-line-implicit-string-concatenation ] select = ["ALL"] @@ -82,7 +88,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..18cf562e1 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 = + {{cookiecutter.tap_id.replace('-', '_').upper()}}_* 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..42c6a44f2 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.2 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..a53c1cb48 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 @@ -56,7 +58,6 @@ target-version = "py39" [tool.ruff.lint] ignore = [ "COM812", # missing-trailing-comma - "ISC001", # single-line-implicit-string-concatenation ] select = ["ALL"] @@ -67,7 +68,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..82cea9e62 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 = + {{cookiecutter.target_id.replace('-', '_').upper()}}_* deps = pytest commands =