Skip to content
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

Get pyupgrade to update the typing #6244

Closed
Illviljan opened this issue Feb 5, 2022 · 2 comments
Closed

Get pyupgrade to update the typing #6244

Illviljan opened this issue Feb 5, 2022 · 2 comments

Comments

@Illviljan
Copy link
Contributor

Illviljan commented Feb 5, 2022

Is your feature request related to a problem?

Use more up-to-date typing styles on all files. Will reduce number of imports and avoids big diffs when doing relatively minor changes because pre-commit/pyupgrade has been triggered somehow.

Related to #6240

Describe the solution you'd like

Add from __future__ import annotations on files with a lot of typing.
Let pyupgrade do the rest.

Describe alternatives you've considered

No response

Additional context

No response

@mathause
Copy link
Collaborator

mathause commented Feb 7, 2022

You could go the other way round and run

find . -name "*.py" -exec pyupgrade --py39-plus {} \;

(or even --py310-plus ) and then manually add from __future__ import annotations to files that were updated. Should also update

- "--py37-plus"

to --py38-plus.

@headtr1ck
Copy link
Collaborator

Almost all files have from __future__ import annotations now and pyupgrade is doing its thing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants