Environment
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.
Hey @polwel! Thanks for filing this issue.
Could you provide the output of pip install --verbose -e .
?
I am currently out of office, I will get back to you in the coming days.
Sure thing. No hurries. :)
Here you go: output.txt.
Does pip 9.0.3 also behave in the same way?
Yes, it also occurs with pip 9.0.3.
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
to setup.py egg_info
so we know for sure where the .egg-info
directory is being created?
@polwel This should be resolved in pip master following https://github.com/pypa/pip/pull/7978
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Also note that the feature should be available in pip 20.1b1, or 20.1 which is schedule to be released on 28th April.