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

Installing dependent wheels in a single command with specified extras is order dependent #11912

Open
1 task done
mattnotmitt opened this issue Mar 30, 2023 · 2 comments
Open
1 task done
Labels
C: dependency resolution About choosing which dependencies to install type: enhancement Improvements to functionality

Comments

@mattnotmitt
Copy link

Description

  • Given two wheel files for a package called, child and another, parent, which depends on child and with both having a [test] extra (ie {"test": ["pytest"]},
  • when pip install child.whl[test] parent.whl[test] is run the install will succeed.
  • when pip install parent.whl child.whl is run the install will succeed.
  • If the command is instead pip install parent.whl[test] child.whl[test] the install will fail.

Expected behavior

I expect this to work in both orders. I understand it's a bit of an edge case, but would potentially be useful to note in the docs if not fixed as the error message isn't particularly helpful.

pip version

23.0.1

Python version

3.11

OS

Linux

How to Reproduce

I've written a test which reproduces the issue.

Output

ERROR: Could not find a version that satisfies the requirement childpkg (from parent[test]) (from versions: none)
ERROR: No matching distribution found for childpkg

Code of Conduct

@mattnotmitt mattnotmitt added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Mar 30, 2023
@pradyunsg pradyunsg added C: dependency resolution About choosing which dependencies to install and removed S: needs triage Issues/PRs that need to be triaged labels Mar 31, 2023
@uranusjr
Copy link
Member

IMO the current behaviour makes sense; child is not a thing until pip “sees” it, so it needs to be specified first. It’s not impossible (probably not too complicated either) to implement the behaviour this is looking for—essentially pip needs to perform an additional pass through the usersupplied requirements and register everything in it before handing things off to resolvelib—but personally I’m not going to bother since this additional pass is not beneficial in general.

@uranusjr uranusjr added type: enhancement Improvements to functionality and removed type: bug A confirmed bug or unintended behavior labels Apr 17, 2023
@mattnotmitt
Copy link
Author

Yeah it's definitely some niche behaviour so it's not too much of an issue for me, however:

IMO the current behaviour makes sense; child is not a thing until pip “sees” it, so it needs to be specified first.

If this is true, why is this only an issue when the extras are set, and works fine without them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: dependency resolution About choosing which dependencies to install type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

3 participants