Skip to content

PYTHON-2504 Apply pyupgrade --py36-plus v2.31.0 #882

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

Closed
wants to merge 2 commits into from

Conversation

ShaneHarvey
Copy link
Member

Applied pyupgrade --py36-plus to all files except setup.py with v2.31.0. I omitted setup.py so that the file can still produce a good error message on python2, otherwise the user gets this error due to format strings:

$ python2 setup.py                                                      
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    raise RuntimeError("Python version >= 3.6 required.")
RuntimeError: Python version >= 3.6 required.
$ pyupgrade --py36-plus setup.py                                        
Rewriting setup.py
$ python2 setup.py              
  File "setup.py", line 168
    raise RuntimeError(f"documentation step '{mode}' failed")
                                                           ^
SyntaxError: invalid syntax

I tested out adding this to pre-commit but pyupgrade's formatting conflicts with black so it's more of a nuisance.

@behackett
Copy link
Member

I don't have a strong opinion on this being a blocker, but won't this make backports to 3.x more difficult?

@ShaneHarvey
Copy link
Member Author

Great point. This will definitely make backports more tedious. Let's hold off until pymongo 3 is EOL.

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