-
Notifications
You must be signed in to change notification settings - Fork 90
Raise minimal supported Python version to 3.10 #1560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I hate Python tooling man, why does the |
Yeah, it's fucked :( Maybe it has something to do with locale? |
Right now I suspect that the rules are still run with a different Python version than the declared 3.10. Since there's no concept of "target Python version" in the formatter, it just formats it for whatever version of Python is running it. But if that's the case then we need to disable it anyway, because e.g. your local Python would then format it differently than the CI |
Alright, turns out my pre-commit was bundling its own Python 3.13, so the behavior in the CI was the correct one. When I convinced pre-commit to use the provided 3.10, it behaved the same as the CI, so that's at least something. |
Until it's fixed upstream
Still supports Python 3.9
Still supports Python 3.9
Though it's deprecated now, and apparently there is no supporter way to run prettier from pre-commit. It also now considers some arrow characters double-width, since Unicode classifies them as emojis; though I don't think it's worth it to fight prettier on it
6655473
to
a3fb984
Compare
We used to support Python 3.8 because of Ubuntu 20.04, which doesn't have LTS anymore. The successor, Ubuntu 22.04, comes with Python 3.10.
By upgrading we get tooling improvements --- we can update
pre-commit-hooks
andautopep8
, the latter of which was disabled IIRC because the version we could use was buggy --- and we can also use new Python features, such as pattern matching and type aliases.There's no time pressure, so I'm keeping it as a draft for now, since one nested Python dependency has recently been broken for Python 3.10 in nixpkgs, but I submitted a PR (NixOS/nixpkgs#447787) to fix that, and temporarily replicated the fix here (with the disadvantage of it not being prebuilt, hence waiting for the PR to be merged).
Note that I updated pre-commit/prettier, but it's not maintained anymore, because pre-commit apparently broke something, and IIUC there's now no officially supported way of running prettier in pre-commit 🤷.
Fixes #939