BLD: add option to build future-compatible abi3 wheels#1600
Open
neutrinoceros wants to merge 1 commit into
Open
BLD: add option to build future-compatible abi3 wheels#1600neutrinoceros wants to merge 1 commit into
neutrinoceros wants to merge 1 commit into
Conversation
neutrinoceros
commented
Jun 16, 2026
|
|
||
| # restrict LIMITED_API usage: | ||
| # - require an env var PYPROJ_LIMITED_API=1 | ||
| # - LIMITED_API is not compatible with free-threading (as of CPython 3.14) |
Contributor
Author
There was a problem hiding this comment.
note this comment is going to age like milk because there's a new version of the Limited API coming up in Python 3.15 that's compatible with both GIL-enabled and free-threaded builds. However there are a couple other blockers right now (Cython and setuptools both have work-in-progress patches to support this). Note that I'd be happy to revisit this later this year to add cp315-abi3.abi3t as a target
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This allows targeting CPython's LimitedAPI (and stable ABI) by setting
PYPROJ_LIMITED_API=1at build time. Resulting wheels are future compatible with yet-unreleased Python versions.The trade-off is that runtime performance might be impacted, though I suggest measuring it against real load-bearing applications, as I found that in many numpy-based extensions the impact to be negligible or even non-measurable.
I could successfully build the package and run the test suite with this locally.
I suggest a couple possible approaches to leverage this:
cp314-abi3target to the existing build matrix. Version-specific wheels will still be prefered by installers when available but will default to these otherwise, instead of having to, and often failing to build pyproj from source.cp311-abi3wheel per platform. If there are no visible performance regressions this is definitely the way to go.