-
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
Deprecate Python 2 formatting support #2523
Conversation
Just tagging this as a "do not merge" as all of this is very much up for debate. |
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 do it.
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.
You don’t own me. I can merge if I want to. 😂
In seriousness, I +1 … there is enough support with the current version for Python 2 syntax. It ain’t changing.
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.
Big +1 for this and the whole timeline 👍
src/black/__init__.py
Outdated
# TODO: fully drop support and this code by December 1st, 2021. | ||
if TargetVersion.PY27 in mode.target_versions or versions == {TargetVersion.PY27}: | ||
err( | ||
"DEPRECATION: Python 2 support will be removed after December 1st, 2021", |
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.
"DEPRECATION: Python 2 support will be removed after December 1st, 2021", | |
"DEPRECATION: Python 2 support will be removed by December 1st, 2021", |
The warning doesn't match the comment
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.
Perhaps something like" versions after black 22b0 will no longer support formatting python 2 code, pin to <21 for Python 2 support"
In #2529 I suggest dropping support together with the other process changes proposed there, in January of 2022. |
947142d
to
04b2b26
Compare
The current structure of the commits require that this is merged via a rebase so the split ends up being useful :)
|
*Gentle nudge* |
lgtm. |
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.
LGTM - Lets merge?
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.
The comments aren't consistent
01cbded
to
07ff8f9
Compare
One potential problem I do want to bring up is that right now each call to format_str with Python 2 warns ... that may be too noisy. |
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.
Noticed one typo.
I'm also still thinking about the feature detection stuff here and brought it up on Discord.
Printing for each file might be noisy, but properly doing it only once might require communication across asyncio workers, which I don't really want to have to deal with. |
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 merge it.
- Use BlackRunner and .stdout in command line test So the next commit won't break this test. This is in its own commit so we can just revert the depreciation commit when dropping Python 2 support completely.
a8e9370
to
979be64
Compare
* Prepare for Python 2 depreciation - Use BlackRunner and .stdout in command line test So the next commit won't break this test. This is in its own commit so we can just revert the depreciation commit when dropping Python 2 support completely. * Deprecate Python 2 formatting support
Description
It's 2021. See also #2251.
Checklist - did you ...