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

UP035 (deprecated-import) for backports.strenum #8102

Closed
amartani opened this issue Oct 21, 2023 · 1 comment · Fixed by #8113
Closed

UP035 (deprecated-import) for backports.strenum #8102

amartani opened this issue Oct 21, 2023 · 1 comment · Fixed by #8113
Assignees
Labels
wish Not on the current roadmap; maybe in the future

Comments

@amartani
Copy link

https://pypi.org/project/backports.strenum/ implements a backport of Python 3.11's enum.StrEnum as backports.strenum.StrEnum. It would be nice if UP035 (deprecated-import) added support for replacing it with the original version when targeting 3.11+.

Note that the package instructions already suggests using:

if sys.version_info >= (3, 11):
    from enum import StrEnum
else:
    from backports.strenum import StrEnum

But if someone is not using the conditional import, it would be good for UP035 to clean it up.

Tested on ruff v0.1.1 - https://play.ruff.rs/c973b82b-0107-469b-9b10-9196353b8901

@charliermarsh charliermarsh added the wish Not on the current roadmap; maybe in the future label Oct 21, 2023
@charliermarsh
Copy link
Member

Seems reasonable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wish Not on the current roadmap; maybe in the future
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants