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

extras not handled correctly when a distribution occurs twice in the dependency graph #3189

Closed
rbtcollins opened this issue Oct 16, 2015 · 3 comments
Labels
auto-locked Outdated issues that have been locked by automation C: dependency resolution About choosing which dependencies to install type: bug A confirmed bug or unintended behavior

Comments

@rbtcollins
Copy link

For both the special case of on-the-command-line:

pip install foo foo[bar]

which will error with 'duplicate requirement'

and the general case of two references in the dependency graph:

pip install foo

where foo depends on bar and quux, and quux depends on bar[extra]

which will fail to install whatever is listed in bar[extra].

For all these cases we should:

  • union the extras in the install requirement object
  • recurse into the dependencies specified by the extra (which probably means recursing into everything due to pkg_resources api, but thats an implementation detail).
@dims
Copy link

dims commented Oct 16, 2015

Specific scenario in openstack, we have oslo.db has an extras named 'fixture' which has a couple of libraries used only in tests. we'd like to add oslo.db[fixtures] to either test-requirements or tox.ini when oslo.db is already present in requirements.txt .

Currently pip fails with:
Double requirement given: oslo.db[fixtures]>=2.4.1 (from -r /Users/dims/openstack/openstack/nova/test-requirements.txt (line 17)) (already in oslo.db>=2.4.1 (from -r /Users/dims/openstack/openstack/nova/requirements.txt (line 40)), name='oslo.db')

http://paste.openstack.org/show/476434/

@piotr-dobrogost
Copy link

What is called general case here matches what I rised in issue #3147 and according to @xavfernandez pull #2716 by @rbtcollins :) is supposed to fix this.

@rbtcollins
Copy link
Author

#3105 is at least partially fixing this.

My resolver branch can fix 'correctly' this, but we don't need to wait for it to address the basic defect (since we can union all extras together easily enough).

s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/pip that referenced this issue Oct 21, 2015
Any duplicate distributions will currently raise an error, even if
their extras are different: for example, 'pip install bar bar[foo]'.
Detect this situation, and union the extras together.

Closes pypa#3189
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/pip that referenced this issue Nov 10, 2015
If a dependency is mentioned in constraints we just take that version,
meaning we will completely ignore any extras requested on the command
line or in a requirments file.  This takes a union of the two before
installing.

Co-Authored-By: Sachi King <[email protected]>
Closes pypa#3046, pypa#3189
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/pip that referenced this issue Nov 20, 2015
Compare extras when checking if a requirement has already been
specified, and take a union of the extras before installation.

Co-Authored-By: Sachi King <[email protected]>
Closes pypa#3046, pypa#3189
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/pip that referenced this issue Nov 20, 2015
Compare extras when checking if a requirement has already been
specified, and take a union of the extras before installation.

Co-Authored-By: Sachi King <[email protected]>
Closes pypa#3046, pypa#3189
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: dependency resolution About choosing which dependencies to install type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants