Skip to content

Upgrade to Python 3.14 and modernize ruff configuration - #4

Merged
CassidyPrather merged 2 commits into
mainfrom
claude/python-ecosystem-upgrades-iddeh7
Aug 30, 2026
Merged

Upgrade to Python 3.14 and modernize ruff configuration#4
CassidyPrather merged 2 commits into
mainfrom
claude/python-ecosystem-upgrades-iddeh7

Conversation

@CassidyPrather

Copy link
Copy Markdown
Owner

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.0
    • 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
    • gcovr: 8.4 → 8.6
    • build: 1.2.1 → 1.5.0
    • twine: 6.2.0 → 7.0.0
    • requests: 2.33.0 → 2.34.2
  • Ruff Configuration: Migrated from deprecated rule codes to new rule names:

    • D203, D213, DOC201, DOC501, EM101 → human-readable names
    • PLR09, PLR1702, PLR6301, PLR2004, COM812, TRY400 → new naming scheme
    • S101assert in per-file ignores
  • Ruff Ignore Comments: Updated all # noqa: comments to use new # ruff: ignore[rule-name] format throughout codebase

  • CI/CD Updates:

    • Pinned setup-uv to specific commit hash (v10.0.1) instead of floating major tag
    • Added UV_LOCKED=1 environment variable to enforce lock file consistency
    • Updated actions/checkout from v4 to v7
    • Updated softprops/action-gh-release from v2 to v3
    • Added --output-format github to ruff check and format commands for better CI integration
    • Consolidated Python setup into single setup-uv step with python-version parameter
  • Code Changes:

    • Fixed exception handling syntax in cli.py and conftest.py (removed unnecessary parentheses around multiple exception types)
    • Updated TYPE_CHECKING imports in command modules for better type hint handling
    • Updated README with --locked flag documentation and improved setup instructions
  • Whitespace: Fixed trailing whitespace and standardized blank lines throughout workflow file

https://claude.ai/code/session_01MVn7Fq4zhepJNy4AAoT6Tn

claude added 2 commits August 30, 2026 02:14
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.
@CassidyPrather
CassidyPrather merged commit 7f43d27 into main Aug 30, 2026
2 checks passed
@CassidyPrather
CassidyPrather deleted the claude/python-ecosystem-upgrades-iddeh7 branch August 30, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants