-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Installation not aborted when Requires-Python does not match the running version #5967
Comments
Note that pip needs to "prepare" a source distribution to read its metadata (e.g. run |
To elaborate: PKG-INFO and/or existing egg-info metadata is not used, because it might not be present (pip support installing from VCS snapshots, not just proper source distributions). |
main question is should pip consider it if available (as pretty much all setuptools based sdists supply it in a reasonable fashion) |
This isn't installing from a PEP 503 repository -- this is an install from a source tarball URL. As noted above, pip has no way to know the metadata of that distribution, without running Attempting
|
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Is it the intention to close this? I do feel pip should abort the installation by default instead of breaking the environment silently. |
@uranusjr it does abort the installation. In fact, it explodes during the build from sdists. The problem is that it needs to build sdist in order to figure out python-requires if there's no wheel. |
Got it, thanks for the clarification. |
So there are a number of points here:
Keeping this issue open (particularly as the OP hasn't responded) doesn't seem to add much value here. |
Environment
Description
After merging #3846, package installation should be aborted if Requires-Python do not match the running Python version. But this feature is not working.
Expected behavior
Package installation should stop before
setup.py
is run.How to Reproduce
On a fresh installed ubuntu 18.04 (Here I use
docker run -it ubuntu:18.04 bash
)Run the following commands
Why do this?
Yes,
python -m pip install angr
works without any error. This is becausedata-requires-python
attribute is provided on the official PyPI website according to PEP503. Python 2.7 will ignore the versions that doesn't satisfy the requirement and finally install angr-7.8.9.26 (the correct version for Python 2.7).Unfortunately, according to PEP503,
There are many mirrors of PyPI which do not support
data-requires-python
attribute, such as https://mirrors.ustc.edu.cn/pypi/web/. When you install PyPI packages from these mirrors, you will download package versions which are in conflict with the running Python version (eg. the URL I provided above). Some packages will detect it when installing and stop immediately, but others will succeed in installing and just throw something likeSyntaxError: invalid syntax
only when you import it. pip should ensure that a package should not start installing if Requires-Python do not match the running Python version.Output
The text was updated successfully, but these errors were encountered: