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

New resolver - duplicate requirement check #8036

Closed
pfmoore opened this issue Apr 13, 2020 · 2 comments
Closed

New resolver - duplicate requirement check #8036

pfmoore opened this issue Apr 13, 2020 · 2 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@pfmoore
Copy link
Member

pfmoore commented Apr 13, 2020

Pip currently checks for multiple requirements for the same project:

>pip install "django>2.0" "django<1.11"
ERROR: Double requirement given: django<1.11 (already in django>2.0, name='django')

That happens even with the new resolver.

Question - do we want to retain this check with the new resolver, or is it unnecessary? Certainly the new resolver will be capable of handling double requirements (in ghe above case, giving an error because they conflict, in other cases where they don't, finding a solution that satisfies both).

I haven't yet checked, but I assume this check is only done on "top level" requirements, and multiple dependencies on the same project are fine.

@pradyunsg @uranusjr @ei8fdb

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

To add some additional context (since the above example does fail, and might give an impression the check is a good thing). The problem is that the current implementation is extremely limiting. One common frustration is when you need different versions of a package in different environments:

# base.txt
Django>=3
# prod.txt
-r base.txt

# I want to try upgrading the code base to 3.1, but let’s be safe in production.
Django==3.0

And this would fail the check:

$ pip install -r prod.txt
ERROR: Double requirement given: Django==3.0 (already in Django>=3, name='Django')

So I would say this check should go eventually. The new resolver already eliminates most of the usages (it’s in RequirementSet.add_requirement()), but it is still called right now during the initial RequirementSet construction (before it reaches the resolver). See #7571.

@uranusjr
Copy link
Member

Tracking this in #7571 instead.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 20, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
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
Projects
None yet
Development

No branches or pull requests

2 participants