feat: add variants to the lock-file (v6)#1854
Merged
baszalmstra merged 5 commits intoconda:mainfrom Nov 27, 2025
Merged
Conversation
This commit adds support for optional `variants` field in lock-file format v6 for source packages, avoiding breaking changes while enabling disambiguation of multiple source packages at the same location. Changes: - Added `VariantValue` enum to represent variant values (String, Int, Bool) - Added optional `variants` field to `CondaSourceData` structure - Updated v6 serialization to include variants when present - Updated v6 deserialization to parse and match variants - Updated package selectors to include optional variants field - Added test cases for v6 lock files with variants The variants feature was originally added in lock-file v7 as a required field, but this implementation makes it optional in v6 to maintain backward compatibility while still allowing users to disambiguate between source packages.
Variants should only appear in package definitions, not in package selectors within environments. Including them in selectors would be a breaking change for older versions that don't understand the variants field. Changes: - Removed variants field from SerializablePackageSelector - Removed variants field from DeserializablePackageSelector - Updated test files to only include variants in package definitions - Variants remain as optional metadata in package definitions - Packages must be distinguishable by other means (location, name, etc.) This ensures backward compatibility while still allowing variants to be stored as optional metadata for future use.
- Remove unused VariantValue imports from serialize/deserialize modules - Apply cargo fmt formatting changes
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.
Add
variantsto source packages in the lock-file. In the future, we want to make this mandatory, but we want to make sure we don't break compatibility withv6.