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

PYI026 autofixes ignoring target_version, not importing from typing_extensions #6695

Closed
Skylion007 opened this issue Aug 19, 2023 · 2 comments · Fixed by #6696
Closed

PYI026 autofixes ignoring target_version, not importing from typing_extensions #6695

Skylion007 opened this issue Aug 19, 2023 · 2 comments · Fixed by #6696
Assignees
Labels
bug Something isn't working

Comments

@Skylion007
Copy link

Skylion007 commented Aug 19, 2023

PYI026s autofix is broken. It addes TypeAlias annotations everywhere, but unconditionally imports from typing when it should import from typing_extensions if the target_version is less than py310. The bug appears to present when the PR was initially introduced in #5844

https://beta.ruff.rs/docs/rules/type-alias-without-annotation/

@Skylion007 Skylion007 changed the title PYI autofixes ignoring target_version, not importing from typing_extensions PYI026 autofixes ignoring target_version, not importing from typing_extensions Aug 19, 2023
@charliermarsh
Copy link
Member

Will take a look now.

@charliermarsh charliermarsh self-assigned this Aug 19, 2023
@charliermarsh
Copy link
Member

Thanks, will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants