pip only respects 1 version specifier for any particular name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PBR |
Invalid
|
Undecided
|
Unassigned |
Bug Description
... and a top-level name in requirements.txt will be preferred over one inside install_requires.
The practical implication of this is that if requirements.txt specifies "bar>=2.0" and "foo", and "foo" install_requires "bar>=2.1", "pip install -r requirements.txt" will not upgrade an already-installed "bar==2.0", while "pip install foo" will.
attachment repro.tar.gz has a small virtualenv skeleton that can be used to demonstrate this.
Create and activate a virtualenv, unpack repro.tar.gz inside; you should have a requirements.txt and directory called index/ containing two versions of bar and one version of foo.
First, install bar==2.0:
pip install -f index/ bar==2.0
Now install from requirements.txt:
pip install -f index/ -r requirements
You should see that foo is upgraded, but bar is not:
Successfully installed foo-0.3
Reset the environment: pip uninstall foo
Now install the package directly:
pip install -f index/ foo
You should see that foo is installed and bar upgraded:
Successfully installed bar-2.1 foo-0.3
Ok, so this is just pip issue 988 I believe.
First encountered requirement is honoured, rest error or are ignored.