Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip picks up .egg-info from sub-folders in -e mode #5466

Closed
polwel opened this issue May 31, 2018 · 10 comments
Closed

Pip picks up .egg-info from sub-folders in -e mode #5466

polwel opened this issue May 31, 2018 · 10 comments
Labels
C: editable Editable installations project: setuptools Related to setuptools state: needs discussion This needs some more discussion type: bug A confirmed bug or unintended behavior

Comments

@polwel
Copy link

polwel commented May 31, 2018

Environment

  • 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.

@pradyunsg
Copy link
Member

Hey @polwel! Thanks for filing this issue.

Could you provide the output of pip install --verbose -e .?

@pradyunsg pradyunsg added the S: awaiting response Waiting for a response/more information label Jun 6, 2018
@polwel
Copy link
Author

polwel commented Jun 6, 2018

I am currently out of office, I will get back to you in the coming days.

@pradyunsg
Copy link
Member

Sure thing. No hurries. :)

@polwel
Copy link
Author

polwel commented Jun 7, 2018

Here you go: output.txt.

@pradyunsg pradyunsg added S: needs triage Issues/PRs that need to be triaged and removed S: awaiting response Waiting for a response/more information labels Jun 7, 2018
@pradyunsg
Copy link
Member

Does pip 9.0.3 also behave in the same way?

@pradyunsg pradyunsg added project: setuptools Related to setuptools S: awaiting response Waiting for a response/more information and removed S: needs triage Issues/PRs that need to be triaged labels Jun 11, 2018
@polwel
Copy link
Author

polwel commented Jun 11, 2018

Yes, it also occurs with pip 9.0.3.

@pradyunsg pradyunsg added S: needs triage Issues/PRs that need to be triaged and removed S: awaiting response Waiting for a response/more information labels Jun 11, 2018
@cjerdonek cjerdonek added the C: editable Editable installations label Aug 18, 2018
@chrahunt
Copy link
Member

chrahunt commented Sep 3, 2019

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?

@chrahunt chrahunt added the type: bug A confirmed bug or unintended behavior label Sep 3, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Sep 3, 2019
@chrahunt chrahunt added the state: needs discussion This needs some more discussion label Sep 3, 2019
@sbidoul
Copy link
Member

sbidoul commented Apr 13, 2020

@polwel This should be resolved in pip master following #7978

@sbidoul sbidoul added the S: awaiting response Waiting for a response/more information label Apr 13, 2020
@no-response
Copy link

no-response bot commented Apr 28, 2020

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.

@no-response no-response bot closed this as completed Apr 28, 2020
@uranusjr
Copy link
Member

Also note that the feature should be available in pip 20.1b1, or 20.1 which is schedule to be released on 28th April.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2021
@pradyunsg pradyunsg removed the S: awaiting response Waiting for a response/more information label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: editable Editable installations project: setuptools Related to setuptools state: needs discussion This needs some more discussion type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

6 participants