-
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
Perform Requires-Python check before downloading dependencies #9925
Comments
Are you using PyPI.org? This is already done for all packages from PyPI.org, but an alternative index implementation may not provide enough information to make this possible. |
Thanks @uranusjr for looking into this. Yes, this happens when using pypi.org. The undesired behaviour seems to have been introduced in pip 20.3.4. Examplesetup.py from setuptools import find_packages, setup
setup(
name="myapp",
version="0.0.0",
python_requires=">=3.7",
install_requires=["black==20.8b1"]
)
pip 20.3.3 (and earlier) will check the package's python requires before downloading dependencies (yay!):
pip 20.3.4 will download dependencies first and then check the package's python requires:
Same behavior in pip 21.1.1
|
Ah OK, you meant checking |
What's the problem this feature will solve?
When installing a package that requires a specific python version its dependencies are installed first, which
eg:
myapi has
python_requires=">=3.7"
and depends on mylib. mylib has only been built for python 3.6.pip install myapi
with the Python 3.6 interpreter will download all dependencies and error with:Describe the solution you'd like
pip install myapi
with the Python 3.6 interpreter won't download dependencies and will error with the more helpful:Alternative Solutions
Additional context
The text was updated successfully, but these errors were encountered: