-
Notifications
You must be signed in to change notification settings - Fork 18
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
[BUG] from foo import *
imports should be ignored in stub files
#152
Comments
Hi @AlexWaygood, this is a good catch.. actually, I planned to implement this within PR #150 but forgot to do so. |
@AlexWaygood after doing some investigation, your patch looks good to me, so please open a PR, and I'll help you finalize it even if you are unsure where/how to write the unit tests. |
+ @AlexWaygood I'm really happy to see you supporting the project. Thanks a lot bro! |
Thank you for the very cool tool! |
@AlexWaygood I've just published a new release including the fix for this bug: v2.0.2. |
Awesome, thanks so much for your help! |
Hi!
I see
pycln
recently added support for.pyi
files. That's awesome!I'm interested in possibly using
pycln
in typeshed's CI. However, it seems like there's one part of PEP 484 thatpycln
isn't quite compliant with when it comes to stub files, namely this:If I run
pycln
on typeshed at the moment, it erroneously deletes a large number of "unused"from foo import *
imports. These imports are all deliberate -- if a type checker sees afrom foo import *
import in a stub filebar.pyi
, it understands all symbols from modulefoo
to be re-exported in modulebar
.Playing around with
pycln
, it looks like this one-line patch solves the problem:I'd file a PR, but I'm struggling a little bit with the test suite 😅 (I'm not too familiar with the advanced features of pytest, I'm afraid.)
The text was updated successfully, but these errors were encountered: