Skip to content

Pin Cython<3.3 for pyzmq source-build compat (3006.x) - #70121

Open
dwoz wants to merge 1 commit into
saltstack:3006.xfrom
dwoz:dwoz/fix/cython-3.3-pin-3006x
Open

Pin Cython<3.3 for pyzmq source-build compat (3006.x)#70121
dwoz wants to merge 1 commit into
saltstack:3006.xfrom
dwoz:dwoz/fix/cython-3.3-pin-3006x

Conversation

@dwoz

@dwoz dwoz commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

What broke

Cython 3.3.0 was published to PyPI on 2026-08-22. Its tightened parser
rejects variable redeclarations in pyzmq 27.1.0's cython sources:

zmq/backend/cython/_zmq.py:357:8: 'hint' redeclared
zmq/backend/cython/_zmq.py:1112:12: 'c_addr' redeclared
ninja: build stopped: subcommand failed.
error: Failed to build installable wheels for some pyproject.toml based projects (pyzmq)

pyzmq is source-built under the relenv onedir toolchain
(--no-binary=:all: in tools/pkg/build.py), so pip's PEP-517
build-isolation env resolves Cython fresh from PyPI and picks up 3.3.0.
Every active branch's Build Onedir / Source Packages / Onedir Packages
jobs go red the same way.

Fix

  • Add Cython < 3.3 to requirements/constraints.txt.
  • Export the same file via PIP_BUILD_CONSTRAINT alongside
    PIP_CONSTRAINT in noxfile.py and tools/pkg/build.py. Necessary
    because PIP_CONSTRAINT stopped propagating into PEP-517
    build-isolation envs in pip 26.x (deprecated in 26.1, enforced in
    26.2 -- pip 26.1.2 already prints the deprecation on every install).

Scope

Build-tooling only. No runtime dependency changes, no lock-file
regeneration, no Salt source touched.

Cross-branch

Same fix opened in parallel on 3007.x / 3008.x / master. Sibling PR
links to be added once all four are open.

@dwoz
dwoz requested a review from a team as a code owner August 22, 2026 22:46
Cython 3.3.0 (published to PyPI 2026-08-22) tightened its parser and
rejects variable redeclarations in pyzmq 27.1.0's cython sources
(zmq/backend/cython/_zmq.py:357 'hint', :1112 'c_addr'). pyzmq is
source-built under the relenv onedir toolchain (--no-binary=:all:),
so pip's PEP-517 build-isolation env resolves Cython fresh from PyPI
and picks up 3.3.0.

Pin Cython<3.3 in requirements/constraints.txt and export the same
file via PIP_BUILD_CONSTRAINT alongside PIP_CONSTRAINT everywhere it
is set, because PIP_CONSTRAINT stopped propagating into build-isolation
envs in pip 26.x (deprecated in 26.1, enforced in 26.2). Build tooling
only; no runtime dependency changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant