-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Pre-release versions not included when specifying version interval #8425
Comments
Without looking into the actual implementation, this should likely be reported to pypa/packaging, which implements the actual version comparison logic. |
I have opened pypa/packaging#315, pointing back to here for details. |
As noted in the packaging issue, this is expected behavior. Thanks for filing this @andy-maier, I'm going to go ahead and eagerly close this. If we decide over on packaging that this behavior should be changed, we can reopen/revisit this issue. :) |
Environment
Description
Since we are about to release our first pre-release version of a package, I did some experiments using pip in that area, and I found that pip does not properly consider the versioning order for pre-releases in some cases. I did read some of the issues in that area (specifically #4969, #7579, https://discuss.python.org/t/version-specifier-sets-and-prereleases/3000) but I think this issue reported here is not covered in those).
I used the "apispec" package for these experiments, which has some pre-release versions before its 1.0.0 version:
..., 0.39.0, 1.0.0b1, 1.0.0b2, 1.0.0b3, 1.0.0b4, 1.0.0b5, 1.0.0b6, 1.0.0rc1, 1.0.0, 1.1.0, ...
Here are the experiments, and my judgement of the result (I uninstalled the package in between the experiments)::
pip install 'apispec>0.39.0,<1.0.0'
- does not find a version - OKpip install 'apispec>0.39.0,<1.0.0' --pre
- does not find a version - STRANGEpip install 'apispec>0.39.0,<1.0.0rc1'
- does not find a version - STRANGEpip install 'apispec>0.39.0,<=1.0.0rc1'
- installsapispec-1.0.0rc1
- OKpip install 'apispec>=1.0.0b1,<1.0.0'
- does not find a version - STRANGEpip install 'apispec>=1.0.0b1,<1.0.0' --pre
- does not find a version - STRANGEpip install 'apispec==1.0.0b1'
- installsapispec-1.0.0b1
- OKIn all cases marked as STRANGE, there is a trigger to include pre-release versions, either by means of specifying a pre-release version in the version specification, or by means of specifying the
--pre
option, or both, and there are one or more pre-release versions that match the version specification. Nevertheless, no pre-release version is found to be installed. According to the version sequence shown further up, each of these cases should have found one or more pre-release versions that satisfy the version specification.Expected behavior
If the inclusion of pre-releases is enabled by any trigger, the order of versions according to PEP 440 including any pre-release versions should be used to evaluate the version constraints.
I wish there would be a more detailed description of the behavior for pre-releases in the pip documentation.
How to Reproduce
See the experiments listed above. Make sure that the package gets uninstalled before each experiment.
The text was updated successfully, but these errors were encountered: