Merge branch 'master' into henryiii-patch-3

This commit is contained in:
Henry Schreiner
2026-01-21 17:58:09 -05:00
committed by GitHub
74 changed files with 2197 additions and 607 deletions

View File

@@ -88,7 +88,7 @@ jobs:
cmake-args: -DCMAKE_CXX_STANDARD=20 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
- runs-on: ubuntu-latest
python-version: '3.14'
cmake-args: -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_FLAGS="-DPYBIND11_HAS_SUBINTERPRETER_SUPPORT=0"
cmake-args: -DCMAKE_CXX_STANDARD=14
- runs-on: ubuntu-latest
python-version: 'pypy-3.10'
cmake-args: -DCMAKE_CXX_STANDARD=14
@@ -229,6 +229,7 @@ jobs:
run: cmake --build . --target pytest
- name: Compiled tests
timeout-minutes: 3
run: cmake --build . --target cpptest
- name: Interface test
@@ -296,7 +297,7 @@ jobs:
- name: Valgrind cache
if: matrix.valgrind
uses: actions/cache@v4
uses: actions/cache@v5
id: cache-valgrind
with:
path: valgrind
@@ -334,6 +335,7 @@ jobs:
run: cmake --build --preset default --target pytest
- name: C++ tests
timeout-minutes: 3
run: cmake --build --preset default --target cpptest
- name: Visibility test
@@ -393,6 +395,7 @@ jobs:
run: cmake --build build --target pytest
- name: C++ tests
timeout-minutes: 3
run: cmake --build build --target cpptest
- name: Interface test
@@ -470,10 +473,10 @@ jobs:
# Testing on Ubuntu + NVHPC (previous PGI) compilers, which seems to require more workarounds
ubuntu-nvhpc7:
ubuntu-nvhpc:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
name: "🐍 3 • NVHPC 23.5 • C++17 • x64"
runs-on: ubuntu-24.04
name: "🐍 3 • NVHPC 25.11 • C++17 • x64"
timeout-minutes: 90
env:
@@ -482,6 +485,11 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Clean out unused stuff to save space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL
sudo apt-get clean
- name: Add NVHPC Repo
run: |
echo 'deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | \
@@ -489,10 +497,11 @@ jobs:
- name: Install 🐍 3 & NVHPC
run: |
sudo apt-get update -y && \
sudo apt-get install -y cmake environment-modules git python3-dev python3-pip python3-numpy && \
sudo apt-get install -y --no-install-recommends nvhpc-23-5 && \
sudo apt-get update -y
sudo apt-get install -y cmake environment-modules git python3-dev python3-pip python3-numpy
sudo apt-get install -y --no-install-recommends nvhpc-25-11
sudo rm -rf /var/lib/apt/lists/*
apt-cache depends nvhpc-25-11
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pytest
@@ -502,7 +511,7 @@ jobs:
shell: bash
run: |
source /etc/profile.d/modules.sh
module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.5
module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/25.11
cmake -S . -B build -DDOWNLOAD_CATCH=ON \
-DCMAKE_CXX_STANDARD=17 \
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \
@@ -510,12 +519,13 @@ jobs:
-DPYBIND11_TEST_FILTER="test_smart_ptr.cpp"
- name: Build
run: cmake --build build -j 2 --verbose
run: cmake --build build -j $(nproc) --verbose
- name: Python tests
run: cmake --build build --target pytest
- name: C++ tests
timeout-minutes: 3
run: cmake --build build --target cpptest
- name: Interface test
@@ -570,6 +580,7 @@ jobs:
run: cmake --build build --target pytest
- name: C++ tests
timeout-minutes: 3
run: cmake --build build --target cpptest
- name: Interface test
@@ -652,6 +663,7 @@ jobs:
cmake --build build-11 --target check
- name: C++ tests C++11
timeout-minutes: 3
run: |
set +e; source /opt/intel/oneapi/setvars.sh; set -e
cmake --build build-11 --target cpptest
@@ -689,6 +701,7 @@ jobs:
cmake --build build-17 --target check
- name: C++ tests C++17
timeout-minutes: 3
run: |
set +e; source /opt/intel/oneapi/setvars.sh; set -e
cmake --build build-17 --target cpptest
@@ -760,6 +773,7 @@ jobs:
run: cmake --build build --target pytest
- name: C++ tests
timeout-minutes: 3
run: cmake --build build --target cpptest
- name: Interface test
@@ -778,7 +792,8 @@ jobs:
timeout-minutes: 90
steps:
- uses: actions/checkout@v1 # v1 is required to run inside docker
# v1 required for i386/debian container; pinned to SHA to prevent dependabot updates
- uses: actions/checkout@544eadc6bf3d226fd7a7a9f0dc5b5bf7ca0675b9 # v1
- name: Install requirements
run: |
@@ -1000,6 +1015,7 @@ jobs:
run: cmake --build build --target pytest
- name: C++20 tests
timeout-minutes: 3
run: cmake --build build --target cpptest -j 2
- name: Interface test C++20
@@ -1076,6 +1092,7 @@ jobs:
run: cmake --build build --target pytest -j 2
- name: C++11 tests
timeout-minutes: 3
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 2
- name: Interface test C++11
@@ -1100,6 +1117,7 @@ jobs:
run: cmake --build build2 --target pytest -j 2
- name: C++14 tests
timeout-minutes: 3
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target cpptest -j 2
- name: Interface test C++14
@@ -1124,6 +1142,7 @@ jobs:
run: cmake --build build3 --target pytest -j 2
- name: C++17 tests
timeout-minutes: 3
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target cpptest -j 2
- name: Interface test C++17
@@ -1153,7 +1172,7 @@ jobs:
uses: actions/checkout@v6
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
uses: egor-tensin/setup-clang@v2
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v6
@@ -1195,6 +1214,7 @@ jobs:
run: cmake --build . --target pytest -j 2
- name: C++ tests
timeout-minutes: 3
run: cmake --build . --target cpptest -j 2
- name: Interface test
@@ -1205,3 +1225,136 @@ jobs:
- name: Clean directory
run: git clean -fdx
# Clang with MSVC/Windows SDK toolchain + python.org CPython (Windows ARM)
windows_arm_clang_msvc:
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
os: [windows-11-arm]
python: ['3.13']
runs-on: "${{ matrix.os }}"
timeout-minutes: 90
name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-msvc"
steps:
- name: Show env
run: env
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
architecture: arm64
- name: Run pip installs
run: |
python -m pip install --upgrade pip
python -m pip install -r tests/requirements.txt
- name: Configure CMake
run: >
cmake -G Ninja -S . -B .
-DPYBIND11_WERROR=OFF
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=20
-DPython_ROOT_DIR="$env:Python_ROOT_DIR"
- name: Build
run: cmake --build . -j 2
- name: Python tests
run: cmake --build . --target pytest -j 2
- name: C++ tests
timeout-minutes: 3
run: cmake --build . --target cpptest -j 2
- name: Interface test
run: cmake --build . --target test_cmake_build -j 2
- name: Visibility test
run: cmake --build . --target test_cross_module_rtti -j 2
# Clang in MSYS2/MinGW-w64 CLANGARM64 toolchain + MSYS2 Python (Windows ARM)
windows_arm_clang_msys2:
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
os: [windows-11-arm]
runs-on: "${{ matrix.os }}"
timeout-minutes: 90
name: "${{ matrix.os }} • clang-msys2"
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v6
with:
submodules: true
- uses: msys2/setup-msys2@v2
with:
msystem: CLANGARM64
update: true
install: |
mingw-w64-clang-aarch64-cmake
mingw-w64-clang-aarch64-clang
mingw-w64-clang-aarch64-ninja
mingw-w64-clang-aarch64-python-pip
mingw-w64-clang-aarch64-python-pytest
mingw-w64-clang-aarch64-python-numpy
- name: Debug info
run: |
clang++ --version
cmake --version
ninja --version
python --version
- name: Run pip installs
run: |
python -m pip install --upgrade pip
python -m pip install -r tests/requirements.txt
- name: Configure CMake
run: >-
cmake -S . -B build
-DPYBIND11_WERROR=OFF
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=20
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
- name: Build
run: cmake --build build -j 2
- name: Python tests
run: cmake --build build --target pytest -j 2
- name: C++ tests
timeout-minutes: 3
run: PYTHONHOME=/clangarm64 PYTHONPATH=/clangarm64 cmake --build build --target cpptest -j 2
- name: Interface test
run: cmake --build build --target test_cmake_build -j 2
- name: Visibility test
run: cmake --build build --target test_cross_module_rtti -j 2

View File

@@ -39,10 +39,10 @@ jobs:
cmake: "3.15"
- runs-on: macos-14
cmake: "4.0"
cmake: "4.2"
- runs-on: windows-latest
cmake: "4.0"
cmake: "4.2"
name: 🐍 3.11 • CMake ${{ matrix.cmake }} • ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}

View File

@@ -33,7 +33,7 @@ jobs:
nox -s build
nox -s build_global
- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@v6
with:
name: Packages
path: dist/*
@@ -44,7 +44,7 @@ jobs:
needs: [build_wheel]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v6
- uses: actions/download-artifact@v7
with:
name: Packages
path: dist
@@ -53,7 +53,7 @@ jobs:
run: ls -lha dist/*.whl
- name: Upload wheel to Anaconda Cloud as nightly
uses: scientific-python/upload-nightly-action@b36e8c0c10dbcfd2e05bf95f17ef8c14fd708dbf # 0.6.2
uses: scientific-python/upload-nightly-action@5748273c71e2d8d3a61f3a11a16421c8954f9ecf # 0.6.3
with:
artifacts_path: dist
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}

View File

@@ -72,13 +72,13 @@ jobs:
run: twine check dist/*
- name: Save standard package
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: standard
path: dist/pybind11-*
- name: Save global package
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: global
path: dist/*global-*
@@ -100,7 +100,7 @@ jobs:
steps:
# Downloads all to directories matching the artifact names
- uses: actions/download-artifact@v6
- uses: actions/download-artifact@v7
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v3

View File

@@ -83,6 +83,7 @@ jobs:
run: cmake --build build --target pytest
- name: C++ tests
timeout-minutes: 3
run: cmake --build build --target cpptest
- name: Interface test

View File

@@ -66,6 +66,7 @@ jobs:
run: cmake --build build11 --target pytest -j 2
- name: C++11 tests
timeout-minutes: 3
run: cmake --build build11 --target cpptest -j 2
- name: Interface test C++11
@@ -87,6 +88,7 @@ jobs:
run: cmake --build build17 --target pytest
- name: C++17 tests
timeout-minutes: 3
run: cmake --build build17 --target cpptest
# Third build - C++17 mode with unstable ABI