-
Notifications
You must be signed in to change notification settings - Fork 3.1k
pip install --find-links dist
no longer prefers local over PyPI (fails maturin CI)
#12110
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
Comments
Pp never preferred local over PyPI. It has always considered two copies of a package with the same name and version as being interchangeable. So unfortunately, without realising it, you have been relying on an accident of the current implementation (which appears to have changed). If you want pip to prefer the local copy, you need to give it a higher version than the one on PyPI. |
Hi, could we have a flag in pip that prefers local package instead of remote? It's very test a pre release package in the CI/CD without this behavior of pip. Thanks a bunch. |
See #8224 In the meantime, |
…turin CI template See: PyO3/maturin#1680 See: pypa/pip#12110
NOTE: using --no-index to workaround the fact that older versions of pip used to prefer these local packages rather than downloading them from the Internet. See pypa/pip#12110 In previous builds pip may have actually downloaded wheels from PyPI (when they were available) instead of installing the locally built ones without us even knowing about it! The fact that the latest xmlsec v1.3.15 is missing it's wheels for Python 3.11 Linux (as they claim having issues with their build infra ATM) is just exposing the issue.
NOTE: using --no-index to workaround the fact that older versions of pip used to prefer these local packages rather than downloading them from the Internet. See pypa/pip#12110 In previous builds pip may have actually downloaded wheels from PyPI (when they were available) instead of installing the locally built ones without us even knowing about it! The fact that the latest xmlsec v1.3.15 is missing it's wheels for Python 3.11 Linux (as they claim having issues with their build infra ATM) is just exposing the issue.
Description
Since pip v20, if you have a package built locally and on PyPI at the same version,
the following command will prefer installing the PyPI package than the local build:
If the local package has a newer version then that will be installed
This is a problem for e.g.
maturin generate-ci github --pytest
(PyO3/maturin#1680),which builds the wheel (per OS), then installs and runs pytest.
It means that, for every PR, you have to ensure that you have bumped the version.
Expected behavior
Either the behaviour is reverted, or there is a separate flag to enforce the behaviour, e.g.
--prefer-local
pip version
23.1.2
Python version
3.10
OS
Linux
How to Reproduce
dist
folderpip install mypkg --find-links dist --force-reinstall
Output
With
pip-23.0.1
with
pip-19.3.1
Code of Conduct
The text was updated successfully, but these errors were encountered: