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

Dependencies of packages flagged as unused #132

Closed
joszko opened this issue Mar 10, 2023 · 2 comments
Closed

Dependencies of packages flagged as unused #132

joszko opened this issue Mar 10, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@joszko
Copy link

joszko commented Mar 10, 2023

Hi,

My requirements.txt contains packages installed as dependencies of other modules (ex. Pandas requires pytz, pdfplumber requires Pillow and loguru requires colorama) that are not used as imports in code. They are flagged as unused.

Can this be changed? The requirements are often available in METADATA file in dist-info folders.

@fredrikaverpil
Copy link
Owner

fredrikaverpil commented Mar 10, 2023

Hi @joszko would you please try it again with the latest main branch. If you still experience issues, please provide the full log output when running creosote with the --verbose flag. This will help me be able to reproduce this.

$ pipx install --suffix=@main --force git+https://github.com/fredrikaverpil/creosote.git@main
$ creosote@main --venv .venv ...
$ pipx uninstall creosote@main

It kind of sounds like you are specifying sub-dependencies to your top-level dependencies. Like pip freeze > requirements.txt. What's the reason for doing this?
Have you considered not doing that and instead use pip-tools or Poetry/PDM/Pipenv to compile a lockfile for you, based only on your top-level dependencies?
Then you could point Creosote to the file holding only the top-level dependency definitions but keep on having a deterministic build (thanks to the lockfile).

@fredrikaverpil fredrikaverpil self-assigned this Mar 10, 2023
@fredrikaverpil fredrikaverpil added the bug Something isn't working label Mar 10, 2023
@fredrikaverpil
Copy link
Owner

@joszko I believe this will be fixed by #142 which is cooking.

Please reopen if you don't think this is correct.

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

No branches or pull requests

2 participants