-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Handle multiple requirements for one package #1073
Conversation
It looks like your patch does not work on Python 3 (I noticed a use of dict.iteritems, which is no longer available in Python 3). |
Ok, let's use six |
It seems that the test job is broken by itself. |
Sometimes a developer needs to install dependencies for several packages, and each of them has its own requirements.txt file. Often, the same package is referenced in several files, possibly with different version requirements. pip should not print "Double requirement given". Instead, it should aggregate requirements (e.g., prettytable>=0.6 and prettytable<0.8 turns into prettytable>=0.6,<0.8).
@gd-imelnikov |
I'll take a look at this later this week. |
This is duplicate of issue #56 |
Didn't review the code in detail but the feature sounds useful. |
From I quickly glanced, this PR also needs extra work to deal with the new PEP440 specifiers. |
I don't like that this needs an option - pip should just adjust the proposed thing, probably needs a state saving backtracker to boot. |
Accidentally closed this, reopening. Sorry! |
Hello! As part of an effort to ease the contribution process and adopt a more standard workflow pip has switched to doing development on the If you do nothing, this Pull Request will be automatically closed by @BrownTruck since it cannot be merged. If this pull request is still valid, please rebase it against If you choose to rebase/merge and resubmit this Pull Request, here is an example message that you can copy and paste:
|
This Pull Request was closed because it cannot be automatically reparented to the Please feel free to re-open it or re-submit it if it is still valid and you have rebased it onto |
Sometimes a developer needs to install dependencies for several packages, and each of them has its own requirements.txt file. A good example can be OpenStack - a Python project that has the largest open source community.
Often, the same package is referenced in several files, possibly with different version requirements:
$ cat a/requirements.txt
prettytable>=0.6
$ cat b/requirements.txt
prettytable<0.8
pip should install prettytable>=0.6,<0.8, but it will just complain:
$ pip install -r a/requirements.txt -r b/requirements.txt
Double requirement given: prettytable<0.8 (from -r b/requirements.txt (line 1)) (already in prettytable>=0.6 (from -r a/requirements.txt (line 1)), name='prettytable')
My patch fixes the problem:
pip install -r a/requirements.txt -r b/requirements.txt
Downloading/unpacking prettytable>=0.6,<0.8 (from aggregated requirements)
Downloading prettytable-0.7.2.zip
...