Skip to content
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

Make it easier to support multiple versions #2472

Open
Narsil opened this issue Feb 6, 2025 · 2 comments
Open

Make it easier to support multiple versions #2472

Narsil opened this issue Feb 6, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@Narsil
Copy link

Narsil commented Feb 6, 2025

Idea

in safetensors, we can leverage the PyBuffer stabilisation in abi3 in order to make some performance optimizations. However, the official support for safetensors the support goes back to py38.

Currently I'm solving this by making a feature to check which abi3 we're supposed to build.

Currently it's quite inconvenient to choose which abi3 to enable directly from pip install command, huggingface/safetensors#567
I'm mostly switching the flags using MATURIN_PEP517_ARGS which is not super simple for newcomers to know. Using pip install . was quite convenient.

I tried to find some kind of mecanism to choose the feature set based on python_version but couldn't find any.
I could make one feature be default and let knowing users be able to build for older python version, but for them the error message is also not great currently (the thing builds, but when running the library missing symbols are declared)

Did I miss it ?
If not, do you think it would be something doable and interesting ?

Implementation

My pyproject knowledge seems limited by the marker notations is specified here: https://peps.python.org/pep-0508/ https://peps.python.org/pep-0496/

I'm not sure how we would implement, or even if there is no major counter indication to it.

@Narsil Narsil added the enhancement New feature or request label Feb 6, 2025
@messense
Copy link
Member

messense commented Feb 6, 2025

@Narsil
Copy link
Author

Narsil commented Feb 6, 2025

Thanks, but that doesn't apply to the abi3-pyxx features, does it ?

Here it would something like that, but more a way to switch features in pyproject.toml based on the python version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants