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

Dealing with implicit imports from sub-packages #127

Closed
The-Compiler opened this issue Sep 29, 2020 · 0 comments · Fixed by #136
Closed

Dealing with implicit imports from sub-packages #127

The-Compiler opened this issue Sep 29, 2020 · 0 comments · Fixed by #136
Labels
bug Something isn't working changelog Changes should be written to the changelog file.

Comments

@The-Compiler
Copy link

With:

import os.path
print(os.getpid())

unimport will remove the import, thus breaking the code. Instead, it should probably recognize that the os package is still used and adjust the import accordingly.

It might be somewhat obvious in this case - in my case, I imported importlib.abc accidentally but used e.g. importlib.import_module. When reviewing the diff for issues, I confirmed that importlib.abc is indeed unused, but didn't recognize the implicit now missing import until it was too late and CI failed. 😅

@hakancelikdev hakancelikdev added bug Something isn't working changelog Changes should be written to the changelog file. needs test labels Sep 29, 2020
hakancelikdev added a commit that referenced this issue Oct 7, 2020
@hakancelikdev hakancelikdev linked a pull request Oct 7, 2020 that will close this issue
hakancelikdev added a commit that referenced this issue Oct 7, 2020
hakancelikdev added a commit that referenced this issue Oct 7, 2020
hakancelikdev added a commit that referenced this issue Jan 1, 2021
hakancelikdev added a commit that referenced this issue Jan 1, 2021
hakancelikdev added a commit that referenced this issue Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog Changes should be written to the changelog file.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants