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 chooses different version for setup_requires than what was specified in requirements.txt #6717
Comments
If I'm understanding correctly, this is what is failing:
When the source distribution of Bottleneck is downloaded we attempt to build a wheel. This happens in an isolated environment independent of the other requested package installations ( Possible fixes:
I think pip is behaving as-expected here. |
I would argue that pip may be behaving as it always did, but as a user, when I specify that I want to install From my point of view the problem seems to be that the setup_requires are not actually part of the dependency graph that pip builds and resolves -> thus leading to this problem. Also Bottleneck cannot state a more specific version of numpy in its dependencies, as it is compatible with multiple versions of numpy just fine. The problem is that I need a specific version of numpy (which bottleneck is compatible with) but which therefore cannot be stated in it's dependencies. The more general problem is that there is no way to encode this information or the workaround you mentioned in a requirements.txt file (as far as I know) in a way that allows me to replicate a virtualenv by doing |
pip does not handle setup requires metadata directly -- it's handled by setuptools (hence easy_install). This information is already not available to pip (you need to execute setup.py to know what's needed to execute setup.py in this scheme) and PEP 518 was written to move away from the specification of build requirements in setup.py to a dedicated file for the job. |
@pradyunsg bottleneck does specify this at https://github.com/kwgoodman/bottleneck/blob/master/pyproject.toml so this information should be available to pip. I just realised, that this change is not released yet. :-/ |
Awesome! That'll mean the next release of bottleneck will fix this issue for users. :) I'll go ahead and close this since I don't think there's any actionable next steps here for pip's developers here. |
Environment
Description
I am trying to reproduce a package installation using a requirements.txt to get the same versions as before.
Doing this I noticed that the setup_requires of a project in my install switched to a newer version after the fact. This happened even though the correct version of the dependency was specified in the requirements.txt file.
To be more concrete, the requirements file contains both
However, when building bottleneck a newer numpy version was used as the setup_requires dependency for bottleneck (which is bad, as it definitely needs to be compiled against the same version as it is run against later).
Expected behavior
Those same versions of packages should be installed. To be more concrete: setup_requires should respect the package versions specified in the requirements.txt
How to Reproduce
1.1. I was also able to trigger this bug with this command line
pip install numpy==1.14.6 Bottleneck==1.2.1
2. In a virtualenv with python2
3. The installation fails because bottleneck has a
setup_requires
dependency on numpy and it seems that pip chooses to fetch the newest version of numpy (1.17rc1) as the build dependency. This is of course wrong, as I definitely want the version I specified to be used as the setup_requires dependency.Output
Workaround: I did workaround this by installing both packages individually after each other, thus seeding my caches with a built version of the wheel of bottleneck, after which the seems to have worked fine.
The text was updated successfully, but these errors were encountered: