-
Notifications
You must be signed in to change notification settings - Fork 0
Support filtering variant dependencies from build reqs #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
base: main
Are you sure you want to change the base?
Conversation
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.
Code looks like it'll work as advertised, only some minor comments.
variant_x86_64;
'x86_64' in variants
My one more substantial comment is that the semantics of this syntax may need to become more well-defined. This intuitively feels circular: depend on the x86-64 plugin if x86-64 is in the environment (which perhaps we can only know if we have the x86-64 plugin already?).
@@ -36,6 +36,7 @@ dynamic = ["version"] | |||
dependencies = [ | |||
"packaging >= 19.1", | |||
"pyproject_hooks", | |||
"variantlib @ https://github.com/wheelnext/variantlib/archive/main.tar.gz", |
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.
Are these @ https://github.com/wheelnext
still easy enough to work with? It seems like a uv
workspace with a collection of all these forks of packages as editable
is going to be needed at some point.
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.
"Easy" is not a word I'd use. It's quite annoying for development work (I basically uv pip install -e ...
this package, then uv pip install -e ...
variantlib to have it return to the development copy). However, it makes "release" installs easier when variantlib
is not yet on the official index.
self, | ||
dependencies: set[str], | ||
config_settings: ConfigSettings | None = None, | ||
) -> set[str]: |
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.
This logic is probably right; a docstring or some code comments will be helpful before merging though. Just from reading the code it's hard to tell, and navigating to evaluate_variant_requirements
loses context.
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.
Capturing in filter_variants
that this is demo-only and specific to pypa/build
and probably not quite suitable for a final design will be useful here - at least for me, it's the kind of thing I'd forget over time.
This is a slightly different case than runtime dependencies. Here |
xref: wheelnext/variantlib#32
The idea is that e.g. in numpy we can do:
And
build
usesvariantlib
to preprocess the'x86_64' in variants
specifier, so that uv/pip can handle the resulting deps. Not saying the design is neat, but should be good enough for a demo.