-
Couldn't load subscription status.
- Fork 31
feat(settings): add version-specific prebuilt wheel configuration #800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
727b709 to
9dbb644
Compare
Enable fine-grained control over prebuilt vs source builds within variants by allowing per-version overrides. This resolves conflicts where different collections need different build methods for the same package version. - Add VersionSpecificSettings model with pre_built and wheel_server_url - Extend VariantInfo with versions mapping for version-specific overrides - Update PackageBuildInfo with version-aware methods (is_pre_built, get_wheel_server_url) - Modify bootstrapper, wheels, and build commands to use version-specific logic - Add comprehensive tests validating precedence and backward compatibility - Create detailed how-to documentation with examples and migration guide Maintains full backward compatibility with existing variant-wide settings. Version-specific settings take precedence over variant defaults when present. Fixes python-wheel-build#801
9dbb644 to
00c94bd
Compare
|
|
||
| # Check if package has version-specific settings (any version-specific config) | ||
| variant_info = pbi._ps.variants.get(pbi._variant) | ||
| has_version_specific_prebuilt = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is going to be messier than I thought.
The _ps field really should be private to the PBI. We could at least wrap this logic in a method, but it's odd to need to know about the version-specific prebuilt flags before we resolve the version we're going to bootstrapping.
I don't remember why we have different logic for resolving versions of prebuilt wheels. How different is that logic from the other flow? Does it skip some steps or are there completely different steps?
|
Can we have a discussion about the design before we move forward? This approach is going to make the package settings more complex and will require API breaking chances. It's also not very flexible, because you'll have to add an entry for every version. I think a hook function would give is more flexibility and is easier to implement. |
| env: EnvVars = Field(default_factory=dict) | ||
| """Version-specific env vars (override variant env vars)""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really, really need this? There is update_extra_environ to add conditional and dynamic env vars.
| annotations: RawAnnotations | None = None | ||
| """Version-specific annotations (override variant annotations)""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where version-specific annotations are added to annotations.
Enable fine-grained control over prebuilt vs source builds within variants by allowing per-version overrides. This resolves conflicts where different collections need different build methods for the same package version.
Maintains full backward compatibility with existing variant-wide settings. Version-specific settings take precedence over variant defaults when present.
Fixes #801