Skip to content

Configure cibuildwheel maximum Python version - #16957

Open
Jake Lishman (jakelishman) wants to merge 1 commit into
Qiskit:mainfrom
jakelishman:cibuildwheel-python-test
Open

Configure cibuildwheel maximum Python version#16957
Jake Lishman (jakelishman) wants to merge 1 commit into
Qiskit:mainfrom
jakelishman:cibuildwheel-python-test

Conversation

@jakelishman

@jakelishman Jake Lishman (jakelishman) commented Sep 7, 2026

Copy link
Copy Markdown
Member

If we keep cibuildwheel completely up-to-date, it will attempt to build and test wheels up to the maximum current Python, including if it is in pre-release. We don't want our wheel-build jobs to fail if our dependencies aren't ready for the prerelease (as happened with dill during the Python 3.15 release-candidate period), so we want to skip the tests for them entirely. Our wheels are still compatible because we build for abi3.

I used CIBW_PROJECT_REQUIRES_PYTHON instead of messing with CIBW_BUILD or CIBW_TEST_SKIP because it's nicer to express the ABI intent with static globs on CIBW_BUILD (i.e. we build cp3??-* but not cp3??t-* as yet), and CIBW_TEST_SKIP is awkward because we'd have to calculate which versions of Python not to build; there's no "test-only" or the like.

Motivated by #16901

AI/LLM disclosure

  • No part of this submission is LLM generated.
  • Some written text was generated by:
  • Some submitted code was generated by:

@jakelishman
Jake Lishman (jakelishman) requested a review from a team as a code owner September 7, 2026 20:53
@jakelishman Jake Lishman (jakelishman) added type: qa Issues and PRs that relate to testing and code quality Changelog: None Do not include in the GitHub Release changelog. ci: test wheels Run the wheel-build scripts as an additional CI run for this PR labels Sep 7, 2026
@qiskit-bot

Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@jakelishman
Jake Lishman (jakelishman) force-pushed the cibuildwheel-python-test branch 4 times, most recently from fe8df7d to 9a3abd0 Compare September 7, 2026 21:02
If we keep `cibuildwheel` completely up-to-date, it will attempt to
build _and test_ wheels up to the maximum current Python, including if
it is in pre-release.  We don't want our wheel-build jobs to fail if our
dependencies aren't ready for the prerelease (as happened with `dill`
during the Python 3.15 release-candidate period), so we want to skip the
tests for them entirely.  Our wheels are still compatible because we
build for `abi3`.

I used `CIBW_PROJECT_REQUIRES_PYTHON` instead of messing with
`CIBW_BUILD` or `CIBW_TEST_SKIP` because it's nicer to express the ABI
intent with static globs on `CIBW_BUILD` (i.e. we build `cp3??-*` but
not `cp3??t-*` as yet), and `CIBW_TEST_SKIP` is awkward because we'd
have to calculate which versions of Python _not_ to build; there's no
"test-only" or the like.
@coveralls

Coveralls (coveralls) commented Sep 7, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34205988335

Coverage increased (+0.02%) to 87.873%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 4 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

4 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
crates/qasm2/src/lex.rs 3 92.8%
crates/circuit/src/parameter/parameter_expression.rs 1 90.31%

Coverage Stats

Coverage Status
Relevant Lines: 132856
Covered Lines: 116745
Line Coverage: 87.87%
Coverage Strength: 985560.28 hits per line

💛 - Coveralls

@jakelishman Jake Lishman (jakelishman) added the on hold Can not fix yet label Sep 7, 2026
@jakelishman

Copy link
Copy Markdown
Member Author

On hold while commit 9909985 is on the branch - that's just a test to make sure reconfiguring based on Python versions correctly restricts cibuildwheel.

@jakelishman

Copy link
Copy Markdown
Member Author

Excellent, it works completely as expected. See the old run, which was on top of 9909985: https://github.com/Qiskit/qiskit/actions/runs/34166990971?pr=16957.

@jakelishman Jake Lishman (jakelishman) removed the on hold Can not fix yet label Sep 8, 2026
@mtreinish

Copy link
Copy Markdown
Member

Did it actually work correctly though? You specified the min as 3.11 and the max as 3.13 which should be >=3.11,<=3.13 but it only ran tests on 3.11 and 3.12. I would have expected it to test 3.13 too.

@jakelishman

Copy link
Copy Markdown
Member Author

Oh huh yeah, I misread the actual number of versions tested - I was only really paying attention to the lower bound... It'll be the <=3.13 specifier being interpreted as <=3.13.0, I bet. I could do the ugly hack of making it <=3.13.999 - that's probably actually easier than having to pipe it through a Python script or something just to add one to the minor version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: None Do not include in the GitHub Release changelog. ci: test wheels Run the wheel-build scripts as an additional CI run for this PR type: qa Issues and PRs that relate to testing and code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants