-
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
Pip always upgrades VCS packages #10829
Comments
I don't think putting URLs in Python package distribution metadata is considered a good practice. These things should go to requirements files while the metadata should have just package names (and version boundaries). I suppose that the behavior is like this because you are not pointing at a specific software version but rather at an unspecified "default" branch of a remote repository which will point at different versions (commits) over time. Also, even the branch name that is considered default for a given Git remote may change over time too ( There is no way for pip to know if the version is the same or not because the way it's requested points at different versions of the codebase at the same time. I guess it could be optimized a bit by caching the commit hash and checking if the branch pointer changed via I would recommend trying to specify a full commit SHA to pin it for reproducibility. |
Thinking about it more, since VCS packages get built from the source, this means that you may get a different result depending on your environment even if the commit hash does not change. Maybe pip could add an explanatory note to the output mentioning why the rebuild is required. |
I think we are not on the same page. I'll write an example to make sure that we are aligned: Lets say I have package requests in some version, not the latest one. If i will execute
please notice that there is a newer requests version exists(requests-2.27.1). |
How would pip know/verify that the thing that a remote Git repository has contains a distribution called |
As far as i understand, the egg name should indicate what's the package name(and i think the prefix before the @ in the dependency list is the egg name. not 100% sure of it though).
Reference can be found here: For example, in the following setup.py the name before the @ is requests, then pip should know he is installing the requests package. from setuptools import setup
setup(
name="testing-git",
install_requires=[
"requests @ git+ssh://git@github.com/psf/requests.git"
]
) |
Duplicate of #5780, in the sense that the discussion there covers this topic. Please search the issue tracker for duplicates before filing issues. |
Description
If we'll use pip to install a package which resides in VCS, it will try to upgrade the dependency every time we perform pip install (even if we'll not use the -U flag). Note that it includes cloning the repository every time.
Important note: While using the deprecated resolver this bug doesn't reproduce(I am currently using the deprecated legacy resolver in order to avoid re-cloning every time).
Expected behavior
The expected behavior is that when using pip install without the -U flag i want to avoid upgrading already-existing packages. In addition I wouldn't like to clone them all over again to save time.
pip version
21.3.1
Python version
3.8.10
OS
Ubuntu 20.04
How to Reproduce
Output
Output for 3:
Output for 4:
Code of Conduct
The text was updated successfully, but these errors were encountered: