-
Notifications
You must be signed in to change notification settings - Fork 3k
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 sometimes prohibits 2 .dist-info directories in wheels #7487
Comments
Does pip allow multiple dist-info dirs (in general) to handle installing from flat directory? (It’s the case IIRC.) I kind of feel the responsibility to produce a valid wheel should fall on to the wheel builder (so build backend). pip can be free to interpret and invalid wheel and do what’s most comfortable (e.g. choose one by whatever logic, as the current behaviour) since the input already breaks the contract. It is also a valid behaviour to error out as well, but I wouldn’t say it’s necessary. |
I think erroring out results in the best end-user experience here -- you gave pip something invalid, so it did the wrong thing vs you gave pip something invalid and it refused to use it. |
Good question. The current behavior is here - we essentially guess. I think this use case is different from installing a wheel because the wheel format has a spec and we control everything about the directory it is unpacked into.
Agreed.
I am trying to refactor some of our wheel installation logic. The purpose of calling out the expected behavior here is to make it easier to make things more comfortable. :) Our current validation approach has lead to situations like this one, but extracting it while preserving the exact same behavior would result in code that is harder to follow and doesn't really map to the spec. I expect taking the stricter approach will lead to fewer "print better errors" issues, since we can print a nice error upfront, at least in this case. |
I’m totally on board if the behaviour change would improve the code quality. |
I checked all wheels associated with the most recent release of all projects on PyPI and it looks like only intel-tensorflow would be affected by this change. I couldn't find any good contact information for that project after a few minutes of looking, since it just copies the existing tensorflow metadata. Maybe https://github.com/Intel-tensorflow/tensorflow is the repo? In any case a possible backwards-compatible workaround:
|
Environment
Description
Currently, pip rejects wheel files containing multiple
.dist-info
directories, but only if they start with the name of the package being installed.Expected behavior
pip should prohibit more than 1 top-level
.dist-info
directory, without regard to the name of the directories (besides ending with.dist-info
).From PEP 427:
And from PEP 376:
How to Reproduce
Save
t.sh
below, make it executable, and execute it.t.sh
Output
Output
The unexpected case is
(3) Install
- the installation should not go through since there are multiple.dist-info
directories.The text was updated successfully, but these errors were encountered: