Skip to content

Commit

Permalink
refactor(templates): Update dependencies in templates (#2695)
Browse files Browse the repository at this point in the history
* refactor(templates): Update dependencies in templates

* Simpler Ruff config
  • Loading branch information
edgarrmondragon authored Oct 2, 2024
1 parent a4a071f commit 5c68b09
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.2
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ on:
- tox.ini
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
pytest:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: {{ '${{secrets.GITHUB_TOKEN}}' }}
strategy:
fail-fast: false
matrix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ repos:
- id: trailing-whitespace

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ python_version = "3.12"
warn_unused_configs = true

[tool.ruff]
src = ["{{cookiecutter.library_name}}"]
target-version = "py39"

[tool.ruff.lint]
Expand All @@ -63,14 +62,11 @@ select = ["ALL"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.lint.isort]
known-first-party = ["{{cookiecutter.library_name}}"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[build-system]
requires = ["poetry-core==1.9.0"]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
Expand Down
19 changes: 6 additions & 13 deletions cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy

[tox]
envlist = py{39,310,311,312}
isolated_build = true
envlist = py3{9,10,11,12}
requires =
tox>=4.19

[testenv]
allowlist_externals = poetry
deps =
pytest
commands =
poetry install -v
poetry run pytest

[testenv:pytest]
# Run the python tests.
# To execute, run `tox -e pytest`
envlist = py{39,310,311,312}
commands =
poetry install -v
poetry run pytest
pytest {posargs}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.2
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ on:
- tox.ini
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
pytest:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: {{ '${{secrets.GITHUB_TOKEN}}' }}
strategy:
fail-fast: false
matrix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ repos:
- id: trailing-whitespace

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Now you can test and orchestrate using Meltano:
# Test invocation:
meltano invoke {{ cookiecutter.tap_id }} --version
# OR run a test `elt` pipeline:
meltano elt {{ cookiecutter.tap_id }} target-jsonl
meltano run {{ cookiecutter.tap_id }} target-jsonl
```

### SDK Dev Guide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ plugins = "sqlmypy"
{%- endif %}

[tool.ruff]
src = ["{{cookiecutter.library_name}}"]
target-version = "py39"

[tool.ruff.lint]
Expand All @@ -77,14 +76,11 @@ select = ["ALL"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.lint.isort]
known-first-party = ["{{cookiecutter.library_name}}"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[build-system]
requires = ["poetry-core==1.9.0"]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
Expand Down
19 changes: 6 additions & 13 deletions cookiecutter/tap-template/{{cookiecutter.tap_id}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy

[tox]
envlist = py{39,310,311,312}
isolated_build = true
envlist = py3{9,10,11,12}
requires =
tox>=4.19

[testenv]
allowlist_externals = poetry
deps =
pytest
commands =
poetry install -v
poetry run pytest

[testenv:pytest]
# Run the python tests.
# To execute, run `tox -e pytest`
envlist = py{39,310,311,312}
commands =
poetry install -v
poetry run pytest
pytest {posargs}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.2
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ on:
- tox.ini
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
pytest:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: {{ '${{secrets.GITHUB_TOKEN}}' }}
strategy:
fail-fast: false
matrix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ repos:
- id: trailing-whitespace

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.6.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ python_version = "3.12"
warn_unused_configs = true

[tool.ruff]
src = ["{{cookiecutter.library_name}}"]
target-version = "py39"

[tool.ruff.lint]
Expand All @@ -65,14 +64,11 @@ select = ["ALL"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.lint.isort]
known-first-party = ["{{cookiecutter.library_name}}"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[build-system]
requires = ["poetry-core==1.9.0"]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
Expand Down
19 changes: 6 additions & 13 deletions cookiecutter/target-template/{{cookiecutter.target_id}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy

[tox]
envlist = py{39,310,311,312}
isolated_build = true
envlist = py3{9,10,11,12}
requires =
tox>=4.19

[testenv]
allowlist_externals = poetry
deps =
pytest
commands =
poetry install -v
poetry run pytest

[testenv:pytest]
# Run the python tests.
# To execute, run `tox -e pytest`
envlist = py{39,310,311,312}
commands =
poetry install -v
poetry run pytest
pytest {posargs}

0 comments on commit 5c68b09

Please sign in to comment.