-
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] UnexpandableImportStar
without expand-stars
or expand_stars=true
#182
Comments
UnexpandableImportStar
without expand-stars
or expand_stars=false
UnexpandableImportStar
without expand-stars
or expand_stars=true
Hi, This behavior is because without using Also, you can take that error as a warning; Pycln here is trying to give you a hint that it can't conclude anything regarding that star import (it would be skipped in anyway). Thanks. |
Makes sense, so even if it's not going to expand, it's still analysing to see if it can remove the import. Maybe the error could be improved ? Unfortunately nothing I can do about the use of modules star imports. (not my project + outside the scope of what I'm willing to refactor + some legit module re-exports). But I do take it as a warning. If side-effects cannot be analysed (or are analyzed as "maybe"), could pycln still remove unused explicit imports? from c_module import used, unused
# to
from c_module import used
from c_module import unused
# to
import c_module (I can turn this into a proper feature request if you tell me it's feasible) For now I'll |
Hi again @Avasam, Regarding improving the |
Describe the bug A clear and concise description of what the bug is.
There's star imports of C wrapped modules in the codebase. If I tell pycln to not expand stars, it'll still fail.
To Reproduce Steps to reproduce the behavior:
Take this code snippet:
Run this Pycln command:
Error traceback or unexpected output (if present):
Expected behavior:
pycln shouldn't error on unexpandable star imports if its not going to expand star imports.
Environment (please complete the following informations):
The text was updated successfully, but these errors were encountered: