Skip to content

Honor SETUPTOOLS_EXT_SUFFIX for limited-API builds - #623

Open
jameshilliard wants to merge 1 commit into
PyO3:mainfrom
jameshilliard:fix/ext-suffix-override
Open

jameshilliard wants to merge 1 commit into
PyO3:mainfrom
jameshilliard:fix/ext-suffix-override

Conversation

@jameshilliard

Copy link
Copy Markdown
Contributor

Setuptools honors SETUPTOOLS_EXT_SUFFIX when generating extension filenames, but setuptools-rust always removes the length of the sysconfig EXT_SUFFIX when replacing it with a stable-ABI suffix. An override with a different length can truncate the module name or leave part of the old suffix in the filename.

Use the nonempty environment override to determine the suffix being replaced, falling back to sysconfig for unset or empty overrides, matching setuptools.

Add regression tests covering unset, empty, shorter, and longer overrides with unqualified and platform-qualified ABI3/ABI3T suffixes, .pyd, and platforms without a stable-ABI suffix. Add a changelog entry.

Testing

  • Project tests: 36 passed with setuptools 84.2.1.
  • Ruff lint and formatting checks, and mypy passed.
  • Cross-built AArch64 limited-API wheels with short and long suffix overrides. Both contained the correct rust.abi3.so filename and cp39-abi3-linux_aarch64 wheel tags, and imported and executed successfully under QEMU with Python 3.14.

This branch has not been deployed

No deployments
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 this pull request may close these issues.

1 participant