Upgrade to Python 3.14 and modernize ruff configuration - #4
Merged
Conversation
Python 3.14 has been stable for ~10 months and 3.15 is at rc1, so bump
`requires-python` to `>=3.14, <3.15` and move CI onto 3.14.
Dependency floors bumped to the newest releases the 7-day `exclude-newer`
policy admits:
ruff 0.14.3 -> 0.16.5 ty 0.0.25 -> 0.0.75
pytest 9.0.3 -> 9.1.1 pytest-cov 7.0.0 -> 7.1.0
trio 0.33.0 -> 0.34.0 build 1.2.1 -> 1.5.0
twine 6.2.0 -> 7.0.0 gcovr 8.4 -> 8.6
requests 2.33.0 -> 2.34.2
build 1.6.0 is out but falls inside the exclude-newer window, and 1.5.1
was yanked, so the floor lands on 1.5.0.
twine 7.0 drops support for the never-standardised metadata version 2.0;
nothing here emits it.
Three ruff 0.16 preview rules now fire and their fixes are applied:
- RUF105 rewrites `# noqa: X` as `# ruff: ignore[rule-name]`
- RUF201 replaces rule codes with names in the lint config
- TC003 moves annotation-only `argparse` imports into TYPE_CHECKING
blocks, which PEP 649 lazy annotations make safe on 3.14
The formatter also drops the parentheses from multi-exception `except`
clauses now that PEP 758 syntax is available, and it formats Python code
blocks in Markdown by default.
CI actions bumped: checkout v4 -> v7, action-gh-release v2 -> v3, and
setup-uv v5 -> v10.0.1. setup-uv stopped publishing floating major tags
after v7, so it is pinned by commit. Its `python-version` input replaces
the separate `uv python install` step.
Set `UV_LOCKED=1` at the workflow level rather than passing `--locked` to the sync step. The env var covers every uv invocation, including the implicit lock-and-sync that `uv run` performs, so a stale `uv.lock` fails the run no matter which step reaches it first. Verified that both `uv sync` and `uv run` reject a stale lockfile and point at `uv lock`. Pass `--output-format github` to both ruff steps. Ruff emits GitHub Actions workflow commands instead of its usual diagnostic blocks, which render as inline annotations on the pull request diff. `ruff format --check` only gained support for this in 0.16, and it reports the exact line and column where formatting diverges rather than naming the file. Under `preview = true` the annotation title carries the rule name, so these read as `ruff (unused-import)` rather than `ruff (F401)`. Document `--locked` as the default in the README setup command. The template setup steps deliberately keep plain `uv sync --dev` preceded by `uv lock`, because renaming the project is exactly the case where the committed lockfile is legitimately stale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR upgrades the project to Python 3.14, updates all dependencies to their latest versions, and modernizes the ruff linting configuration to use the new rule naming scheme introduced in ruff 0.7+.
Key Changes
Python Version: Updated minimum Python requirement from 3.13 to 3.14
Dependencies: Updated all dev and runtime dependencies to latest compatible versions:
trio: 0.33.0 → 0.34.0ruff: 0.14.3 → 0.16.5ty: 0.0.25 → 0.0.75pytest: 9.0.3 → 9.1.1pytest-cov: 7.0.0 → 7.1.0gcovr: 8.4 → 8.6build: 1.2.1 → 1.5.0twine: 6.2.0 → 7.0.0requests: 2.33.0 → 2.34.2Ruff Configuration: Migrated from deprecated rule codes to new rule names:
D203,D213,DOC201,DOC501,EM101→ human-readable namesPLR09,PLR1702,PLR6301,PLR2004,COM812,TRY400→ new naming schemeS101→assertin per-file ignoresRuff Ignore Comments: Updated all
# noqa:comments to use new# ruff: ignore[rule-name]format throughout codebaseCI/CD Updates:
setup-uvto specific commit hash (v10.0.1) instead of floating major tagUV_LOCKED=1environment variable to enforce lock file consistencyactions/checkoutfrom v4 to v7softprops/action-gh-releasefrom v2 to v3--output-format githubto ruff check and format commands for better CI integrationsetup-uvstep withpython-versionparameterCode Changes:
cli.pyandconftest.py(removed unnecessary parentheses around multiple exception types)TYPE_CHECKINGimports in command modules for better type hint handling--lockedflag documentation and improved setup instructionsWhitespace: Fixed trailing whitespace and standardized blank lines throughout workflow file
https://claude.ai/code/session_01MVn7Fq4zhepJNy4AAoT6Tn