forked from mesonbuild/meson-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Support specifying variants for wheel builds #1
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
Closed
Closed
Changes from 8 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
da7bf41
Support specifying variants for wheel builds
mgorny 2cd858a
Fix breakage without variants
mgorny 3bd701e
Include a variantlib dependency
mgorny b87c479
Try via URL instead
mgorny 0717750
Support `-Dvariant` that gets passed through to meson
mgorny baff058
Fix handling variant-name without variant
mgorny 8c752d5
Support appending plugin labels to wheel names
mgorny 88645e2
variantlib changes were merged to main
mgorny 5b8429c
Fix other variantlib reference
mgorny c2df897
Actually, we need variant-labels branch
mgorny d6ddb8c
On my fork
mgorny c93f2be
Install demo_plugins as part of meson-python
mgorny 9ba73d3
Update to follow variantlib API changes
mgorny b2e9b80
Update the demo plugin API
mgorny 7a71cc5
Add variant validation
mgorny 5886b42
Use newer variant validation API
mgorny c100caa
Set CFLAGS/CXXFLAGS via get_build_setup()
mgorny 61d95a0
Remove demo-plugins (they are being moved to a separate package)
mgorny 4c73d71
Restore blas demo plugin
mgorny 3035504
Use numpy-demo branch of variantlib
mgorny dc3d905
Support other meson environment variables via get_build_setup
mgorny d0fb02e
Use variantlib from main branch
mgorny 6809ddb
Update for new metadata API, support Variant-Provider metadata
mgorny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from variantlib.base import PluginBase | ||
from variantlib.config import ProviderConfig | ||
from variantlib.meta import VariantDescription | ||
|
||
|
||
class BlasPlugin(PluginBase): | ||
namespace = "blas" | ||
|
||
def get_supported_configs(self) -> ProviderConfig: | ||
return None | ||
|
||
def get_variant_labels(self, variant_desc: VariantDescription) -> list[str]: | ||
for meta in variant_desc: | ||
if meta.namespace == "blas" and meta.key == "variant": | ||
return [meta.value] | ||
return [] | ||
|
||
|
||
class X8664Plugin(PluginBase): | ||
namespace = "x86_64" | ||
|
||
def get_supported_configs(self) -> ProviderConfig: | ||
return None | ||
|
||
def get_variant_labels(self, variant_desc: VariantDescription) -> list[str]: | ||
for meta in variant_desc: | ||
if meta.namespace == "x86_64" and meta.key == "baseline": | ||
return [f"x86_64_{meta.value}"] | ||
return [] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[build-system] | ||
requires = ["flit_core>=3.2,<4"] | ||
build-backend = "flit_core.buildapi" | ||
|
||
[project] | ||
name = "demo-plugins" | ||
version = "0" | ||
description = "Demo plugins for meson-python/numpy variants" | ||
dependencies = ["variantlib"] | ||
|
||
[project.entry-points."variantlib.plugins"] | ||
blas = "demo_plugins:BlasPlugin" | ||
x86_64 = "demo_plugins:X8664Plugin" |
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
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
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.
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.
Does this take into account that we're running this code before
auditwheel
is going to make it quite a bit longer?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.
Well, it obviously can't predict what will happen once meson-python is done with it. I guess the only way to handle that is to adjust the limit — and I've put a totally arbitrary number here. I suppose we could even make it configurable via
config_settings
, so people can adjust when their workflows alter the tags afterwards.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.
Makes sense. We can always tweak the number later. My gut feel is that 128 is on the generous side, but it doesn't matter too much for now.