Skip to content

fix(pre-commit.ci): pin pyupgrade to Python 3.13 to avoid crash on 3.14#2824

Open
bhimrazy wants to merge 1 commit into
Lightning-AI:mainfrom
bhimrazy:fix-pyupgrade-python314-crash
Open

fix(pre-commit.ci): pin pyupgrade to Python 3.13 to avoid crash on 3.14#2824
bhimrazy wants to merge 1 commit into
Lightning-AI:mainfrom
bhimrazy:fix-pyupgrade-python314-crash

Conversation

@bhimrazy

Copy link
Copy Markdown

What does this PR do?

Pins language_version: python3.13 on the pyupgrade pre-commit hook.

pyupgrade v3.21.0 crashes on Python 3.14 with:

TypeError: cannot use a bytes pattern on a string-like object

This is caused by a breaking change in tokenize.cookie_re in Python 3.14. pre-commit.ci runs on 3.14, so every PR is currently failing the Upgrade code hook regardless of what changed.

Seen failing here: https://results.pre-commit.ci/run/github/773894671/1779979956.EqEwjW5-S9KLbyBMT9nrAA

Pinning to python3.13 keeps the hook stable until pyupgrade ships 3.14 support upstream.

pyupgrade v3.21.0 crashes on Python 3.14 due to a breaking change in
`tokenize.cookie_re` (bytes pattern vs string-like object). Pin
`language_version: python3.13` on the hook so pre-commit.ci uses a
stable interpreter until pyupgrade adds 3.14 support.
@bhimrazy bhimrazy requested a review from mruberry as a code owner May 28, 2026 15:03
@bhimrazy bhimrazy changed the title ci: pin pyupgrade to Python 3.13 to avoid crash on 3.14 fix(pre-commit.ci): pin pyupgrade to Python 3.13 to avoid crash on 3.14 May 28, 2026
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