VSC dependencies wont upgrade when version is changed in dependent repo
See original GitHub issueEnvironment
- pip version: 20.1.1
- Python version: 2.7.12
- OS: Ubuntu 16.04.6 LTS (xenial) 4.4.0-1060-aws
Description Installing a package from VSC doesn’t work when you bump up the package version in the VSC repo
Expected behavior
I expect pip to redownload my-pkg
since the version was bumped but instead it claims Requirement already satisfied
How to Reproduce
Assuming this is my setup.py in my root project which declares a dependency on my-pkg
# setup.py
from setuptools import setup
setup(
name='root_pkg'
...
install_requires=[
'beautifulsoup4 == 4.9.1',
'my-pkg @ git+git://github.com/somewhere/my-pkg'
]
)
- Running
pip install .
installsmy-pkg
correctly - Then make some changes in my-pkg and bump up the version
- Run
pip install .
again - It will claim ‘Requirement already satisfied’
Possible bug location
This is the gating function which decides if a package is to be skipped or installed
pip._internal.resolution.legacy.resolver.Resolver. _check_skip_installed
https://github.com/pypa/pip/blob/20.1.1/src/pip/_internal/resolution/legacy/resolver.py#L210
It clearly states in the doc string
Note that for vcs urls and the like we can’t assess skipping in this routine - we simply identify that we need to pull the thing down, then later on it is pulled down and introspected to assess upgrade/ reinstalls etc
It short circuits at line 240 when deciding to skip or not for my-pkg
if not self._is_upgrade_allowed(req_to_install):
if self.upgrade_strategy == "only-if-needed":
return 'already satisfied, skipping upgrade'
return 'already satisfied'
Theres nowhere in that function, between line 210-240, which checks to see if the requirement is a link so return None
Perhaps there should be a check something along the lines of
if req_to_install.link:
# This is a url so we need to pull down the repo first to introspect it
return None
I could be grossly mistaken about this behaviour so feel free to correct me
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
hello, we bumped into the same problem. Passing
--upgrade
is not enough. What @vidhu is describing is correct. I tried this usingpip 20.2.3
andpip 20.2.4
.I did resolve this, however, by using the new resolver. The following works as expected:
I can not reproduce this anymore with pip 22.2.2.
I created a repo on Github with the following setup.py
I then created a local project with the following setup.py
Running
pip install .
installstest_package
from Github:Adding
click
as a dependency to the setup.py of the Github repo, bumping the version, and runningpip install .
again updatestest_package
and installsclick
:Passing
--upgrade
is not required.