pip-check-reqs
pip-check-reqs copied to clipboard
editable packages are not recognized
When a package is installed as editable, if the package name doesn't follow the import name the pip-extra-reqs
fails. An example:
-
requirements.txt
->-e git+ssh://[email protected]/some_org/some-package.git#egg=some-package
-
python
->import some_package
-
pip-extra-reqs my_project
->Extra requirements: some-package in requirements.txt
running pip-missing-reqs
doesn't show some-package
as missing tho, so I believe they check differently the match between requirements.txt
and the actual python imports.
Of course the project works normally and can use the package
For anyone having this issue, for now the error can be silenced using pip-extra-reqs --ignore-requirement=some-package my_project
Yup. Bug. Not to be confused with #81 - this should at least have its own separate testcase.
Reproducible with:
rm -rf test_45
mkdir test_45
cd test_45
echo "-e git+https://github.com/paramiko/paramiko#egg=paramiko" >> requirements.txt
echo "import paramiko" > test.py
pip install pip-check-reqs==2.3.2
rehash || hash -d
pip-extra-reqs test.py # ❌ reports "paramiko" as extra - this is actually issue #80
pip install -r requirements.txt
pip-extra-reqs test.py # ❌ reports "paramiko" as extra, even though it's actually installed
echo "paramiko" > requirements.txt
pip-extra-reqs test.py # ❌ changing requirement to a normal one doesn't help
pip install --force-reinstall paramiko
pip-missing-reqs test.py # Starts to work only after `paramiko` is reinstalled