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

Clarifying what this does, how do you deal with the import != package name problem? #8

Open
matthewdeanmartin opened this issue Dec 30, 2023 · 1 comment

Comments

@matthewdeanmartin
Copy link

matthewdeanmartin commented Dec 30, 2023

This examines a venv's source files for imports and then removes packages that are not imported.

Because some packages exist to provide a command line tool instead, those are skipped via the important packages list.

This appears to have over-lapping functionality with poetry --sync which removes no longer declared dependencies. This tool appears to even remove declared dependencies, that the original developer never bothered to import for some reason.

Anyhow, the main problem I see is when the package name doesn't match the import or the package has several top-level modules. (an example is beautifulsoup4/ bs4)

@matthewdeanmartin
Copy link
Author

Oh, this would be a useful tool if it just reported what appears to be unused. (So that unused code doesn't show up on security scanners)

https://github.com/fredrikaverpil/creosote is the prior art.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant