Skip to content

fix(conda_types): parse features and license_family in MatchSpec#2175

Open
ritankarsaha wants to merge 1 commit intoconda:mainfrom
ritankarsaha:fix/matchspec-features-license-family
Open

fix(conda_types): parse features and license_family in MatchSpec#2175
ritankarsaha wants to merge 1 commit intoconda:mainfrom
ritankarsaha:fix/matchspec-features-license-family

Conversation

@ritankarsaha
Copy link
Contributor

Description

  • Add features: Option and license_family: Option to both MatchSpec and
    NamelessMatchSpec
    • Wire through into_nameless, From for NamelessMatchSpec, and from_nameless
    • Emit both fields in Display for MatchSpec and NamelessMatchSpec (enables roundtrip)
    • Add matching logic in Matches for both structs (exact-match, same as license)
    • Replace the TODO comment in the bracket parser with two new "license_family" / "features" match
      arms
    • Update test_matchspec_to_string insta snapshot to include both new fields

Fixes #2174

How Has This Been Tested?

  • test_parsing_license_family — parses python[license_family=MIT] and verifies roundtrip via Display
  • test_parsing_features — parses numpy[features=blas] and verifies roundtrip via Display
  • test_features_and_license_family_matching — constructs a PackageRecord with both fields and asserts correct match/no-match behaviour for MatchSpec

Test plan

  • cargo test -p rattler_conda_types match_spec — 100 tests pass (3 new)
  • cargo clippy -p rattler_conda_types — no new warnings
  • cargo fmt -p rattler_conda_types -- --check — clean

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.

@ritankarsaha ritankarsaha force-pushed the fix/matchspec-features-license-family branch from 862beb5 to 3af1376 Compare March 6, 2026 10:00
@ritankarsaha
Copy link
Contributor Author

@baszalmstra can you take a look into this ? Fixed all failing CIs properly

// TODO: Still need to add `features` and `license_family`
// to the match spec.
"license_family" => match_spec.license_family = Some(value.to_string()),
"features" => match_spec.features = Some(value.to_string()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Features have been deprecated and can be removed here.

/// The license family of the package (e.g. `MIT`, `GPL`, `BSD`)
pub license_family: Option<String>,
/// The features of the package
pub features: Option<String>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Features are not used anymore so this is not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

features and license_family bracket attributes silently rejected in MatchSpec

2 participants