Skip to content

Parse and validate variant metadata - #22512

Merged
konstin merged 3 commits into
mainfrom
konsti/wheel-variant-metadata
Oct 20, 2026
Merged

konstin merged 3 commits into
mainfrom
konsti/wheel-variant-metadata

Conversation

@konstin

@konstin konstin commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Implement variants.json parsing following PEP 825. Invalid variant metadata is treat like other invalid package metadata, backtracking on the version (instead of failing). The parsed data isn't used yet.

@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from aa435c3 to f1ef4e4 Compare October 13, 2026 12:51
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from f1ef4e4 to c349c78 Compare October 13, 2026 13:08
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from c349c78 to c5ddece Compare October 13, 2026 13:16
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from c5ddece to 4d60ede Compare October 13, 2026 13:36
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from 4d60ede to 96a4f87 Compare October 13, 2026 13:43
@konstin konstin added the preview Experimental behavior label Oct 13, 2026
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from 96a4f87 to 4703454 Compare October 13, 2026 15:59
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from 4703454 to 0077c86 Compare October 14, 2026 09:06
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from 0077c86 to bcc0b1e Compare October 14, 2026 09:33
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from bcc0b1e to 8d359d0 Compare October 14, 2026 09:46
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from ca82c70 to a9bff7d Compare October 18, 2026 10:38
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from a9bff7d to 5d89aa1 Compare October 18, 2026 12:51
@konstin
konstin requested a review from zsol October 18, 2026 14:52
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from 5f92508 to 2449eef Compare October 18, 2026 15:52
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from 2449eef to 5add82f Compare October 19, 2026 10:21
Base automatically changed from konsti/variant-json-fetch to main October 19, 2026 11:39
@konstin
konstin force-pushed the konsti/wheel-variant-metadata branch from 5add82f to b9e5805 Compare October 19, 2026 11:42
@astral-sh-bot

astral-sh-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the main base revision.

  • Added tests: 16
  • Removed tests: 0
  • Changed suites: 2
uv-distribution-types::variants_json: +13 / -0

Added:

  • uv-distribution-types::variants_json::normalize_variants_json
  • uv-distribution-types::variants_json::reject_duplicate_feature_values
  • uv-distribution-types::variants_json::reject_duplicate_namespace_priorities
  • uv-distribution-types::variants_json::reject_empty_feature_values
  • uv-distribution-types::variants_json::reject_empty_namespace_priorities
  • uv-distribution-types::variants_json::reject_invalid_namespace_in_priorities
  • uv-distribution-types::variants_json::reject_invalid_variant_feature
  • uv-distribution-types::variants_json::reject_invalid_variant_label
  • uv-distribution-types::variants_json::reject_invalid_variant_namespace
  • uv-distribution-types::variants_json::reject_invalid_variant_value
  • uv-distribution-types::variants_json::reject_namespace_missing_from_priorities
  • uv-distribution-types::variants_json::reject_null_variant_with_properties
  • uv-distribution-types::variants_json::reject_unknown_field_in_default_priorities

Removed: none

uv::pip_install: +3 / -0

Added:

  • uv::pip_install::wheel_variants::invalid_variant_metadata
  • uv::pip_install::wheel_variants::invalid_variant_metadata_backtrack
  • uv::pip_install::wheel_variants::invalid_variant_metadata_unknown_schema

Removed: none

#[serde(rename_all = "kebab-case", try_from = "VariantsJsonWire")]
pub struct VariantsJsonContent {
#[serde(rename = "$schema")]
schema: String,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if it'd be worth having a separate type for this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What kind of type do you have in mind?

This branch was previously deployed

1 inactive deployment
automations — b7ea204e Deployed Oct 20, 2026 by konstin via review / security review #51845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址