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

Doesn't show missing requirement if missing package is not installed #80

Open
MrMino opened this issue Mar 19, 2022 · 0 comments
Open
Labels

Comments

@MrMino
Copy link
Collaborator

MrMino commented Mar 19, 2022

Since pip-missing-reqs does not try to actually execute the import statements, but rather parses the AST (see ImportVisitor in common.py), it doesn't really know when an import is bound to fail with an ImportError. And it doesn't seem to check it.

Consider the following (with paramiko uninstalled):

# requirements.txt
something-totally-unrelated
# module.py
import paramiko
> pip-extra-reqs module.py  # ✅ Works as expected
Extra requirements:
something-totally-unrelated in requirements.txt
> pip-missing-reqs
pip-missing-reqs module.py  # ❌ Shows no output

A typo in an import statement or a package uninstalled by mistake will not trigger any errors.
On the other hand, it seems that adding a check for this might lead to lots of false-positives.

Add an option to report missing imports as errors or warnings to pip-missing-reqs. Consider changing the default ("no action") to "report as errors".

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

No branches or pull requests

1 participant