-
Notifications
You must be signed in to change notification settings - Fork 53
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
Question: Is There a Way to Enable Extras in tool.scikit-build.overrides
?
#908
Comments
Unfortunately that would be incompatible with PyPI packaging where including an optional-dependency does not add, change, or remove files being installed, only dependencies installed change. What you could do is support packaging ecosystems that do support such a split like conda, spack and distro packaging, but that is particular to each of those systems. As long as you can control it via a |
The way people sometimes do this is they make a second package with the MPI components, then include that via an extra. So Or, of course, you can have a custom define, and make different "pkg" wheels, but keep in mind only one wheel with the same name can be uploaded to PyPI. If you can always compile with MPI, but only activate it when mpi4py is present, that could work too. It would make building the wheel a bit harder (but you could provide the (But, yes, PyPI packaging doesn't allow extras to modify a wheel like Rust does). |
Is there an example available that uses MPI while creating a wheel? From what I understand about working with MPI, it needs to be installed manually on the user's side at first. Then, when a user installs the MPI version of the package, it starts building the package during the installation through the wheel. I am not sure how |
Context
I am working on a project where I want to enable conditional features, specifically MPI support, using Python extras during installation:
I have defined optional dependencies in my
pyproject.toml
like this:I want to conditionally enable MPI in the build configuration, and I tried using the
[[tool.scikit-build.overrides]]
section to detect when thempi
extra is used:However, this results in an error:
Question
Is there currently a way to conditionally apply overrides based on extras (e.g.,
extra == 'mpi'
) within thetool.scikit-build.overrides
section?Suggestion (If Not Currently Supported)
If this feature is not currently supported, would it be possible to introduce support for matching extras within the
overrides
section? This would make it easier to enable specific build configurations based on user-specified extras, aligning with Python’soptional-dependencies
mechanism.Thank you for your time and assistance!
Environment Details
scikit-build-core
version:0.10.7
3.12
Linux
The text was updated successfully, but these errors were encountered: