Proposal: New arguments to control pre-releases #13221
Labels
state: needs discussion
This needs some more discussion
type: feature request
Request for a new feature
Summary
This proposal introduces two new flags to
pip
:--all-releases <format_control>
: Allows installing all versions of a package, including pre-releases.--only-final <format_control>
: Restricts installation to final and post-releases only.These flags provide fine-grained control over release selection, following similar syntax and semantics of
--no-binary
and--only-binary
.Motivation
Currently,
pip
's handling of pre-releases is controlled globally via--pre
, but there's no package-specific control and no way to specify disabling pre-releases.Further, pip has historically not selected prereleases in places where the spec says it should due to bugs in packaging (pypa/packaging#872 and pypa/packaging#794) so users haven't had as much need to "turn off" prereleases as they might in the future.
Specification
--all-releases <format_control>
Allows installation of all versions of a package, including pre-releases. Can be supplied multiple times, and each time adds to the existing value.
:all:
to allow pre-releases for all packagesExample Usage:
--only-final <format_control>
Restricts installation to final and post-releases only. Can be supplied multiple times, and each time adds to the existing value.
:all:
to enforce only final releases for all packagesExample Usage:
Design Notes
--pre
will be the equivalent of--all-releases :all:
, and could eventually be deprecated--no-binary
and--only-binary
more specific things override less specific things, e,g,--all-releases :all: --only-final foo
does not allow pre-releases for foo.:none:
syntax from--no-binary
and--only-binary
as I don't really understand the use case, but if there is a strong use case for it I can add itBackward Compatibility
This change is fully backward-compatible, as it introduces new optional flags without altering existing behavior.
Implementation
If there's no significant objection I'm volunteering to implement this.
However this is not being funded by anyone so work will go at the pace that I have free time, if someone else is willing to fund or work on this please let me know and we can organize something.
Bikeshedding
I'm not strongly attached to the names here, I'm happy to accept other names, I'm more interested if there are objections to the design.
The text was updated successfully, but these errors were encountered: