Skip to content

pypi: export setup.py switches that opt into Cython - #2017

Closed
pohlarized wants to merge 0 commit into
google:mainfrom
pohlarized:agent-upstream-pr-r2/pypi-setup-cython-env-gates
Closed

pohlarized wants to merge 0 commit into
google:mainfrom
pohlarized:agent-upstream-pr-r2/pypi-setup-cython-env-gates

Conversation

@pohlarized

@pohlarized pohlarized commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Some setup.py files compile their Cython extensions only when an environment variable asks for it, so that source installs without a compiler still work. Upstream CI sets the variable, as charset-normalizer does with CHARSET_NORMALIZER_USE_CYTHON and fonttools with FONTTOOLS_WITH_CYTHON. Without it the rebuild takes the pure Python path and auditwheel rejects the result.

Add a BuildEnv map to PlatformWheelBuild, validated in ToWorkflow and exported in sorted order before the wheel build. When the wheel's modules record a Cython version, set each *_USE_CYTHON or *_WITH_CYTHON variable that setup.py reads to 1, and *_CYTHON_ABI3 only for abi3 wheels.

Children: #2018

@pohlarized pohlarized self-assigned this Nov 10, 2026
@pohlarized pohlarized added feature request New feature or request go Pull requests that update go code labels Nov 10, 2026
@pohlarized
pohlarized marked this pull request as ready for review November 10, 2026 14:01
@pohlarized
pohlarized requested a review from msuozzo November 10, 2026 14:01
@pohlarized pohlarized closed this Nov 11, 2026
@pohlarized
pohlarized force-pushed the agent-upstream-pr-r2/pypi-setup-cython-env-gates branch from 0122237 to eff2be6 Compare November 11, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant