-
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 does not support PEP 440-style prefix matches for pre-releases #12235
Comments
There do appear to be various edge cases in the way that this type of PEP 440 string is supported that make the current state difficult to use, however. Here's an example of one challenge that is probably only partly pip's responsibility, but I'm not quite sure that there is a single best place to report such an issue since it touches multiple parts of the toolchain typically used to build a package. If I have a pyproject.toml file like this:
If I run
|
See pypa/packaging#100. pip is unfortunately blocked by #11715 to merge the change. |
But even with the change, |
Hmm so then is there no way to specify a package's dependencies in pyproject.toml that allows for pre-release dependencies? I assumed it would be possible based on the following:
Does that only apply to command line specs for pip install commands and not specs inside a package's metadata? Would something like >=0.0.0a0 work? |
Yes. https://peps.python.org/pep-0440/#handling-of-pre-releases
|
What's the problem this feature will solve?
I would like to be able to specify alphas as dependencies in my package metadata where the alphas are constrained to a particular version. I would like to be able to use PEP 440-compliant versioning so that the behavior is predictable and consistent with the rest of the ecosystem's approach for specifying versions.
Describe the solution you'd like
The pip documentation on pre-releases indicates that there are two ways to install pre-releases: 1) with
--pre
, or 2) by specifying a constraint incorporating the pre-release like>=0.0.dev0
. It's not clear to me whether pip intends to support the entire PEP 440 syntax, but according to PEP 440 it should also be possible to specify a pre-release by using an exact version match with a suffixed.*
e.g.==0.0.*
would match0.0a1
(see the Version matching section). It would be nice if pip also exhibited this behavior, but it does not: as of the time of this writing,pip download "numpy==1.26.*" --no-deps
will not download the latest numpy 1.26.b1 beta.pip download "numpy>=1.26.*" --no-deps
will, but AFAICT this requirement spec isn't actually PEP 440-compliant.packaging
agrees:Alternative Solutions
I can work around the issue by using the
>=
syntax with the prefix, or by modifying the version specifier to explicitly include a pre-release segment. It's not difficult to do, so this issue is not blocking me.Additional context
N/A
Code of Conduct
The text was updated successfully, but these errors were encountered: