From 28a558a74fa16aa8660931f2a5619499038f0310 Mon Sep 17 00:00:00 2001 From: Jan Kadlec Date: Mon, 2 Nov 2026 15:04:56 +0100 Subject: [PATCH] Support Python 3.15 Upgrade pybind11 to 3.1.0, the first release tested on Python 3.15, and add Python 3.15 to the wheel build and PR validation matrices. The Ubuntu and Windows runners ship CMake 3.31, whose FindPython does not know Python 3.15 and fails with "Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Development.Module)". Instead of installing a newer CMake, those jobs pass the interpreter, include directory and (on Windows) import library to FindPython, taken from the Python that setup-python installed. --- .../workflows/ci-build-release-wheels.yaml | 12 +++++++++- .github/workflows/ci-pr-validation.yaml | 23 ++++++++++++++----- README.md | 2 +- RELEASE.md | 2 +- dependencies.yaml | 2 +- pulsar/__init__.py | 2 +- pybind11 | 2 +- 7 files changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-build-release-wheels.yaml b/.github/workflows/ci-build-release-wheels.yaml index 277b7e22..30779c18 100644 --- a/.github/workflows/ci-build-release-wheels.yaml +++ b/.github/workflows/ci-build-release-wheels.yaml @@ -46,6 +46,7 @@ jobs: - {version: '3.12', spec: 'cp312-cp312'} - {version: '3.13', spec: 'cp313-cp313'} - {version: '3.14', spec: 'cp314-cp314'} + - {version: '3.15', spec: 'cp315-cp315'} cpu: - {arch: 'x86_64', platform: 'x86_64', runner: 'ubuntu-latest'} - {arch: 'aarch64', platform: 'arm64', runner: 'ubuntu-24.04-arm'} @@ -102,6 +103,7 @@ jobs: - {version: '3.12', version_long: '3.12.8'} - {version: '3.13', version_long: '3.13.1'} - {version: '3.14', version_long: '3.14.0'} + - {version: '3.15', version_long: '3.15.0'} steps: - name: checkout @@ -132,6 +134,7 @@ jobs: - {version: '3.12'} - {version: '3.13'} - {version: '3.14'} + - {version: '3.15'} steps: - uses: actions/checkout@v3 @@ -161,9 +164,16 @@ jobs: tar zxf v${PYBIND11_VERSION}.tar.gz rm -rf pybind11 mv pybind11-${PYBIND11_VERSION} pybind11 + # CMake 3.31 on the runner predates Python 3.15, so FindPython needs the paths + PY_EXE=$(python -c 'import pathlib, sys; print(pathlib.Path(sys.executable).as_posix())') + PY_INCLUDE=$(python -c 'import pathlib, sysconfig; print(pathlib.Path(sysconfig.get_paths()["include"]).as_posix())') + PY_LIB=$(python -c 'import pathlib, sys; print(pathlib.Path(sys.base_prefix, "libs", "python%d%d.lib" % sys.version_info[:2]).as_posix())') cmake -B build -A x64 \ -DCMAKE_PREFIX_PATH=${{ env.PULSAR_CPP_DIR }} \ - -DLINK_STATIC=ON + -DLINK_STATIC=ON \ + -DPython3_EXECUTABLE="$PY_EXE" \ + -DPython3_INCLUDE_DIR="$PY_INCLUDE" \ + -DPython3_LIBRARY="$PY_LIB" - name: Build Python wheel shell: bash diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index d7fcd7a5..e753d4e7 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -58,7 +58,7 @@ jobs: strategy: fail-fast: false matrix: - version: ['3.10', '3.14'] + version: ['3.10', '3.15'] steps: - name: checkout @@ -71,8 +71,12 @@ jobs: - name: Install Pulsar C++ client run: build-support/install-dependencies.sh + # CMake 3.31 on the runner predates Python 3.15, so FindPython needs the paths - name: CMake - run: cmake . + run: | + cmake . \ + -DPython3_EXECUTABLE="$(which python3)" \ + -DPython3_INCLUDE_DIR="$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["include"])')" - name: Build run: make -j8 @@ -119,7 +123,7 @@ jobs: - {name: 'manylinux', py_suffix: ''} - {name: 'manylinux_musl', py_suffix: '-alpine'} python: - - {version: '3.14', spec: 'cp314-cp314'} + - {version: '3.15', spec: 'cp315-cp315'} cpu: - {arch: 'x86_64', platform: 'x86_64'} @@ -166,7 +170,7 @@ jobs: strategy: matrix: py: - - {version: '3.14', version_long: '3.14.0'} + - {version: '3.15', version_long: '3.15.0'} steps: - name: checkout @@ -188,7 +192,7 @@ jobs: fail-fast: false matrix: python: - - version: '3.14' + - version: '3.15' steps: - uses: actions/checkout@v3 @@ -218,9 +222,16 @@ jobs: tar zxf v${PYBIND11_VERSION}.tar.gz rm -rf pybind11 mv pybind11-${PYBIND11_VERSION} pybind11 + # CMake 3.31 on the runner predates Python 3.15, so FindPython needs the paths + PY_EXE=$(python -c 'import pathlib, sys; print(pathlib.Path(sys.executable).as_posix())') + PY_INCLUDE=$(python -c 'import pathlib, sysconfig; print(pathlib.Path(sysconfig.get_paths()["include"]).as_posix())') + PY_LIB=$(python -c 'import pathlib, sys; print(pathlib.Path(sys.base_prefix, "libs", "python%d%d.lib" % sys.version_info[:2]).as_posix())') cmake -B build -A x64 \ -DCMAKE_PREFIX_PATH=${{ env.PULSAR_CPP_DIR }} \ - -DLINK_STATIC=ON + -DLINK_STATIC=ON \ + -DPython3_EXECUTABLE="$PY_EXE" \ + -DPython3_INCLUDE_DIR="$PY_INCLUDE" \ + -DPython3_LIBRARY="$PY_LIB" - name: Build Python wheel shell: bash diff --git a/README.md b/README.md index 0be80156..eff3dae3 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Pulsar Python clients support a variety of Pulsar features to enable building ap ## Requirements -- Python 3.10, 3.11, 3.12, 3.13 or 3.14 +- Python 3.10, 3.11, 3.12, 3.13, 3.14 or 3.15 - A C++ compiler that supports C++11 - CMake >= 3.18 - [Pulsar C++ client library](https://github.com/apache/pulsar-client-cpp) diff --git a/RELEASE.md b/RELEASE.md index a6981d39..08cd4fd8 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -132,7 +132,7 @@ stay open for at least 72 hours *** Python wheels: https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-python-X.Y.Z-candidate-N/ -The supported python versions are 3.10, 3.11, 3.12, 3.13 and 3.14. The +The supported python versions are 3.10, 3.11, 3.12, 3.13, 3.14 and 3.15. The supported platforms and architectures are: - Windows x86_64 (windows/) - glibc-based Linux x86_64 (linux-glibc-x86_64/) diff --git a/dependencies.yaml b/dependencies.yaml index 608d16fc..2818786a 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -18,6 +18,6 @@ # pulsar-cpp: 4.2.0 -pybind11: 3.0.1 +pybind11: 3.1.0 # The OpenSSL dependency is only used when building Python from source openssl: 1.1.1q diff --git a/pulsar/__init__.py b/pulsar/__init__.py index c1600f29..96d80d9f 100644 --- a/pulsar/__init__.py +++ b/pulsar/__init__.py @@ -21,7 +21,7 @@ The Pulsar Python client library is based on the existing C++ client library. All the same features are exposed through the Python interface. -Currently, the supported Python versions are 3.10, 3.11, 3.12, 3.13 and 3.14. +Currently, the supported Python versions are 3.10, 3.11, 3.12, 3.13, 3.14 and 3.15. ================= Install from PyPI diff --git a/pybind11 b/pybind11 index f5fbe867..97bf890d 160000 --- a/pybind11 +++ b/pybind11 @@ -1 +1 @@ -Subproject commit f5fbe867d2d26e4a0a9177a51f6e568868ad3dc8 +Subproject commit 97bf890db679505a14dfe547a5e77bb2bd05dc90