Add Python 3.13 and 3.14 wheel builds#809
Conversation
Made-with: Cursor
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
There was a problem hiding this comment.
Pull request overview
This PR updates packaging metadata and CI/build tooling to produce and test wheels for newer CPython versions (3.13 and 3.14), reducing installation friction for downstream users who otherwise need system libssh headers to build from source.
Changes:
- Adds Python 3.13/3.14 trove classifiers in
setup.cfg. - Updates build constraints and PEP 517 backend build requirements to use newer Cython for Python 3.14.
- Expands CI matrices to include 3.13/3.14 and bumps
cibuildwheelGitHub Action to a version that supports these interpreters.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.cfg | Adds Python 3.13/3.14 classifiers. |
| requirements-build.txt | Updates the pinned Cython build constraint version. |
| packaging/pep517_backend/_backend.py | Adjusts conditional Cython build requirements for 3.13 vs 3.14+. |
| .github/workflows/reusable-cibuildwheel.yml | Bumps pypa/cibuildwheel action to a newer major version. |
| .github/workflows/ci-cd.yml | Extends build/test matrices to include Python 3.13 and 3.14. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
webknjaz
left a comment
There was a problem hiding this comment.
FYI, a part of this is being worked on in #808, the other part requires preparatory work like #795, #744 and some others. Once you're done experimenting here, make sure to send atomic PRs for every individual change being made. I'm definitely not going to accept a bunch of unrelated changes smashed together .
The PR summary has been updated to map changes to the addition of python3.13/3.14. There are no unrelated changes in this PR. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
.github/workflows/ci-cd.yml:330
- The f-strings here use a space before the conversion flag (
{sdist_file_prj_base_name !s}/{whl_file_prj_base_name !s}), which is invalid Python syntax and will make this workflow step fail at runtime. Remove the whitespace (or drop the!sconversion entirely) so theprint(...)calls are syntactically valid.
f"sdist={sdist_file_prj_base_name !s}-${{
steps.request-check.outputs.release-requested == 'true'
&& github.event.inputs.release-version
|| steps.scm-version.outputs.dist-version
}}.tar.gz",
file=outputs_file,
)
print(
f"wheel={whl_file_prj_base_name !s}-${{
steps.request-check.outputs.release-requested == 'true'
&& github.event.inputs.release-version
|| steps.scm-version.outputs.dist-version
}}-cp3*-cp3*-*.whl",
file=outputs_file,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
9b52ef2 to
37902e3
Compare
|
How about following the PR template, though? |
|
Updated the PR description to follow the template structure (SUMMARY / ISSUE TYPE / ADDITIONAL INFORMATION). The detailed breakdown of the causal chain is retained under ADDITIONAL INFORMATION since the cascading dependencies between changes warrant the context. Also pushed code changes addressing the other review comments:
|
|
@webknjaz — Updated the PR description with a per-file change map showing each file's change and its justification (direct vs cascade). Also added an honest note about the setuptools/PEP 625 scope: the bump from 68.2.2 to 82.0.1 was incidental from re-running Other updates since last review:
|
c837497 to
820ec40
Compare
Bump cibuildwheel from v2.17.0 to v3.3.1 and Cython from 3.0.12 to 3.1.8 to enable cp313/cp314 wheel building. Add Python 3.13 and 3.14 to CI test and build matrices. Cascading changes from the cibuildwheel v2 to v3 upgrade: - Re-compile requirements-build.txt (setuptools 68.2.2 to 82.0.1) - Adapt CI workflow and Packit config for PEP 625 sdist normalization - Skip free-threaded (*t-*) builds (Cython lacks Py_mod_gil_not_used) - Skip armv7l/riscv64 (no container images for these arches) - Set MACOSX_DEPLOYMENT_TARGET=14.0 (delocate 0.13.0 enforces deployment-target consistency with brew-installed dylibs) - Configure core=ctrace in .coveragerc for Python 3.14 compatibility Made-with: Cursor
| 'pr': (f'{github_repo_url}/pull/%s', 'PR #%s'), | ||
| 'commit': (f'{github_repo_url}/commit/%s', '%s'), | ||
| 'gh': (f'{github_url}/%s', 'GitHub: %s'), | ||
| 'pypi': ('https://pypi.org/project/%s', '%s'), |
There was a problem hiding this comment.
🤔 I didn't realize sphinx-issues isn't yet integrated here. Will have to add it later.
There was a problem hiding this comment.
The :pypi: extlink was added here to satisfy the review request for RST roles in the changelog fragments. sphinx-issues would be a cleaner long-term solution.
|
Looks like there's no atomic commits even. This will make handling the patch more difficult. |
A variation of a portion of this patch was also independently demonstrated in PR ansible#809. This is dictated by PEP 625 which modern versions of `setuptools` implement. Co-Authored-By: Bradley A. Thornton <bthornto@redhat.com>
|
All review comments have been addressed or acknowledged. The maintainer has indicated he will arrive at Python 3.13/3.14 support through his own sequencing, with portions of this work already absorbed into #808. Closing this PR to avoid further conflict with that approach. The technical findings from this PR remain available as reference:
Thank you for the detailed review. |
| test-command = "python -Im pytest -m smoke --no-cov {project}/tests" | ||
| skip = "pp*" | ||
| skip = [ | ||
| "pp*", # FIXME: we don't ship these currently but could |
There was a problem hiding this comment.
In #821, I discovered that having this triggers a warning in cibuildwheel v3+ which has a flipped default for PyPy and has been overlooked in this patch.
These do not currently have a suitable infra and will have to be handled separately. `cibuildwheel` v3.1.2 enables this architecture by default so this patch configures the build system to skip the arch. Brad first discovered this in PR ansible#809. Co-Authored-By: Bradley A. Thornton <bthornto@redhat.com>
| - python-version: "3.13" | ||
| runner-vm-os: ubuntu-22.04 | ||
| store-sdist-to-artifact: false | ||
| - python-version: "3.12" | ||
| runner-vm-os: ubuntu-22.04 | ||
| store-sdist-to-artifact: true |
There was a problem hiding this comment.
FTR, this should've gone into the main matrix as 2 lines as they are smoke tests and all of the factors are already set up there and don't need repeating. Only the highest version (3.14) would be configured differently to save the artifact for further use in the following CI jobs.
There was a problem hiding this comment.
Even better — it'd be enough to just update 3.12 to 3.14 here as the oldest supported Python versions are the smoke test and there's really no need to test everything in between sdist-wise. This was added mainly as a regression guardrails, IIRC, and was just a single job at some point until something broke.
| """ | ||
| c_ext_build_deps = [ | ||
| 'Cython >= 3.0.11; python_version >= "3.13"', # Ideally >= 3.1.0 | ||
| 'Cython >= 3.1.0; python_version >= "3.14" and python_version < "3.15"', |
There was a problem hiding this comment.
Leaving the crusial dep missing under Python 3.15 is a practice highly discouraged by PyPA. There must be no upper bound in such cases — it's quite a cruel thing to do. Otherwise, it's a straight way towards backtracking and/or breaking future runtime users ruthlessly.
|
|
||
| Bumped :pypi:`cibuildwheel` from v2.17.0 to v3.3.1 (required for | ||
| ``cp313``/``cp314`` wheel building) and :pypi:`Cython` from 3.0.12 | ||
| to 3.1.8 (Cython 3.0.x has known build failures with Python 3.14). |
There was a problem hiding this comment.
No proof of this. I confirmed that Cython 3.1 is needed for free-threading support. With FT disabled, there's no justification for setting a bar higher than it needs to be.
SUMMARY
Add Python 3.13 and 3.14 wheel builds to unblock downstream consumers
(e.g.
ansible.netcommonviaansible-pylibssh).Per-file change map:
setup.cfgpackaging/pep517_backend/_backend.pyCython >= 3.1.0for 3.14,>= 3.0.11for 3.13 (3.0.x has known build failures on 3.14).github/workflows/reusable-cibuildwheel.yml.github/workflows/ci-cd.yml.github/workflows/ci-cd.yml*t-*toCIBW_SKIPin 3 jobsPy_mod_gil_not_used.github/workflows/ci-cd.ymlf"sdist={sdist_file_prj_base_name}".github/workflows/ci-cd.ymlenv:blockSource0; also moves GHA expressions out ofrun:to avoid script injectionpyproject.toml*t-*,armv7l,riscv64; setMACOSX_DEPLOYMENT_TARGET*t-*— see above;armv7l/riscv64—CIBW_ARCHS_LINUX=allin the odd-arches job now attempts these since v3 has working support, but no libssh container images exist;MACOSX_DEPLOYMENT_TARGET=15.0—delocate0.13.0 now errors on deployment-target mismatch; brew-installedopenssl@3(3.6.1) onmacos-15-intelhas a minimum target of 15.0 (CI evidence).coveragerccore = ctracesys.monitoringtracer;ctraceavoids the issue (cf. coveragepy#2099)requirements-build.txtpip-compile; this incidentally resolvedsetuptoolsfrom 68.2.2 to 82.0.1, which introduced PEP 625 sdist normalization.packit.ymlansible_pylibssh-{version}{upstream_pkg_name}resolves to hyphens but the sdist directory is now underscores per PEP 625packaging/rpm/ansible-pylibssh.spec%{sdist_name}macro, update%autosetupdocs/changelog-fragments/809.packaging.rstdocs/changelog-fragments/809.contrib.rstNote on setuptools / PEP 625 scope:
Re-running
pip-compilefor the Cython update incidentally resolvedsetuptoolsfrom 68.2.2 to 82.0.1 (no dependency forces this —setuptools-scmonly requires>= 61). The newer setuptools introduced PEP 625 sdist filename normalization (underscores), which cascaded to.packit.yml, the RPM spec, and CI workflow changes. Constraining setuptools to the old version would avoid these changes but deliberately hold back standard-compliant behavior. If preferred, these can be split into a separate preparatory PR.Fixes #781
ISSUE TYPE
ADDITIONAL INFORMATION
Motivation:
Collections depending on
ansible-pylibssh(e.g. viaansible.netcommon) fail to install on Python 3.13+ because no pre-built wheels are available, and building from source requireslibsshdevelopment headers that are typically not installed.Notes:
cp314t) are skipped per cibuildwheel v3.1.0 guidance: "you have to skip it explicitly with'cp31?t-*'if you don't support it yet."delocate0.13.0 enforces deployment-target consistency and the brew-installedopenssl@3(3.6.1) bottle onmacos-15-intelhas a minimum target of 15.0 (CI error log).armv7l/riscv64skip entries are defensive:CIBW_ARCHS_LINUX=allwas already set in the odd-arches job; cibuildwheel v3 has working support for these arches, so builds now fail loudly rather than silently. No container images with libssh exist for them.Test plan: