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

Can the wheels from this package be Python 3 generic (not specifc to each Python version)? #18

Open
carlosperate opened this issue Nov 24, 2023 · 2 comments · May be fixed by #20
Open

Comments

@carlosperate
Copy link

carlosperate commented Nov 24, 2023

I would assume none of the C code from this package is using the Python C API, is that correct?
If so, I think maybe the wheels can be declared abi3 compatible (the reduced Python3 API) and that'd reduce the total number of wheels to 1 per platform, instead of having one per Python version and per platform.

This would also have the advantage that existing wheels marked with abi3 would be inmediately installable in newer Python versions (at least until a Python release updates the ABI to abi4, maybe the future no-gil), so the package would not have to be updated just to support the latest Python release, like in #16.

I've not yet had to create a Python wheel with C extensions, so not my area of expertise and I could be wrong here, but worth exploring?

@carlosperate
Copy link
Author

From the cibuildwheel docs I've found this entry about the "ABI3 wheels (Limited API)":
https://cibuildwheel.readthedocs.io/en/stable/faq/#abi3
And it links to this repo as an example: https://github.com/joerick/python-abi3-package-sample

But I've also noticed this in the v2.8.0 changelog, which looks promising as well:
https://cibuildwheel.readthedocs.io/en/stable/changelog/#v280

Adds support for building py3-none-{platform} wheels. This works the same as ABI3 - wheels won't be rebuilt, but tests will still be run across all selected versions of Python.

These wheels contain native extension code, but don't use the Python APIs. Typically, they're bridged to Python using a FFI module like ctypes or cffi. Because they don't use Python ABI, the wheels are more compatible - they work across many Python versions.

Check out this example ctypes project to see an example of how it works. (#1151)

pypa/cibuildwheel#1151

@carlosperate carlosperate linked a pull request Nov 24, 2023 that will close this issue
@carlosperate
Copy link
Author

Attempt PR:

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

Successfully merging a pull request may close this issue.

1 participant