-
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
pip verifies package dependency requirements before verifying package python requirements #13146
Comments
I could be wrong, but I don't think pip would download any versions of tensorflow, but I agree it's a confusing error message and pip should error out earlier and be clear it's because of the requires-python. As a side note, for various reasons a lot of tools ignore declared upper bound in the requires-python, e.g. |
@notatallshaw If I have other dependencies not raising issue, they will be downloaded before-hand. I modified my dummy package to have an additional requirements: dependencies = [
"numpy",
"tensorflow>=2.14.0"
] Now, pip install --no-cache-dir 'git+https://github.com/gdurif/dummy_pypkg@nok'
EDIT: my bad, only the metadata are downloaded and not the full package.... |
@ichard26 you are absolutely right, I checked before opening this issue, but I missed it. All my apologies. |
Description
When installing a package with a specific Python version requirements (specified by the
requires-python
field in thepyproject.toml
file),pip
checks other requirements (from dependencies) before checking the package specific Python requirement, ending up in useless package downloading and checking if this Python requirement is not met.In addition, if another issue is met during the checking of dependency requirements, the user is not advertised that the current Python version is not supported by the package (c.f. MWE below).
Expected behavior
pip
should check the package Python requirements before checking other dependency requirements to avoid useless actions if this requirements is not met.pip version
24.3.1
Python version
3.13.1
OS
Linux
How to Reproduce
I have set up a dummy package (https://github.com/gdurif/dummy_pypkg) for testing purpose, with a Python requirement
requires-python = ">=3.11,<3.13"
.I am trying to install it with Python 3.13+.
ok
where the package has no dependency. In that case,pip
tells me that the Python version is not supported.nok
where the package has one dependency"tensorflow>=2.14.0"
. In that case,pip
downloads the dependency (if not cached) and checks its requirements before checking my package Python requirement, ending up here in an error regarding this dependency requirement (and not telling me that my package does not support my version of Python).Output
Case 1 (works as expected):
pip install 'git+https://github.com/gdurif/dummy_pypkg@ok'
Case 2 (
pip
does not tell me that my Python version is not supported):pip install 'git+https://github.com/gdurif/dummy_pypkg@nok'
Code of Conduct
The text was updated successfully, but these errors were encountered: