Commit aa15ecf
fix: pin the Black target version to the minimum supported Python (#613)
Black infers its target versions from `requires-python`. Because that
bound is open-ended (`>=3.11`), it expanded to every version Black
knows about, including py315:
target_version: ['py311', 'py312', 'py313', 'py314', 'py315']
Black's safety check re-parses its output with the stdlib `ast` module
using the highest target version, which no interpreter from 3.11 to 3.14
can do. That made every lint job emit:
Warning: Python 3.14 cannot parse code formatted for Python 3.15.
Formatting was never affected, since Black only emits syntax common to
all targets and so was already formatting for the 3.11 floor; `--diff`
output is byte-identical between py311 and py315. What was lost is the
AST equivalence check that guards against Black corrupting code.
Pinning the floor explicitly restores that check and silences the
warning with no formatting change. This needs bumping alongside any
future increase to `requires-python`.
Claude-Session: https://claude.ai/code/session_01X5qn7KvBztnwaRTFoL9KNo
Co-authored-by: Claude <noreply@anthropic.com>1 parent a536e3a commit aa15ecf
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
0 commit comments