Skip to content

feat(packagesettings): error when source and legacy settings are both set - #1307

Merged
mergify[bot] merged 1 commit into
python-wheel-build:new-resolver-configfrom
LalatenduMohanty:multual_exclusivity_validator_nrc
Aug 26, 2026
Merged

feat(packagesettings): error when source and legacy settings are both set#1307
mergify[bot] merged 1 commit into
python-wheel-build:new-resolver-configfrom
LalatenduMohanty:multual_exclusivity_validator_nrc

Conversation

@LalatenduMohanty

Copy link
Copy Markdown
Member

Summary

  • Add Pydantic model validators on PackageSettings and VariantInfo that reject configs combining the new source field with legacy settings
  • Package-level source conflicts with download_source and resolver_dist; variant-level source conflicts with wheel_server_url and pre_built
  • Uses model_fields_set to correctly detect explicitly provided legacy fields even when they have defaults

Test plan

  • Parametrized tests for invalid package-level combos (source + download_source, source + resolver_dist, both, empty download_source)
  • Parametrized tests for invalid variant-level combos (source + wheel_server_url, source + pre_built)
  • Valid legacy-only and source-only configs still load
  • Error message includes conflicting field names
  • mypy and lint pass

Closes: #1207

🤖 Generated with Claude Code

…th set

Prevent confusing configs where the new `source` field silently
overrides legacy fields. Package-level `source` now conflicts with
`download_source` and `resolver_dist`; variant-level `source`
conflicts with `wheel_server_url` and `pre_built`.

Closes: python-wheel-build#1207
Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
@LalatenduMohanty
LalatenduMohanty requested a review from a team as a code owner August 21, 2026 20:47
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5938beec-45bb-48e9-a91e-c4e10a6b28f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LalatenduMohanty
LalatenduMohanty marked this pull request as draft August 21, 2026 20:48
@mergify mergify Bot added the ci label Aug 21, 2026

@rd4398 rd4398 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good! I will let @smoparth take a look as well

@LalatenduMohanty
LalatenduMohanty marked this pull request as ready for review August 26, 2026 12:32
@mergify
mergify Bot merged commit 375ec7c into python-wheel-build:new-resolver-config Aug 26, 2026
37 checks passed
@mergify

mergify Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants