Pip picks up .egg-info from sub-folders in -e mode
See original GitHub issueEnvironment
- pip version: 10.0.1
- Python version: 3.6 (running in a conda env)
- OS: Windows
Description
When I try to install my own package in -e
mode, pip instead tries to install the dependencies of another package in a sub-folder of the current directory.
Pip behaves fine in non-development mode.
Expected behavior Pip should resolve the correct package obviously.
How to Reproduce I have a minimal example to demonstrate the issue.
Run pip -e .
, and pip will install numpy
, instead of mypkg
and attrs
.
Additional info
It seems that pip picks up an *.egg-info
that happens to be located exactly one level below the current directory. It then tries to resolve the dependencies indicated there. In my case, I grabbed the egg-info
from pyqtgraph
.
My project does not use the usual directory layout (where setup.py
is located next to a folder named after the package, containing the source code). I don’t see how this would be an issue though.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
@polwel This should be resolved in pip master following https://github.com/pypa/pip/pull/7978
The problem is using the “src” directory layout. Currently we determine where the generated
*.egg-info
file is based on a traversal of the source tree. If more than one*.egg-info
found then we take the first ordered by number of leading directories. Since your .egg-info ends up in src, it doesn’t necessarily have precedence over the one in pyqtgraph.Does anyone know why we aren’t passing an explicit
--egg-base
tosetup.py egg_info
so we know for sure where the.egg-info
directory is being created?