ci: drop the swig<4.5 build constraint, fixed upstream in PyKCS11 1.5.19 - #1958
ihsandeniz wants to merge 2 commits into
Conversation
The constraint was added in py-pdf#1931 as a workaround for py-pdf#1928: swig 4.5.0 removed PyInt_FromLong, which broke the PyKCS11 sdist build (PyKCS11#167). PyKCS11#167 was fixed upstream on 2026-08-24 and released in 1.5.19 (2026-08-26); 1.5.20 followed on 2026-09-04. Two independent reasons the constraint is now obsolete: * the sdist builds cleanly against swig 4.5.0 (upstream fix), and * 1.5.20 publishes manylinux/musllinux wheels for cp39-cp314, so the Linux CI jobs no longer build from source at all (1.5.18 shipped macOS/Windows wheels only). Keep creating the constraints file even when empty: pip aborts with "Could not open requirements file" when PIP_BUILD_CONSTRAINT points to a missing path, and the removed swig line was what created that file for every Python version other than 3.14.
PIP_BUILD_CONSTRAINT applies to every pip invocation in the step, including the initial `pip install --upgrade pip setuptools wheel`. The removed `echo 'swig<4.5' > ...` line used to create the file before that call, so moving the file creation below it made pip abort with "Could not open requirements file" on the very first command.
|
The first run failed on It was not the dependency change: the job died on the very first command of the step, before anything was resolved.
Verified locally this time, in the CI's own conditions:
One detail worth recording, since it is what made my first local check pass when it should not have: a fresh Sorry for the noise on the queue. |
Closes #1928.
@andersonhc wrote in #1928 that the issue would stay open "until a new version on PyKCS11 is on pypi so we can remove the workaround", and @prateek-dagar reported on 2026-08-27 that the new version was out. This removes the workaround added in #1931.
Why it is safe to remove
PyKCS11declaresrequires = ["setuptools", "swig"]in its[build-system], so pip installs swig from PyPI into the build environment — which is whyPIP_BUILD_CONSTRAINTworked in the first place. Two independent things changed since #1931:manylinux/musllinuxwheels for cp39–cp314, so those jobs no longer compile anything.Measured, not assumed
Fresh venvs, Python 3.12, swig not installed on the host (so any source build is forced to pull swig from PyPI — currently 4.5.0):
error: 'PyInt_FromLong' was not declared in this scope— the exact PyKCS11#167 signatureswig<4.5--no-build-isolationagainst a pinnedswig==4.5.0)pykcs11-1.5.20-cp312-...-manylinux_2_28_x86_64.whl, no compilationPyKCS11reaches the CI throughendesive, which is in thetestextra (endesive→requires_dist: pykcs11). Only thelintandtestjobs install.[dev,test], sodocandpublishare unaffected.One subtlety worth flagging
The
swig<4.5line was also the line that createdconstraints.txt. Deleting it alone would break thetestjob for every Python version except 3.14, because pip aborts withCould not open requirements filewhenPIP_BUILD_CONSTRAINTpoints to a missing path — verified locally. #1931 had removed the previous: > "$CONSTRAINTS_FILE" # create empty filebranch for that reason, so this PR restores it. Thenumpy>=2.3.3constraint for 3.14 is untouched.zizmorreports no findings on the modified workflow.CHANGELOG
Not added, following this repository's own precedent: #1931, which introduced the workaround, has no CHANGELOG entry either, and the CI-related entries that do exist describe user-visible scope changes (adding macOS coverage, enforcing mypy/pyright) rather than temporary build pins. Happy to add one if you would rather have it.
If I have misread anything here, please say so before merging.