You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the description pip check is intended to check for unsatisfied dependencies in installed packages. However, this does not seem to catch dependency issues related to extras.
Reproducing the issue:
Create packages a, b, c, and d.
.
├── a
│ ├── a
│ └── __init__.py
│ └── setup.py
├── b
│ ├── b
│ │ └── __init__.py
│ └── setup.py
├── c
│ ├── c
│ │ └── __init__.py
│ └── setup.py
└── d
├── d
│ └── __init__.py
└── setup.py
from setuptools import setup, find_packages
setup(
name="a",
version="1.0",
packages=find_packages(),
)
Create dists for all four packages and install to a local pypi. Then (assuming the local pypi is running on localhost port 8080):
$ pip install -i http://localhost:8080 c d
$ pip uninstall a
Now we have an issue, since c --> b[a] --> a, but a is not installed. However, pip check does not catch this issue.
$ pip check
No broken requirements found.
The following script detects the problem:
import pip
import pkg_resources
pkg_resources.require(str(dep.as_requirement())
for dep in pip.get_installed_distributions())
$ python check_dependencies.py
Traceback (most recent call last):
File "check_dependencies.py", line 5, in <module>
for dep in pip.get_installed_distributions())
File ".../venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 963, in require
needed = self.resolve(parse_requirements(requirements))
File ".../venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 849, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'a; extra == "a"' distribution was not found and is required by b
The text was updated successfully, but these errors were encountered:
augurar
changed the title
pip check does not check extra requirements
pip check does not check extra requirements
Dec 24, 2016
Description:
Based on the description
pip check
is intended to check for unsatisfied dependencies in installed packages. However, this does not seem to catch dependency issues related to extras.Reproducing the issue:
Create packages
a
,b
,c
, andd
.Create dists for all four packages and install to a local pypi. Then (assuming the local pypi is running on localhost port 8080):
Now we have an issue, since
c --> b[a] --> a
, buta
is not installed. However,pip check
does not catch this issue.The following script detects the problem:
The text was updated successfully, but these errors were encountered: