mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 20:27:02 +01:00
`requires-python` and the CI pin already said 3.14, but ruff, mypy and pylint were still grading `meta/` against 3.10 -- three tools judging an interpreter nothing runs any more, and ruff withholding the pyupgrade fixes that only become safe at the newer target. `pin_ci_python.py` rewrites these three knobs. What the stale target was hiding: `datetime.timezone.utc` where `datetime.UTC` is now correct (UP017), and ruff's stable formatter applying PEP 758 -- `except (A, B):` becomes `except A, B:`. That makes the source 3.14-only at the syntax level, which is what `requires-python = ">=3.14"` already promised; kuhy chose it deliberately over holding ruff a release back (2026-08-29). Also drops a comment in `wsg_grabber/models.py` that the bump makes false: it explained why the file used ``str, Enum`` instead of ``StrEnum`` under mypy at 3.10, sitting directly above a ``class Verdict(StrEnum)`` that had already stopped obeying it. ruff, ruff-format, mypy --strict and pylint all clean at the new target. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SfnJmxxsZ534AKk16rC2Gr
45 lines
2.2 KiB
JSON
45 lines
2.2 KiB
JSON
{
|
|
"intent": "Make ruff, mypy and pylint grade this repo against the same Python the code actually runs on, so the fleet's 'exactly one Python, always the newest' decision holds for the graders and not just for CI.",
|
|
"scope": [
|
|
"meta/pyproject.toml: ruff target-version, mypy python_version, pylint py-version",
|
|
"python_pkg/**: the source rewrites those three knobs then required",
|
|
"Non-goal: dependency pins, CI workflow files, and anything under app/ or web/"
|
|
],
|
|
"changes": [
|
|
"pin_ci_python.py rewrote target-version py310 -> py314, python_version 3.10 -> 3.14 and py-version 3.10 -> 3.14 in meta/pyproject.toml",
|
|
"ruff --fix applied UP017 (datetime.timezone.utc -> datetime.UTC) across the tree",
|
|
"ruff-format applied PEP 758 in its stable style: except (A, B): becomes except A, B:",
|
|
"Deleted a comment in python_pkg/wsg_grabber/models.py that justified avoiding StrEnum under mypy at 3.10, directly above a class Verdict(StrEnum) that had already stopped obeying it"
|
|
],
|
|
"verification": [
|
|
{
|
|
"command": "pre-commit run ruff --all-files",
|
|
"result": "pass",
|
|
"evidence": "ruff (legacy alias) Passed"
|
|
},
|
|
{
|
|
"command": "pre-commit run ruff-format --all-files",
|
|
"result": "pass",
|
|
"evidence": "ruff format Passed"
|
|
},
|
|
{
|
|
"command": "pre-commit run mypy --all-files",
|
|
"result": "pass",
|
|
"evidence": "mypy Passed"
|
|
},
|
|
{
|
|
"command": "pre-commit run pylint --all-files",
|
|
"result": "pass",
|
|
"evidence": "pylint Passed"
|
|
}
|
|
],
|
|
"risks": [
|
|
"PEP 758 makes the source a SyntaxError on 3.13 and older, and except A, B: is visually identical to the Python 2 except E, name: idiom that meant something entirely different. requires-python already said >=3.14; kuhy chose this over holding ruff a release back on 2026-08-29.",
|
|
"A future ruff release could add further target-gated formatter changes; the same three knobs are where that would surface."
|
|
],
|
|
"rollback": [
|
|
"git revert the commit: the three knobs and the source rewrites move together, so reverting restores a self-consistent py310 target.",
|
|
"After rollback, re-run pre-commit run --all-files; ruff at py310 will not reintroduce the UP017 or PEP 758 forms."
|
|
]
|
|
}
|