-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Declare support for Python 3.10 #2562
Conversation
@@ -104,6 +104,7 @@ def get_long_description() -> str: | |||
"Programming Language :: Python :: 3.7", | |||
"Programming Language :: Python :: 3.8", | |||
"Programming Language :: Python :: 3.9", | |||
"Programming Language :: Python :: 3.10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we wish to do this before we support all the syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, probably not!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already declare Python 3.9 support without formatting all such syntax (e.g. parenthesised context managers), so I'd support adding this classifier - black
does run on 3.10 after all!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it crashes if you have the new syntax elements. We don’t crash on context managers. Or has that been fixed? If so, sure. Let’s add away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ cat 1.py
def http_error(status):
match status:
case 400:
return "Bad request"
case 404:
return "Not found"
case 418:
return "I'm a teapot"
case _:
return "Something's wrong with the internet"
$ black 1.py
error: cannot format 1.py: Cannot parse: 2:10: match status:
Oh no! 💥 💔 💥
1 file failed to reformat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But parenthesized CMs are an undocumented feature in 3.9, not a flagship new feature like pattern matching in 3.10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP-614 "relaxed grammar restrictions on decorators" is documented in the what's new page, and also crashes.
I vote yes. I'm pretty sure we're all in favor to drop Python support when cpython EOL's the version. I think that's mentioned in the stable doc/policy, if not, we should add it. |
3.6 (or supporting upstream CPython generally) isn't mentioned in the stability policy: https://black.readthedocs.io/en/latest/the_black_code_style/index.html#stability-policy But the stability policy PR (#2529) added this to the Python 2 FAQ:
https://black.readthedocs.io/en/latest/faq.html#does-black-support-python-2 |
Hi folks, not quite sure this is the right place but shouldn't 3.10 be added to supported target versions as part of this PR, too? |
Classifier just means that Black can run on Python 3.10, not that it can parse Python 3.10 code (which it currently can't when it comes to new syntax like match statement and parenthesized with) which is what would constitute to adding 3.10 target version. |
Yep, I understand - just have no idea how are you handling 3.10 story so thought I'd mention it here in case you missed it. |
Just found a PR that has that covered. Thanks guys 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add this to the changelog
Added! |
Description
Python 3.10 final is already tested, just needs the Trove classifier.
Checklist - did you ...
Is a changelog entry needed?
By the way, Black was first released in March 2018 and took the forward-thinking view to only support Python 3.6, which was the newest release, and therefore Black hasn't needed to drop any EOL versions yet.
Python 3.6 is EOL on 2021-12-23; will Black be dropping 3.6 before the (potentially stable) 2022 Q1 release?