Bump ruff/mypy target to 3.11, fix pyupgrade violations#129
Open
monkeypants wants to merge 2 commits intomasterfrom
Open
Bump ruff/mypy target to 3.11, fix pyupgrade violations#129monkeypants wants to merge 2 commits intomasterfrom
monkeypants wants to merge 2 commits intomasterfrom
Conversation
added 2 commits
March 26, 2026 21:30
The project uses black for formatting and ruff for linting, but this was not documented anywhere. Add a comment to [tool.ruff] in pyproject.toml making this explicit. The CI doctrine job ran bare `pytest` instead of `uv run pytest`, causing failures on systems where the system Python lacks tomllib (pre-3.11). Use uv run for consistency with the other CI jobs. Fixes #126
The project requires Python >=3.11 (tomllib is used in doctrine infrastructure), but ruff and mypy were targeting 3.10. This suppressed valid pyupgrade suggestions. Bump both tool targets to 3.11 and apply the resulting fixes: - UP017: timezone.utc → datetime.UTC (279 occurrences) - UP042: (str, Enum) → StrEnum (13 occurrences) - F401: remove now-unused timezone and Enum imports - I001: re-sort imports after the above changes All 352 tests pass. No behavioural changes. Fixes #128
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
[tool.ruff] target-versionfrompy310topy311[tool.mypy] python_versionfrom3.10to3.11timezone.utc→datetime.UTC(str, Enum)→StrEnumtimezoneandEnumimports, re-sort import blocksContext
pyproject.tomldeclaresrequires-python = ">=3.11"but both ruff and mypy were targeting 3.10. This is not cosmetic — the doctrine infrastructure importstomllib(stdlib since 3.11), so 3.10 is not actually supported. The stale target suppressed valid pyupgrade suggestions.All changes are mechanical (auto-fixed by
ruff check --fix+black). No behavioural changes —datetime.UTCis just an alias fortimezone.utc, andStrEnumis the stdlib replacement for the(str, Enum)pattern.Stacks on #127.
Test plan
ruff checkpassesblack --checkpassesFixes #128