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

Drop Python 3.7 compatibility #399

Merged
merged 4 commits into from
May 4, 2023
Merged

Conversation

intgr
Copy link
Contributor

@intgr intgr commented Apr 27, 2023

Related issues

* Latest Django 4.2 no longer supports Python 3.7
* Our CI dependency `pre-commit` no longer supports Python 3.7
* Python 3.7 support ends in 2 months (https://endoflife.date/python)
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@intgr
Copy link
Contributor Author

intgr commented Apr 29, 2023

For some reason pyupgrade isn't running correctly on this repo (DRF).

When I run pyupgrade --py38-plus rest_framework-stubs/*.pyi manually on my computer, I get some import changes. But pre-commit doesn't push fixes to this branch, nor does it report checks failure.

@intgr
Copy link
Contributor Author

intgr commented Apr 29, 2023

For some reason pyupgrade isn't running correctly on this repo (DRF).

It's probably something really dumb, but I couldn't figure it out. Submitted an issue to pre-commit: pre-commit/pre-commit#2862

This reverts commit d7ef35f.
@intgr
Copy link
Contributor Author

intgr commented May 2, 2023

It's probably something really dumb, but I couldn't figure it out.

Yep, pre-commit does not run pyupgrade on .pyi files, so this is by design. Perhaps it should, but off topic for this PR.

@sobolevn
Copy link
Member

sobolevn commented May 2, 2023

anyway I'm done replying to this

Feels a bit harsh, to be honest.

But, looks like we don't run pyupgrade in typeshed: https://github.com/python/typeshed/blob/main/.pre-commit-config.yaml

🤔

Relevant discussions (nothing quite interesting): https://github.com/python/typeshed/search?q=pyupgrade&type=issues

So, we can just run this manually for now. Until some better solution comes up.

@orsinium
Copy link

orsinium commented May 2, 2023

Pyupgrade checks are implemented in ruff, you can try using it instead.

@intgr
Copy link
Contributor Author

intgr commented May 4, 2023

OK this should be mergeable now.

@intgr intgr requested a review from sobolevn May 4, 2023 09:49
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

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

Successfully merging this pull request may close these issues.

3 participants