You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CHORE] Pin pre-commit python to 3.14 so PEP 758 bare-except syntax stops false-flagging #803
Ratified decision (2026-07-03, revised): keep the PEP 758 unparenthesized except X, Y: form — it is the forward Python standard (valid 3.14, 3.15, onward) and is exactly what ruff format produces at target-version = py314 (it strips added parentheses). Parenthesizing to except (X, Y): fights the formatter and pins formatting to the past, so we do not do that.
The only thing that breaks on the current syntax is a tool running a pre-3.14 Python parser. Locally, the flake-provided pre-commit is itself a Python-3.13 app, so it builds its debug-statements hook env with 3.13, which rejects PEP 758 with SyntaxError: multiple exception types must be parenthesized. CI is unaffected when pre-commit runs under the project's 3.14.
Fix
Pin pre-commit to the project interpreter so every python-language hook matches the code:
default_language_version:
python: python3.14
This makes the bare flake pre-commit (3.13) build hook envs with 3.14, so the false SyntaxError disappears regardless of how pre-commit is invoked. Future-proof and aligned with requires-python >=3.14.
Out of scope
Propagating the "embrace PEP 758, don't parenthesize" convention to the org standards SSoT (vig-os/meta/docs) — track separately.
Notes
Superseded the initial framing of this issue (which proposed parenthesizing) after finding ruff enforces the unparenthesized form. Surfaced while fixing CI on #718 (PR #802).
changed the title [-][CHORE] Standardize on parenthesized except tuples (except (X, Y):) — portable across Python versions[/-][+][CHORE] Pin pre-commit python to 3.14 so PEP 758 bare-except syntax stops false-flagging[/+]on Jul 3, 2026
Resolved by #804 (merged to dev). Decision: keep the PEP 758 unparenthesized except X, Y: form (the forward standard, valid 3.14+, and what ruff-format emits at target py314) and fix the tooling instead — pinned default_language_version: python: python3.14 so pre-commit hook envs match the project interpreter. Follow-up: record the convention in the org standards SSoT (vig-os/meta/docs).
Activity
[-][CHORE] Standardize on parenthesized except tuples (except (X, Y):) — portable across Python versions[/-][+][CHORE] Pin pre-commit python to 3.14 so PEP 758 bare-except syntax stops false-flagging[/+]ci: pin pre-commit python to 3.14 for PEP 758 bare-except tuples
ci: pin pre-commit python to 3.14 for PEP 758 bare-except tuples (#804)
c-vigo commentedon Jul 3, 2026
Resolved by #804 (merged to
dev). Decision: keep the PEP 758 unparenthesizedexcept X, Y:form (the forward standard, valid 3.14+, and what ruff-format emits at target py314) and fix the tooling instead — pinneddefault_language_version: python: python3.14so pre-commit hook envs match the project interpreter. Follow-up: record the convention in the org standards SSoT (vig-os/meta/docs).fix(workspace): preserve the consumer .pre-commit-config.yaml on upgr…