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 cannot prepare more than one requirement for the same project #7855

Open
pfmoore opened this issue Mar 13, 2020 · 2 comments
Open

pip cannot prepare more than one requirement for the same project #7855

pfmoore opened this issue Mar 13, 2020 · 2 comments
Labels
C: build logic Stuff related to metadata generation / wheel generation state: needs discussion This needs some more discussion type: maintenance Related to Development and Maintenance Processes

Comments

@pfmoore
Copy link
Member

pfmoore commented Mar 13, 2020

An InstallRequirement has a source_dir attribute, which is where the requirement will be built. The code here computes the name of that build directory, using the name of the requirement/project.

When preparing, the code confirms that the build directory isn't already in use here.

This causes a problem if pip ever needs to prepare more than one version of a particular project (foo-1.0 and foo-2.0, as both of these will use the same build directory). However, this is exactly what the new resolver needs to do in order to compute metadata for multiple candidates.

This is probably fixable by using randomised build directory names, or something similar. @pradyunsg @uranusjr - any thoughts on this?

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Mar 13, 2020
@pfmoore
Copy link
Member Author

pfmoore commented Mar 13, 2020

Update: Aggressive caching of Candidate objects in the new resolver avoids this issue. I'm not 100% clear why, but it looks like this isn't a blocker for the new resolver.

@uranusjr
Copy link
Member

I have a gut feeling this might come back and bit us somehow. But it’s not unfixable (e.g. maybe change the directory name to the link’s hash), and we’ll have a better idea how to deal with it when we have the models implemented. Let’s keep this in mind…

@pradyunsg pradyunsg changed the title Pip cannot prepare more than one requirement for the same project pip cannot prepare more than one requirement for the same project Mar 15, 2020
@pradyunsg pradyunsg added C: build logic Stuff related to metadata generation / wheel generation state: needs discussion This needs some more discussion type: maintenance Related to Development and Maintenance Processes labels Mar 15, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: build logic Stuff related to metadata generation / wheel generation state: needs discussion This needs some more discussion type: maintenance Related to Development and Maintenance Processes
Projects
None yet
Development

No branches or pull requests

3 participants