From 52b534022352dc739848141efd20a37e97548ac6 Mon Sep 17 00:00:00 2001 From: Austin Gregg-Smith Date: Sun, 25 Oct 2026 21:00:08 +0000 Subject: [PATCH 1/4] chore: drop pylint references from docs, dependabot and VS Code tasks --- .claude/README.md | 2 +- .github/dependabot.yml | 1 - .vscode/tasks.json | 2 +- PROMPT.md | 2 +- docs/conf.py | 2 +- docs/intro.rst | 1 - 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.claude/README.md b/.claude/README.md index eb64faf..087a4b3 100644 --- a/.claude/README.md +++ b/.claude/README.md @@ -22,7 +22,7 @@ Once setup is complete, Claude can use these pixi tasks: #### Testing & Quality - `pixi run test` - Run pytest tests - `pixi run coverage` - Run tests with coverage report -- `pixi run lint` - Run ruff and pylint linters +- `pixi run lint` - Run ruff check, ruff format --check and ty - `pixi run format` - Format code with ruff #### CI Tasks diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7d086f3..322103d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,7 +15,6 @@ updates: patterns: - "check-manifest" - "prek" - - "pylint" - "pytest" - "pytest-cov" - "hypothesis" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 8252d16..b83b945 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -29,7 +29,7 @@ }, { "label": "lint", - "detail": "Run pylint on files tracked by git", + "detail": "Run ruff check, ruff format --check and ty", "type": "shell", "command": "pixi run lint" }, diff --git a/PROMPT.md b/PROMPT.md index c9b9f16..0f9a73b 100644 --- a/PROMPT.md +++ b/PROMPT.md @@ -7,7 +7,7 @@ ## Development Commands - `pixi run test` - Run tests -- `pixi run lint` - Run linters (ruff, pylint, ty) +- `pixi run lint` - Run linters (ruff check, ruff format --check, ty) - `pixi run format` - Format code - `pixi run ci` - Full CI pipeline diff --git a/docs/conf.py b/docs/conf.py index 0a2071b..d442c33 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -8,7 +8,7 @@ from importlib import metadata -copyright = "2023, Austin Gregg-Smith" # pylint:disable=redefined-builtin +copyright = "2023, Austin Gregg-Smith" author = "Austin Gregg-Smith" release = metadata.version("python_template") project = f"python_template {release}" diff --git a/docs/intro.rst b/docs/intro.rst index 3ce0feb..a1ba12e 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -5,7 +5,6 @@ A template repo for python projects This has basic setup for -* pylint * ruff (formatting and linting) * pytest * codecov From c1d2167ec39e0dd2cee9ba3ecfb426bac59f9366 Mon Sep 17 00:00:00 2001 From: Austin Gregg-Smith Date: Sun, 25 Oct 2026 21:00:08 +0000 Subject: [PATCH 2/4] ci: run one pinned ruff in CI, pixi tasks and prek hooks Pin ruff==0.17.2 in pyproject.toml as the single source. The prek ruff hooks become local hooks that run ruff from the pixi env, and the prek workflow installs the locked pixi env instead of prek-action. ci and lint now run ruff check and ruff format --check. Remove pylint. --- .github/workflows/prek.yaml | 10 +++- .pre-commit-config.yaml | 17 ++++-- README.md | 11 +++- pixi.lock | 114 ++++-------------------------------- pyproject.toml | 24 +++----- 5 files changed, 50 insertions(+), 126 deletions(-) diff --git a/.github/workflows/prek.yaml b/.github/workflows/prek.yaml index 76518a4..f9db314 100644 --- a/.github/workflows/prek.yaml +++ b/.github/workflows/prek.yaml @@ -7,4 +7,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: j178/prek-action@v2 + # The ruff hooks are local hooks that run ruff (and prek) from the pixi + # environment, so CI uses the same pinned versions as local. + - uses: prefix-dev/setup-pixi@v0.10.0 + with: + cache: true + frozen: true + environments: default + - name: prek + run: pixi run --frozen prek run --all-files --show-diff-on-failure diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b519e8f..f7d6029 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,14 +40,21 @@ repos: # - id: trailing-whitespace - id: fix-byte-order-marker - # Formatter for python - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.2 + # Ruff runs from the pixi environment, so these hooks, `pixi run lint` and CI + # all use the one ruff pinned in pyproject.toml. Change the version there only. + - repo: local hooks: - - # Run the formatter. + - id: ruff-check + name: ruff check + entry: pixi run --frozen ruff check --fix --exit-non-zero-on-fix + language: system + types_or: [ python, pyi ] - id: ruff-format + name: ruff format + entry: pixi run --frozen ruff format + language: system types_or: [ python, pyi ] + # Shell script linter - repo: https://github.com/shellcheck-py/shellcheck-py rev: v0.11.0.1 diff --git a/README.md b/README.md index 153ebd3..7e6a52c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ A template repo for python projects that is set up using [pixi](https://pixi.sh) This has basic setup for -* pylint * ruff (formatting and linting) * pytest * git-lfs @@ -13,6 +12,16 @@ This has basic setup for * pypi upload * dependabot +## One ruff version + +Ruff is pinned once, as `ruff==X.Y.Z` in `pyproject.toml`. Everything else runs that ruff from the pixi environment: + +* `pixi run lint` and `pixi run ci` run `ruff check .` and `ruff format --check .` +* the prek hooks in `.pre-commit-config.yaml` are `repo: local` hooks that run `pixi run --frozen ruff ...`, so they carry no version of their own +* CI (`ci.yml` and `prek.yaml`) installs the locked pixi environment with `setup-pixi` + +To change the ruff version, edit the pin in `pyproject.toml` and run `pixi lock`. Do not add a `rev:` for ruff to `.pre-commit-config.yaml` or a `version:` to a ruff GitHub action. Child repos pick this setup up through `pixi run update-from-template-repo`. + ## Continuous Integration Status [![Ci](https://github.com/blooop/python_template/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/blooop/python_template/actions/workflows/ci.yml?query=branch%3Amain) diff --git a/pixi.lock b/pixi.lock index ad2cf25..fd67f4d 100644 --- a/pixi.lock +++ b/pixi.lock @@ -44,22 +44,15 @@ environments: - conda: https://prefix.dev/blooop/linux-64/ralph-orchestrator-2.6.0-hb0f4dca_0.conda - pypi: ./ - pypi: https://files.pythonhosted.org/packages/01/f8/c151e196d4f397ed9436a071e52666c70a2f021138dea828b0a461e245db/hypothesis-6.155.7-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/1e/77/dc8c558f7593132cf8fefec57c4f60c83b16941c574ac5f619abb3ae7933/dill-0.4.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/27/ca/59ea35fb99743549ec8b37eff141ece4431fea590c89e536ed8032ef45cf/coverage-7.14.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl - pypi: https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/3e/95/c7c34aa53c16353c56d0b802fba48d5f5caa2cdee7958acbcb795c830416/isort-8.0.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/48/31/05e764397056194206169869b50cf2fee4dbbbc71b344705b9c0d878d4d8/platformdirs-4.9.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/86/b1/a976a136d40ade83ce743578399865f57001003a409acadc0ecbb3051082/ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a5/26/c250c2c569adc53a8591716641388397bcb2a442e4a30b952ae81b50c0e0/ty-0.0.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - - pypi: https://files.pythonhosted.org/packages/ab/da/acb2e7d4dbd2dfb792d38c0d850481f29ad7049b356d23f56c687d35203b/pylint-4.0.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b0/cf/1c5f42b110e57bc5502eb80dbc3b03d256926062519224835ef08134f1f9/astroid-4.0.4-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/bb/1c/c6a7800406f987559fc8e7c2cfd257a5a68096e806e953f143b488e00e4f/prek-0.4.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/c3/d8/59894cf630d2d86882457a2a6a0a1533410c5c805bfbac6f6eb4b5aef69d/ruff-0.17.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl py310: @@ -101,23 +94,16 @@ environments: - pypi: ./ - pypi: https://files.pythonhosted.org/packages/01/f8/c151e196d4f397ed9436a071e52666c70a2f021138dea828b0a461e245db/hypothesis-6.155.7-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/1e/77/dc8c558f7593132cf8fefec57c4f60c83b16941c574ac5f619abb3ae7933/dill-0.4.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/3e/95/c7c34aa53c16353c56d0b802fba48d5f5caa2cdee7958acbcb795c830416/isort-8.0.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/48/31/05e764397056194206169869b50cf2fee4dbbbc71b344705b9c0d878d4d8/platformdirs-4.9.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/86/b1/a976a136d40ade83ce743578399865f57001003a409acadc0ecbb3051082/ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a5/26/c250c2c569adc53a8591716641388397bcb2a442e4a30b952ae81b50c0e0/ty-0.0.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - - pypi: https://files.pythonhosted.org/packages/ab/da/acb2e7d4dbd2dfb792d38c0d850481f29ad7049b356d23f56c687d35203b/pylint-4.0.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b0/cf/1c5f42b110e57bc5502eb80dbc3b03d256926062519224835ef08134f1f9/astroid-4.0.4-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/bb/1c/c6a7800406f987559fc8e7c2cfd257a5a68096e806e953f143b488e00e4f/prek-0.4.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/c3/d8/59894cf630d2d86882457a2a6a0a1533410c5c805bfbac6f6eb4b5aef69d/ruff-0.17.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/da/bb/e9ecea1307c6a549c223842cccbd5d55193cc27b82f26338782d4355047c/coverage-7.14.3-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl @@ -159,22 +145,15 @@ environments: - conda: https://prefix.dev/blooop/linux-64/ralph-orchestrator-2.6.0-hb0f4dca_0.conda - pypi: ./ - pypi: https://files.pythonhosted.org/packages/01/f8/c151e196d4f397ed9436a071e52666c70a2f021138dea828b0a461e245db/hypothesis-6.155.7-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/1e/77/dc8c558f7593132cf8fefec57c4f60c83b16941c574ac5f619abb3ae7933/dill-0.4.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/39/7f/117dd2ec65e4140576f8ef991d88220f9b806769f7a8c20e0550c0f924e2/coverage-7.14.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl - - pypi: https://files.pythonhosted.org/packages/3e/95/c7c34aa53c16353c56d0b802fba48d5f5caa2cdee7958acbcb795c830416/isort-8.0.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/48/31/05e764397056194206169869b50cf2fee4dbbbc71b344705b9c0d878d4d8/platformdirs-4.9.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/86/b1/a976a136d40ade83ce743578399865f57001003a409acadc0ecbb3051082/ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a5/26/c250c2c569adc53a8591716641388397bcb2a442e4a30b952ae81b50c0e0/ty-0.0.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - - pypi: https://files.pythonhosted.org/packages/ab/da/acb2e7d4dbd2dfb792d38c0d850481f29ad7049b356d23f56c687d35203b/pylint-4.0.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b0/cf/1c5f42b110e57bc5502eb80dbc3b03d256926062519224835ef08134f1f9/astroid-4.0.4-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/bb/1c/c6a7800406f987559fc8e7c2cfd257a5a68096e806e953f143b488e00e4f/prek-0.4.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/c3/d8/59894cf630d2d86882457a2a6a0a1533410c5c805bfbac6f6eb4b5aef69d/ruff-0.17.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl py312: @@ -216,21 +195,14 @@ environments: - pypi: ./ - pypi: https://files.pythonhosted.org/packages/01/f8/c151e196d4f397ed9436a071e52666c70a2f021138dea828b0a461e245db/hypothesis-6.155.7-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/06/c2/05b8c890097c61a7f4406b35396b997a635200ded0339eda83dfbe526c5f/coverage-7.14.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl - - pypi: https://files.pythonhosted.org/packages/1e/77/dc8c558f7593132cf8fefec57c4f60c83b16941c574ac5f619abb3ae7933/dill-0.4.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/3e/95/c7c34aa53c16353c56d0b802fba48d5f5caa2cdee7958acbcb795c830416/isort-8.0.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/48/31/05e764397056194206169869b50cf2fee4dbbbc71b344705b9c0d878d4d8/platformdirs-4.9.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/86/b1/a976a136d40ade83ce743578399865f57001003a409acadc0ecbb3051082/ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a5/26/c250c2c569adc53a8591716641388397bcb2a442e4a30b952ae81b50c0e0/ty-0.0.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - - pypi: https://files.pythonhosted.org/packages/ab/da/acb2e7d4dbd2dfb792d38c0d850481f29ad7049b356d23f56c687d35203b/pylint-4.0.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b0/cf/1c5f42b110e57bc5502eb80dbc3b03d256926062519224835ef08134f1f9/astroid-4.0.4-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/bb/1c/c6a7800406f987559fc8e7c2cfd257a5a68096e806e953f143b488e00e4f/prek-0.4.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/c3/d8/59894cf630d2d86882457a2a6a0a1533410c5c805bfbac6f6eb4b5aef69d/ruff-0.17.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl py313: @@ -270,22 +242,15 @@ environments: - conda: https://prefix.dev/blooop/linux-64/ralph-orchestrator-2.6.0-hb0f4dca_0.conda - pypi: ./ - pypi: https://files.pythonhosted.org/packages/01/f8/c151e196d4f397ed9436a071e52666c70a2f021138dea828b0a461e245db/hypothesis-6.155.7-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/1e/77/dc8c558f7593132cf8fefec57c4f60c83b16941c574ac5f619abb3ae7933/dill-0.4.1-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/3e/95/c7c34aa53c16353c56d0b802fba48d5f5caa2cdee7958acbcb795c830416/isort-8.0.1-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/48/31/05e764397056194206169869b50cf2fee4dbbbc71b344705b9c0d878d4d8/platformdirs-4.9.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/82/50/dfce42eff2cecabcd5a9bbad5489449c87db3415f408d23ffee417ce01f6/coverage-7.14.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl - - pypi: https://files.pythonhosted.org/packages/86/b1/a976a136d40ade83ce743578399865f57001003a409acadc0ecbb3051082/ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a5/26/c250c2c569adc53a8591716641388397bcb2a442e4a30b952ae81b50c0e0/ty-0.0.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - - pypi: https://files.pythonhosted.org/packages/ab/da/acb2e7d4dbd2dfb792d38c0d850481f29ad7049b356d23f56c687d35203b/pylint-4.0.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b0/cf/1c5f42b110e57bc5502eb80dbc3b03d256926062519224835ef08134f1f9/astroid-4.0.4-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/bb/1c/c6a7800406f987559fc8e7c2cfd257a5a68096e806e953f143b488e00e4f/prek-0.4.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + - pypi: https://files.pythonhosted.org/packages/c3/d8/59894cf630d2d86882457a2a6a0a1533410c5c805bfbac6f6eb4b5aef69d/ruff-0.17.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - pypi: https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl packages: @@ -759,11 +724,10 @@ packages: - pypi: ./ name: python-template requires_dist: - - pylint<=4.0.6,>=4.0.6 ; extra == 'test' - pytest-cov<=7.1.0,>=7.1.0 ; extra == 'test' - pytest<=9.1.1,>=9.1.1 ; extra == 'test' - hypothesis<=6.155.7,>=6.155.7 ; extra == 'test' - - ruff<=0.15.20,>=0.15.20 ; extra == 'test' + - ruff==0.17.2 ; extra == 'test' - coverage<=7.14.3,>=7.14.3 ; extra == 'test' - prek>=0.4.6,<0.5.0 ; extra == 'test' - ty<=0.0.65,>=0.0.65 ; extra == 'test' @@ -822,14 +786,6 @@ packages: version: 4.15.0 sha256: f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548 requires_python: '>=3.9' -- pypi: https://files.pythonhosted.org/packages/1e/77/dc8c558f7593132cf8fefec57c4f60c83b16941c574ac5f619abb3ae7933/dill-0.4.1-py3-none-any.whl - name: dill - version: 0.4.1 - sha256: 1e1ce33e978ae97fcfcff5638477032b801c46c7c65cf717f95fbc2248f79a9d - requires_dist: - - objgraph>=1.7.2 ; extra == 'graph' - - gprof2dot>=2022.7.29 ; extra == 'profile' - requires_python: '>=3.9' - pypi: https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl name: tomli version: 2.4.0 @@ -855,11 +811,6 @@ packages: - setuptools ; extra == 'dev' - xmlschema ; extra == 'dev' requires_python: '>=3.10' -- pypi: https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl - name: mccabe - version: 0.7.0 - sha256: 6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e - requires_python: '>=3.6' - pypi: https://files.pythonhosted.org/packages/27/ca/59ea35fb99743549ec8b37eff141ece4431fea590c89e536ed8032ef45cf/coverage-7.14.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl name: coverage version: 7.14.3 @@ -878,18 +829,6 @@ packages: requires_dist: - tomli ; python_full_version <= '3.11' and extra == 'toml' requires_python: '>=3.10' -- pypi: https://files.pythonhosted.org/packages/3e/95/c7c34aa53c16353c56d0b802fba48d5f5caa2cdee7958acbcb795c830416/isort-8.0.1-py3-none-any.whl - name: isort - version: 8.0.1 - sha256: 28b89bc70f751b559aeca209e6120393d43fbe2490de0559662be7a9787e3d75 - requires_dist: - - colorama ; extra == 'colors' - requires_python: '>=3.10.0' -- pypi: https://files.pythonhosted.org/packages/48/31/05e764397056194206169869b50cf2fee4dbbbc71b344705b9c0d878d4d8/platformdirs-4.9.2-py3-none-any.whl - name: platformdirs - version: 4.9.2 - sha256: 9170634f126f8efdae22fb58ae8a0eaa86f38365bc57897a6c4f781d1f5875bd - requires_python: '>=3.10' - pypi: https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl name: pluggy version: 1.6.0 @@ -908,11 +847,6 @@ packages: requires_dist: - tomli ; python_full_version <= '3.11' and extra == 'toml' requires_python: '>=3.10' -- pypi: https://files.pythonhosted.org/packages/86/b1/a976a136d40ade83ce743578399865f57001003a409acadc0ecbb3051082/ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - name: ruff - version: 0.15.20 - sha256: 309809086c2acb67624950a3c8133e80f32d0d3e27106c0cd60ff26657c9f24b - requires_python: '>=3.7' - pypi: https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl name: exceptiongroup version: 1.3.1 @@ -938,37 +872,6 @@ packages: version: 0.0.65 sha256: 5a75bd0c245c38802a8f488378e74f92feb7dd33db7d63fbdd6fdf82791ba730 requires_python: '>=3.8' -- pypi: https://files.pythonhosted.org/packages/ab/da/acb2e7d4dbd2dfb792d38c0d850481f29ad7049b356d23f56c687d35203b/pylint-4.0.6-py3-none-any.whl - name: pylint - version: 4.0.6 - sha256: d11a0e1fdb7b1cd46ec5d6fc78fee8b95f28695b2d6140e5809925f61e32ea54 - requires_dist: - - astroid>=4.0.2,<=4.1.dev0 - - colorama>=0.4.5 ; sys_platform == 'win32' - - dill>=0.2 ; python_full_version < '3.11' - - dill>=0.3.6 ; python_full_version >= '3.11' - - dill>=0.3.7 ; python_full_version >= '3.12' - - isort>=5,!=5.13,<9 - - mccabe>=0.6,<0.8 - - platformdirs>=2.2 - - tomli>=1.1 ; python_full_version < '3.11' - - tomlkit>=0.10.1 - - typing-extensions>=3.10 ; python_full_version < '3.10' - - pyenchant~=3.2 ; extra == 'spelling' - - gitpython>3 ; extra == 'testutils' - requires_python: '>=3.10.0' -- pypi: https://files.pythonhosted.org/packages/b0/cf/1c5f42b110e57bc5502eb80dbc3b03d256926062519224835ef08134f1f9/astroid-4.0.4-py3-none-any.whl - name: astroid - version: 4.0.4 - sha256: 52f39653876c7dec3e3afd4c2696920e05c83832b9737afc21928f2d2eb7a753 - requires_dist: - - typing-extensions>=4 ; python_full_version < '3.11' - requires_python: '>=3.10.0' -- pypi: https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl - name: tomlkit - version: 0.14.0 - sha256: 592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680 - requires_python: '>=3.9' - pypi: https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl name: packaging version: '26.0' @@ -979,6 +882,11 @@ packages: version: 0.4.14 sha256: 34169cb1c8dfbe4b9cb7af164f5c1c3dff68929c61ca1e1de28d378b32720836 requires_python: '>=3.8' +- pypi: https://files.pythonhosted.org/packages/c3/d8/59894cf630d2d86882457a2a6a0a1533410c5c805bfbac6f6eb4b5aef69d/ruff-0.17.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + name: ruff + version: 0.17.2 + sha256: c60f93fec7142dba5b8f487f94bf2f6231dae24dc11e4c48648347c8b0720004 + requires_python: '>=3.7' - pypi: https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl name: pygments version: 2.19.2 diff --git a/pyproject.toml b/pyproject.toml index ab42d4a..4b51c34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,11 +37,11 @@ python_template = { path = ".", editable = true } [project.optional-dependencies] test = [ - "pylint<=4.0.6,>=4.0.6", "pytest-cov<=7.1.0,>=7.1.0", "pytest<=9.1.1,>=9.1.1", "hypothesis<=6.155.7,>=6.155.7", - "ruff<=0.15.20,>=0.15.20", + # The one ruff pin: CI, `pixi run lint` and the prek hooks all run this ruff. + "ruff==0.17.2", "coverage<=7.14.3,>=7.14.3", "prek>=0.4.6,<0.5.0", "ty<=0.0.65,>=0.0.65", @@ -73,11 +73,12 @@ prek-install = "prek install" prek-update = "prek autoupdate" format = "ruff format ." check-clean-workspace = "git diff --exit-code" +format-check = "ruff format --check ." ruff-lint = "ruff check . --fix" -pylint = "pylint --version && echo 'running pylint...' && pylint $(git ls-files '*.py')" +ruff-check = "ruff check ." ty = "ty check --respect-ignore-files ." -lint = { depends-on = ["ruff-lint", "ty", "pylint"] } -style = { depends-on = ["format", "lint"] } +lint = { depends-on = ["ruff-check", "format-check", "ty"] } +style = { depends-on = ["format", "ruff-lint", "lint"] } commit-format = "git commit -a -m'autoformat code' || true" test = "pytest" coverage = "coverage run -m pytest && coverage xml -o coverage.xml" @@ -89,9 +90,8 @@ fix = { depends-on = ["update-lock", "format", "ruff-lint", "prek"] } fix-commit-push = { depends-on = ["fix", "commit-format", "update-lock-push"] } ci-no-cover = { depends-on = ["style", "test"] } ci = { depends-on = [ - "format", - "ruff-lint", - "pylint", + "ruff-check", + "format-check", "ty", "coverage", "coverage-report", @@ -103,14 +103,6 @@ update-from-template-repo = "./scripts/update_from_template.sh" dev-use-prebuilt = "./scripts/devcontainer_use_prebuilt.sh" dev-use-local = "./scripts/devcontainer_use_local.sh" -[tool.pylint] -extension-pkg-whitelist = ["numpy"] -jobs = 16 #detect number of cores - -[tool.pylint.'MESSAGES CONTROL'] -disable = "C,logging-fstring-interpolation,line-too-long,fixme,broad-exception-caught,missing-module-docstring,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-locals,too-many-branches,too-many-statements,use-dict-literal,cyclic-import,duplicate-code,too-many-public-methods" -enable = "no-else-return,consider-using-in" - [tool.coverage.run] omit = ["*/test/*", "__init__.py"] From 46691fe0efbbde637bb165d993e60c039769d8e1 Mon Sep 17 00:00:00 2001 From: Austin Gregg-Smith Date: Sun, 25 Oct 2026 21:01:07 +0000 Subject: [PATCH 3/4] fix: sort imports in test_basic for ruff 0.17; call the prek pixi task in CI --- .github/workflows/prek.yaml | 3 ++- test/test_basic.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prek.yaml b/.github/workflows/prek.yaml index f9db314..b931dad 100644 --- a/.github/workflows/prek.yaml +++ b/.github/workflows/prek.yaml @@ -15,4 +15,5 @@ jobs: frozen: true environments: default - name: prek - run: pixi run --frozen prek run --all-files --show-diff-on-failure + # `prek` is the pixi task `prek run -a`; extra args are appended to it. + run: pixi run --frozen prek --show-diff-on-failure diff --git a/test/test_basic.py b/test/test_basic.py index 91fa700..99cdc19 100644 --- a/test/test_basic.py +++ b/test/test_basic.py @@ -1,4 +1,5 @@ from unittest import TestCase + from python_template.basic_class import BasicClass From 9f352487ae5f7235e73d2dfde1b0db0ecabf71ef Mon Sep 17 00:00:00 2001 From: Austin Gregg-Smith Date: Sun, 25 Oct 2026 21:05:40 +0000 Subject: [PATCH 4/4] ci: use --locked so a stale pixi.lock fails instead of running an old ruff setup-pixi with frozen: true and pixi run --frozen use pixi.lock as it is, without checking it against pyproject.toml. Dependabot bumps the ruff pin in pyproject.toml only (see #173), so CI then passed while it ran the old ruff from the lock: the pin and the ruff that ran differed. Use locked: true in ci.yml and prek.yaml, and pixi run --locked in the prek hooks and the prek job. A pin that the lock does not match now fails with 'lock file not up-to-date with the workspace'. --- .github/workflows/ci.yml | 2 +- .github/workflows/prek.yaml | 4 ++-- .pre-commit-config.yaml | 4 ++-- README.md | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fec6cec..9fe8d25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - uses: prefix-dev/setup-pixi@v0.10.0 with: cache: true - frozen: true + locked: true environments: ${{ matrix.environment }} - name: CI run: | diff --git a/.github/workflows/prek.yaml b/.github/workflows/prek.yaml index b931dad..113ab8e 100644 --- a/.github/workflows/prek.yaml +++ b/.github/workflows/prek.yaml @@ -12,8 +12,8 @@ jobs: - uses: prefix-dev/setup-pixi@v0.10.0 with: cache: true - frozen: true + locked: true environments: default - name: prek # `prek` is the pixi task `prek run -a`; extra args are appended to it. - run: pixi run --frozen prek --show-diff-on-failure + run: pixi run --locked prek --show-diff-on-failure diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7d6029..dc8c164 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,12 +46,12 @@ repos: hooks: - id: ruff-check name: ruff check - entry: pixi run --frozen ruff check --fix --exit-non-zero-on-fix + entry: pixi run --locked ruff check --fix --exit-non-zero-on-fix language: system types_or: [ python, pyi ] - id: ruff-format name: ruff format - entry: pixi run --frozen ruff format + entry: pixi run --locked ruff format language: system types_or: [ python, pyi ] diff --git a/README.md b/README.md index 7e6a52c..bc0dec2 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ This has basic setup for Ruff is pinned once, as `ruff==X.Y.Z` in `pyproject.toml`. Everything else runs that ruff from the pixi environment: * `pixi run lint` and `pixi run ci` run `ruff check .` and `ruff format --check .` -* the prek hooks in `.pre-commit-config.yaml` are `repo: local` hooks that run `pixi run --frozen ruff ...`, so they carry no version of their own -* CI (`ci.yml` and `prek.yaml`) installs the locked pixi environment with `setup-pixi` +* the prek hooks in `.pre-commit-config.yaml` are `repo: local` hooks that run `pixi run --locked ruff ...`, so they carry no version of their own +* CI (`ci.yml` and `prek.yaml`) installs the pixi environment with `setup-pixi` and `locked: true`, so CI fails when `pixi.lock` does not match `pyproject.toml`. It does not run a stale ruff. -To change the ruff version, edit the pin in `pyproject.toml` and run `pixi lock`. Do not add a `rev:` for ruff to `.pre-commit-config.yaml` or a `version:` to a ruff GitHub action. Child repos pick this setup up through `pixi run update-from-template-repo`. +To change the ruff version, edit the pin in `pyproject.toml` and run `pixi lock`. Dependabot changes only `pyproject.toml`, so run `pixi lock` on its PR before you merge it. Do not add a `rev:` for ruff to `.pre-commit-config.yaml` or a `version:` to a ruff GitHub action. Child repos pick this setup up through `pixi run update-from-template-repo`. ## Continuous Integration Status