Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ show_missing = true

[run]
branch = true
# NOTE: `ctrace` tracing method is needed because the `sysmon` tracer,
# NOTE: which is default on Python 3.14, is not supported by the Cython
# NOTE: coverage plugin's file tracers and causes unprecedented slow-down.
# Ref: https://github.com/coveragepy/coveragepy/issues/2099
# Ref: https://github.com/coveragepy/coveragepy/issues/2082
core = ctrace
cover_pylib = false
# NOTE: `disable_warnings` is needed when `pytest-cov` runs in tandem
# NOTE: with `pytest-xdist`. These warnings are false negative in this
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ jobs:
mode=FILE_APPEND_MODE,
) as outputs_file:
print(
"sdist=${{ env.PROJECT_NAME }}-${{
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
Expand Down Expand Up @@ -590,6 +590,8 @@ jobs:
${{ needs.pre-setup.outputs.dists-artifact-name }}
# CIBW_CONFIG_SETTINGS: `with-cython-tracing` — for coverage collection
# CIBW_ARCHS_MACOS=all x86_64 arm64 universal2
# NOTE: *t-* skips free-threaded builds — Cython extensions do not
# NOTE: set Py_mod_gil_not_used, causing RuntimeWarning on import.
Comment thread
cidrblock marked this conversation as resolved.
environment-variables: |-
CIBW_ARCHS_MACOS=native

Expand All @@ -609,6 +611,7 @@ jobs:
*-musllinux_*
*-win32
*_arm64
*t-*
Comment thread
cidrblock marked this conversation as resolved.
pp*
EOF'
|| ''
Expand Down Expand Up @@ -642,6 +645,8 @@ jobs:
${{ needs.pre-setup.outputs.dists-artifact-name }}
# CIBW_CONFIG_SETTINGS: `with-cython-tracing` — for coverage collection
# CIBW_ARCHS_MACOS=all x86_64 arm64 universal2
# NOTE: *t-* skips free-threaded builds — Cython extensions do not
# NOTE: set Py_mod_gil_not_used, causing RuntimeWarning on import.
environment-variables: |-
CIBW_ARCHS_MACOS=native

Expand All @@ -659,6 +664,7 @@ jobs:
*_i686
*-musllinux_*
*-*linux_{aarch64,ppc64le,s390x}
*t-*
pp*
EOF'
|| ''
Expand Down Expand Up @@ -694,6 +700,8 @@ jobs:
# CIBW_ARCHS_LINUX: Build emulated architectures if QEMU, else "auto"
# CIBW_CONFIG_SETTINGS: `with-cython-tracing` — for coverage collection
# CIBW_ARCHS_MACOS=all x86_64 arm64 universal2
# NOTE: *t-* skips free-threaded builds — Cython extensions do not
# NOTE: set Py_mod_gil_not_used, causing RuntimeWarning on import.
environment-variables: |-
CIBW_ARCHS_LINUX=all

Expand All @@ -711,8 +719,11 @@ jobs:
!fromJSON(needs.pre-setup.outputs.release-requested)
&& 'CIBW_SKIP<<EOF
*_i686
*-manylinux_armv7l
*-manylinux_riscv64
*-musllinux_*
*-*linux_x86_64
*t-*
pp*
EOF'
|| ''
Expand Down Expand Up @@ -752,7 +763,13 @@ jobs:
store-sdist-to-artifact:
- false
include:
- python-version: 3.12
- python-version: "3.14"
Comment thread
cidrblock marked this conversation as resolved.
runner-vm-os: ubuntu-22.04
store-sdist-to-artifact: false
- 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
Comment thread
cidrblock marked this conversation as resolved.
store-sdist-to-artifact: true
Comment on lines +769 to 774
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


Expand Down Expand Up @@ -992,10 +1009,13 @@ jobs:
run: rpmlint packaging/rpm/${{ env.PROJECT_NAME }}.spec

- name: Copy sdist to the sources dir
env:
SDIST_ARTIFACT: ${{ needs.pre-setup.outputs.sdist-artifact-name }}
DIST_VERSION: ${{ needs.pre-setup.outputs.dist-version }}
run: >-
cp -v
'dist/${{ needs.pre-setup.outputs.sdist-artifact-name }}'
~/rpmbuild/SOURCES/
"dist/${SDIST_ARTIFACT}"
~/"rpmbuild/SOURCES/${PROJECT_NAME}-${DIST_VERSION}.tar.gz"

- name: Install transitive deps for build deps in external repos
if: contains(matrix.target-container.tag, 'ubi')
Expand Down Expand Up @@ -1132,6 +1152,8 @@ jobs:
strategy:
matrix:
python-version:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
Expand Down Expand Up @@ -1168,6 +1190,8 @@ jobs:
strategy:
matrix:
python-version:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v3.3.1
Comment thread
cidrblock marked this conversation as resolved.
with:
package-dir: >- # not necessarily a dir, we pass an acceptable sdist
dist/${{ inputs.source-tarball-name }}
Expand Down
4 changes: 2 additions & 2 deletions .packit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ actions:
--sourcedir packaging/rpm/ansible-pylibssh.spec
'
- tox -e build-dists -qq -- --sdist
- sh -c 'echo dist/"${PACKIT_PROJECT_NAME_VERSION}".tar.gz'
- sh -c 'echo dist/ansible_pylibssh-"${PACKIT_PROJECT_VERSION}".tar.gz'
Comment thread
cidrblock marked this conversation as resolved.
get-current-version:
- >-
bash -c "
Expand All @@ -31,7 +31,7 @@ actions:
# - 5DE3E0509C47EA3CF04A42D34AEE18F83AFDEB23 # GH web UI commit signing key

archive_root_dir_template: >-
{upstream_pkg_name}-{version}
ansible_pylibssh-{version}
Comment thread
cidrblock marked this conversation as resolved.

copy_upstream_release_description: false

Expand Down
11 changes: 11 additions & 0 deletions docs/changelog-fragments/809.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Updated CI infrastructure for Python 3.13 and 3.14 support
-- by :user:`cidrblock`.

Bumped :pypi:`cibuildwheel` from v2.17.0 to v3.3.1, :pypi:`setuptools`
from 68.2.2 to 82.0.1, and re-compiled :file:`requirements-build.txt` to
resolve transitive pin conflicts. Adapted the CI workflow and Packit
config for :pep:`625` sdist filename normalization (underscores) caused
by the ``setuptools`` upgrade. Configured ``core = ctrace`` in
Comment thread
cidrblock marked this conversation as resolved.
:file:`.coveragerc` to work around the :pypi:`Cython` coverage plugin not
supporting Python 3.14's :mod:`sys.monitoring` tracer
(cf. :gh:`coveragepy/coveragepy#2099`).
12 changes: 12 additions & 0 deletions docs/changelog-fragments/809.packaging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Added Python 3.13 and 3.14 wheel builds
-- by :user:`cidrblock`.

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).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

The :pep:`517` backend now requires ``Cython >= 3.1.0`` for Python 3.14
and ``Cython >= 3.0.11`` for Python 3.13. Free-threaded (``*t-*``)
Python builds are skipped because Cython extensions do not yet set
``Py_mod_gil_not_used``. macOS wheels now require macOS 15.0+
(``MACOSX_DEPLOYMENT_TARGET``) due to :pypi:`delocate` 0.13.0 enforcing
deployment-target consistency with brew-installed ``libssh``.
1 change: 1 addition & 0 deletions docs/conf.py
Comment thread
cidrblock marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
'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'),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I didn't realize sphinx-issues isn't yet integrated here. Will have to add it later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xref #818

'user': (f'{github_sponsors_url}/%s', '@%s'),
}

Expand Down
3 changes: 2 additions & 1 deletion packaging/pep517_backend/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ def get_requires_for_build_wheel(

"""
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"',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

'Cython >= 3.0.11; python_version >= "3.13" and python_version < "3.14"',
Comment thread
cidrblock marked this conversation as resolved.
'Cython >= 3.0.0; python_version >= "3.12" and python_version < "3.13"',
Comment thread
cidrblock marked this conversation as resolved.
'Cython; python_version < "3.12"',
]
Expand Down
5 changes: 3 additions & 2 deletions packaging/rpm/ansible-pylibssh.spec
Comment thread
cidrblock marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
%global pypi_name ansible-pylibssh
%global sdist_name ansible_pylibssh

# NOTE: The target version may be set dynamically via
# NOTE: rpmbuild --define "upstream_version 0.2.1.dev125+g0b5bde0"
%global upstream_version_fallback %(ls -t dist/%{pypi_name}-*.tar.gz 2>/dev/null | head -n 1 | sed 's#^dist\\/%{pypi_name}-\\(.*\\)\\.tar\\.gz$#\\1#')
%global upstream_version_fallback %(ls -t dist/%{sdist_name}-*.tar.gz 2>/dev/null | head -n 1 | sed 's#^dist\\/%{sdist_name}-\\(.*\\)\\.tar\\.gz$#\\1#')
# If "upstream_version" macro is unset, use the fallback defined above:
%if "%{!?upstream_version:UNSET}" == "UNSET"
%global upstream_version %{upstream_version_fallback}
Expand Down Expand Up @@ -68,7 +69,7 @@ Summary: %{summary}
$summary

%prep
%autosetup -p1 -n %{pypi_name}-%{version}
%autosetup -p1 -n %{sdist_name}-%{version}

%if 0%{?rhel} == 9
# NOTE: Since RHEL 9 does not have setuptools-scm 7+ in the repos, we change the
Expand Down
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ build-frontend = "build"
# container-engine = "podman" # FIXME?
test-requires = "pytest pytest-cov pytest-xdist"
test-command = "python -Im pytest -m smoke --no-cov {project}/tests"
skip = "pp*"
skip = [
"pp*", # FIXME: we don't ship these currently but could
Comment thread
cidrblock marked this conversation as resolved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

# Cython extensions do not set Py_mod_gil_not_used; free-threaded builds
# fail with RuntimeWarning on import:
Comment thread
cidrblock marked this conversation as resolved.
"*t-*",
]

[tool.cibuildwheel.environment]
COLOR = "yes"
Expand All @@ -225,6 +230,8 @@ manylinux-ppc64le-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_ppc64le:libss
manylinux-s390x-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_s390x:libssh-v0.12.0"
manylinux-x86_64-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_x86_64:libssh-v0.12.0"
skip = [
"*-manylinux_armv7l", # no custom container image with libssh for this arch
Comment thread
cidrblock marked this conversation as resolved.
Comment thread
cidrblock marked this conversation as resolved.
"*-manylinux_riscv64", # no custom container image with libssh for this arch
"*-musllinux_*", # FIXME: musllinux needs us to provide with containers pre-built libssh
"pp*", # FIXME: we don't ship these currently but could

Expand Down Expand Up @@ -274,6 +281,12 @@ before-build = [
# working_directory: libssh/build
]

[tool.cibuildwheel.macos.environment]
# delocate (bundled with cibuildwheel v3) enforces that the wheel's
# deployment target matches the bundled dylibs. The brew-installed
Comment thread
cidrblock marked this conversation as resolved.
# openssl@3 bottle on macos-15-intel targets macOS 15.0.
MACOSX_DEPLOYMENT_TARGET = "15.0"

[tool.cibuildwheel.windows]
skip = "*"

Expand Down
16 changes: 7 additions & 9 deletions requirements-build.txt
Comment thread
cidrblock marked this conversation as resolved.
Comment thread
cidrblock marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements-build.txt --strip-extras -
#
cython==3.0.12
cython==3.1.8
# via -r -
expandvars==0.9.0
# via -r -
packaging==24.0
packaging==26.0
# via setuptools-scm
pyparsing==3.0.9
# via packaging
setuptools-scm==8.1.0
# via -r -
tomli==2.0.1
tomli==2.4.0
# via setuptools-scm
typing-extensions==4.10.0
typing-extensions==4.15.0
# via setuptools-scm
wheel==0.37.1
# via -r -

# The following packages are considered to be unsafe in a requirements file:
setuptools==68.2.2
setuptools==82.0.1
# via
# -r -
# setuptools-scm
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ classifiers =
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14
Programming Language :: Cython

Topic :: Software Development :: Libraries :: Python Modules
Expand Down
Loading