pip-check-reqs icon indicating copy to clipboard operation
pip-check-reqs copied to clipboard

Reports package as an extra if it's not installed, even if it's imported

Open MrMino opened this issue 2 years ago • 0 comments

This is a problem converse to the one from #80.

If a package is not installed, pip-extra-reqs will report it as extra even if it's actually used.

Consider the following (with requests uninstalled):

# requirements.txt
requests
# module.py
from requests import get
> pip-extra-reqs module.py  # ❌ Requests is actually used
Extra requirements:
requests in requirements.txt

After pip install requests, the problem above vanishes. This is a false-positive result, i.e. bug.

MrMino avatar Mar 19 '22 09:03 MrMino