feat(rattler_lock): add prerelease-mode support for PyPI dependencies#1889
Merged
baszalmstra merged 1 commit intomainfrom Nov 26, 2025
Merged
feat(rattler_lock): add prerelease-mode support for PyPI dependencies#1889baszalmstra merged 1 commit intomainfrom
baszalmstra merged 1 commit intomainfrom
Conversation
Add support for storing PyPI prerelease mode per environment in lock files. This enables tools like pixi to persist their prerelease configuration. Changes: - Add PypiPrereleaseMode enum with 5 variants (Disallow, Allow, IfNecessary, Explicit, IfNecessaryOrExplicit) - Add optional pypi_prerelease_mode field to SolveOptions struct - Add builder methods: set_pypi_prerelease_mode() and with_pypi_prerelease_mode() - Add Environment::pypi_prerelease_mode() getter method - Add tests for serialization roundtrip of all prerelease modes The implementation is backwards compatible - the field is optional and skipped during serialization when None.
a67671d to
7e7324d
Compare
8 tasks
baszalmstra
approved these changes
Nov 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for storing PyPI prerelease mode per environment in lock files. This enables tools like pixi to persist their prerelease configuration.
Related to: prefix-dev/pixi#4984
Changes
PypiPrereleaseModeenum toSolveOptionswith 5 variants:Disallow- Disallow all pre-release versionsAllow- Allow all pre-release versionsIfNecessary- Allow pre-release versions if necessary to satisfy requirementsExplicit- Allow pre-release versions for packages explicitly requestedIfNecessaryOrExplicit- Default mode (allow if necessary or explicitly requested)pypi_prerelease_modefield toSolveOptionsstructset_pypi_prerelease_mode()andwith_pypi_prerelease_mode()Environment::pypi_prerelease_mode()getter methodLock File Format
The prerelease mode is stored at the environment level within the options section:
Backwards Compatibility
The implementation is fully backwards compatible:
pypi_prerelease_modefield is optional (Option<PypiPrereleaseMode>)skip_serializing_if = "Option::is_none"so old lock files without this field will parse correctlydefaultattribute so missing field deserializes toNone