From b0b81d8deb8aea8fcbfc60c242cbeb6b9cb049cc Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 8 Dec 2025 15:12:39 -0600 Subject: [PATCH 01/15] adding windows arm test - excluding numpy 2.2.0 for arm64 builds --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++ tests/requirements.txt | 5 +-- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f2b688a91..abb0c6bf7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: workflow_dispatch: + push: pull_request: types: - opened @@ -56,6 +57,9 @@ jobs: - runs-on: windows-2022 python-version: '3.8' cmake-args: -DPYBIND11_FINDPYTHON=OFF + - runs-on: windows-11-arm + python-version: '3.11' + cmake-args: -DCMAKE_CXX_STANDARD=17 name: 🐍 @@ -1205,3 +1209,70 @@ jobs: - name: Clean directory run: git clean -fdx + + windows_arm: + if: github.event.pull_request.draft == false + + strategy: + matrix: + os: [windows-11-arm] + python: ['3.11', '3.12', '3.13', '3.14'] + + runs-on: "${{ matrix.os }}" + timeout-minutes: 90 + + name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest" + + 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: Debug information + run: | + where python + python --version + python -m pip --version + + - name: Run pip installs + run: | + python -m pip install --upgrade pip + python -m pip install -r tests/requirements.txt + + - name: Configure Clang + 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=17 + -DPython_ROOT_DIR="$env:Python_ROOT_DIR" + shell: pwsh + + - name: Build + run: cmake --build . -j 2 + + - name: Python tests + run: cmake --build . --target pytest -j 2 + + - name: C++ tests + 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 + + - name: Clean directory + run: git clean -fdx diff --git a/tests/requirements.txt b/tests/requirements.txt index 6e3a260b19..41fc9f1439 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -7,8 +7,9 @@ numpy~=2.2.0; python_version=="3.10" and platform_python_implementation=="PyPy" numpy~=1.26.0; platform_python_implementation=="GraalVM" and sys_platform=="linux" numpy~=1.21.5; platform_python_implementation=="CPython" and python_version>="3.8" and python_version<"3.10" numpy~=1.22.2; platform_python_implementation=="CPython" and python_version=="3.10" -numpy~=1.26.0; platform_python_implementation=="CPython" and python_version>="3.11" and python_version<"3.13" -numpy~=2.2.0; platform_python_implementation=="CPython" and python_version=="3.13" +numpy~=1.26.0; platform_python_implementation=="CPython" and python_version>="3.11" and python_version<"3.13" and platform_machine!="ARM64" +numpy~=2.3.0; platform_python_implementation=="CPython" and python_version>="3.11" and platform_machine=="ARM64" +numpy~=2.2.0; platform_python_implementation=="CPython" and python_version=="3.13" and platform_machine!="ARM64" pytest>=6 pytest-timeout scipy~=1.5.4; platform_python_implementation=="CPython" and python_version<"3.10" From 202d4d43644f941e626dc447729761294be972b9 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Tue, 9 Dec 2025 15:30:45 -0600 Subject: [PATCH 02/15] adding windows arm msys2 test --- .github/workflows/ci.yml | 106 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 99 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abb0c6bf7c..5297837aec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1214,6 +1214,7 @@ jobs: if: github.event.pull_request.draft == false strategy: + fail-fast: false matrix: os: [windows-11-arm] python: ['3.11', '3.12', '3.13', '3.14'] @@ -1221,7 +1222,7 @@ jobs: runs-on: "${{ matrix.os }}" timeout-minutes: 90 - name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest" + name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang" steps: - name: Show env @@ -1235,12 +1236,6 @@ jobs: with: python-version: ${{ matrix.python }} architecture: arm64 - - - name: Debug information - run: | - where python - python --version - python -m pip --version - name: Run pip installs run: | @@ -1276,3 +1271,100 @@ jobs: - name: Clean directory run: git clean -fdx + + windows_arm_msys2: + if: github.event.pull_request.draft == false + + strategy: + fail-fast: false + matrix: + os: [windows-11-arm] + python: ["3.11", "3.12", "3.13", "3.14"] + + runs-on: "${{ matrix.os }}" + timeout-minutes: 90 + + name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang • msys2" + + 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 + + - name: Add MSYS2 CLANGARM64 to PATH + run: | + echo "${{ runner.temp }}/msys64/clangarm64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 + echo "$PWD" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + architecture: arm64 + + - 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 Clang + run: >- + cmake -G "MinGW Makefiles" -S . -B build + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + -DCMAKE_CXX_COMPILER=clang++ + -DCMAKE_CXX_STANDARD=17 + -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") + + - name: Build + run: cmake --build build -j 2 + + - name: Check DLL dependencies + shell: pwsh + run: | + $pydFile = Get-ChildItem -Path "build\tests" -Filter "pybind11_tests*.pyd" | Select-Object -First 1 + Write-Host "Found: $($pydFile.FullName)" + & "C:\a\_temp\msys64\clangarm64\bin\llvm-objdump.exe" -p $pydFile.FullName | Select-String "DLL Name:" + Write-Host "`nChecking if dependency DLLs exist:" + Get-ChildItem "C:\a\_temp\msys64\clangarm64\bin\libc++*.dll" + Get-ChildItem "C:\a\_temp\msys64\clangarm64\bin\libunwind*.dll" + + - name: Copy required DLLs to test directory + shell: pwsh + run: | + Copy-Item "C:\a\_temp\msys64\clangarm64\bin\libc++.dll" -Destination "build\tests\" + Copy-Item "C:\a\_temp\msys64\clangarm64\bin\libunwind.dll" -Destination "build\tests\" + Write-Host "Copied DLLs to build\tests:" + Get-ChildItem "build\tests\*.dll" + + - name: Python tests + run: > + cmake --build build --target pytest -j 2 + + - name: C++ tests + run: 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 + + - name: Clean directory + run: git clean -fdx \ No newline at end of file From 4f2f1851960812f54345befb812e6364934fd0ec Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Wed, 10 Dec 2025 15:58:24 -0600 Subject: [PATCH 03/15] testing mingw python --- .github/workflows/ci.yml | 57 +++++++++------------------------------- 1 file changed, 12 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5297837aec..f1bd4f7f60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1269,22 +1269,17 @@ jobs: - name: Visibility test run: cmake --build . --target test_cross_module_rtti -j 2 - - name: Clean directory - run: git clean -fdx - windows_arm_msys2: if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - os: [windows-11-arm] - python: ["3.11", "3.12", "3.13", "3.14"] - - runs-on: "${{ matrix.os }}" + runs-on: windows-11-arm timeout-minutes: 90 - name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang • msys2" + name: "🐍 3.12 • windows-11-arm • clang • msys2" + + defaults: + run: + shell: msys2 {0} steps: - uses: actions/checkout@v6 @@ -1299,17 +1294,10 @@ jobs: mingw-w64-clang-aarch64-cmake mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-ninja - - - name: Add MSYS2 CLANGARM64 to PATH - run: | - echo "${{ runner.temp }}/msys64/clangarm64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 - echo "$PWD" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8 + mingw-w64-clang-aarch64-python-pip + mingw-w64-clang-aarch64-python-pytest + mingw-w64-clang-aarch64-python-numpy - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - architecture: arm64 - - name: Debug info run: | clang++ --version @@ -1322,10 +1310,10 @@ jobs: python -m pip install --upgrade pip python -m pip install -r tests/requirements.txt - - name: Configure Clang + - name: Configure CMake run: >- - cmake -G "MinGW Makefiles" -S . -B build - -DPYBIND11_WERROR=ON + cmake -S . -B build + -DPYBIND11_WERROR=OFF -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_COMPILER=clang++ @@ -1335,24 +1323,6 @@ jobs: - name: Build run: cmake --build build -j 2 - - name: Check DLL dependencies - shell: pwsh - run: | - $pydFile = Get-ChildItem -Path "build\tests" -Filter "pybind11_tests*.pyd" | Select-Object -First 1 - Write-Host "Found: $($pydFile.FullName)" - & "C:\a\_temp\msys64\clangarm64\bin\llvm-objdump.exe" -p $pydFile.FullName | Select-String "DLL Name:" - Write-Host "`nChecking if dependency DLLs exist:" - Get-ChildItem "C:\a\_temp\msys64\clangarm64\bin\libc++*.dll" - Get-ChildItem "C:\a\_temp\msys64\clangarm64\bin\libunwind*.dll" - - - name: Copy required DLLs to test directory - shell: pwsh - run: | - Copy-Item "C:\a\_temp\msys64\clangarm64\bin\libc++.dll" -Destination "build\tests\" - Copy-Item "C:\a\_temp\msys64\clangarm64\bin\libunwind.dll" -Destination "build\tests\" - Write-Host "Copied DLLs to build\tests:" - Get-ChildItem "build\tests\*.dll" - - name: Python tests run: > cmake --build build --target pytest -j 2 @@ -1365,6 +1335,3 @@ jobs: - name: Visibility test run: cmake --build build --target test_cross_module_rtti -j 2 - - - name: Clean directory - run: git clean -fdx \ No newline at end of file From 08abf889ae4422b86d92302597423cdb4c7e7896 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Wed, 10 Dec 2025 16:52:35 -0600 Subject: [PATCH 04/15] unnamed namespace test on windows arm with clang and mingw --- tests/test_unnamed_namespace_a.cpp | 6 ++++++ tests/test_unnamed_namespace_a.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_unnamed_namespace_a.cpp b/tests/test_unnamed_namespace_a.cpp index 26e9cb7515..1204ccdc82 100644 --- a/tests/test_unnamed_namespace_a.cpp +++ b/tests/test_unnamed_namespace_a.cpp @@ -33,5 +33,11 @@ TEST_SUBMODULE(unnamed_namespace_a, m) { true; #else false; +#endif + m.attr("defined___aarch64__") = +#if defined(__aarch64__) || defined(_M_ARM64) + true; +#else + false; #endif } diff --git a/tests/test_unnamed_namespace_a.py b/tests/test_unnamed_namespace_a.py index fabf1312af..18ce3a00df 100644 --- a/tests/test_unnamed_namespace_a.py +++ b/tests/test_unnamed_namespace_a.py @@ -5,7 +5,7 @@ from pybind11_tests import unnamed_namespace_a as m from pybind11_tests import unnamed_namespace_b as mb -XFAIL_CONDITION = "not m.defined_WIN32_or__WIN32 and (m.defined___clang__ or m.defined__LIBCPP_VERSION)" +XFAIL_CONDITION = "(not m.defined_WIN32_or__WIN32 and (m.defined___clang__ or m.defined__LIBCPP_VERSION)) or (m.defined_WIN32_or__WIN32 and m.defined___clang__ and m.defined___aarch64__)" XFAIL_REASON = "Known issues: https://github.com/pybind/pybind11/pull/4319" From 3b8d6874397d32eaa7a3cb94edcff215839f05e2 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Thu, 11 Dec 2025 08:44:20 -0600 Subject: [PATCH 05/15] Revert "unnamed namespace test on windows arm with clang and mingw" This reverts commit 08abf889ae4422b86d92302597423cdb4c7e7896. --- tests/test_unnamed_namespace_a.cpp | 6 ------ tests/test_unnamed_namespace_a.py | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/test_unnamed_namespace_a.cpp b/tests/test_unnamed_namespace_a.cpp index 1204ccdc82..26e9cb7515 100644 --- a/tests/test_unnamed_namespace_a.cpp +++ b/tests/test_unnamed_namespace_a.cpp @@ -33,11 +33,5 @@ TEST_SUBMODULE(unnamed_namespace_a, m) { true; #else false; -#endif - m.attr("defined___aarch64__") = -#if defined(__aarch64__) || defined(_M_ARM64) - true; -#else - false; #endif } diff --git a/tests/test_unnamed_namespace_a.py b/tests/test_unnamed_namespace_a.py index 18ce3a00df..fabf1312af 100644 --- a/tests/test_unnamed_namespace_a.py +++ b/tests/test_unnamed_namespace_a.py @@ -5,7 +5,7 @@ from pybind11_tests import unnamed_namespace_a as m from pybind11_tests import unnamed_namespace_b as mb -XFAIL_CONDITION = "(not m.defined_WIN32_or__WIN32 and (m.defined___clang__ or m.defined__LIBCPP_VERSION)) or (m.defined_WIN32_or__WIN32 and m.defined___clang__ and m.defined___aarch64__)" +XFAIL_CONDITION = "not m.defined_WIN32_or__WIN32 and (m.defined___clang__ or m.defined__LIBCPP_VERSION)" XFAIL_REASON = "Known issues: https://github.com/pybind/pybind11/pull/4319" From 6c37c48d5097952e77402b63219f71ec3e4fbbe7 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Thu, 11 Dec 2025 08:57:57 -0600 Subject: [PATCH 06/15] bumping c++ version --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1bd4f7f60..53abe82bd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1250,7 +1250,7 @@ jobs: -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_COMPILER=clang++ - -DCMAKE_CXX_STANDARD=17 + -DCMAKE_CXX_STANDARD=20 -DPython_ROOT_DIR="$env:Python_ROOT_DIR" shell: pwsh @@ -1317,7 +1317,7 @@ jobs: -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_COMPILER=clang++ - -DCMAKE_CXX_STANDARD=17 + -DCMAKE_CXX_STANDARD=20 -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") - name: Build From dc75243963f96295c2ce9e2a5180cd6ac384a4ed Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Thu, 11 Dec 2025 09:12:18 -0600 Subject: [PATCH 07/15] commenting out other tests --- .github/workflows/ci.yml | 2322 +++++++++++++++++++------------------- 1 file changed, 1161 insertions(+), 1161 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53abe82bd9..29b4eac43c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,1185 +30,1185 @@ jobs: # This is the "main" test suite, which tests a large number of different # versions of default compilers and Python versions in GitHub Actions. # It is in two parts: one that always runs, and one that runs on non-draft - standard-small: - if: github.event.action != 'ready_for_review' - strategy: - fail-fast: false - matrix: - include: - - runs-on: ubuntu-22.04 - python-version: '3.8' - cmake-args: -DPYBIND11_FINDPYTHON=OFF -DPYBIND11_NUMPY_1_ONLY=ON - - runs-on: ubuntu-latest - python-version: '3.13' - cmake-args: -DCMAKE_CXX_STANDARD=23 -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON - - runs-on: ubuntu-latest - python-version: '3.14t' - cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON - - runs-on: ubuntu-latest - python-version: 'pypy3.11' - cmake-args: -DCMAKE_CXX_STANDARD=17 - - runs-on: ubuntu-latest - python-version: 'graalpy-24.2' - cmake-args: -DCMAKE_CXX_STANDARD=20 - - runs-on: macos-latest - python-version: '3.14' - cmake-args: -DCMAKE_CXX_STANDARD=14 - - runs-on: windows-2022 - python-version: '3.8' - cmake-args: -DPYBIND11_FINDPYTHON=OFF - - runs-on: windows-11-arm - python-version: '3.11' - cmake-args: -DCMAKE_CXX_STANDARD=17 - - - name: 🐍 - uses: ./.github/workflows/reusable-standard.yml - with: - runs-on: ${{ matrix.runs-on }} - python-version: ${{ matrix.python-version }} - cmake-args: ${{ matrix.cmake-args }} - - standard-large: - if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - include: - - runs-on: ubuntu-latest - python-version: '3.8' - cmake-args: -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_STANDARD=17 - - runs-on: ubuntu-latest - python-version: '3.10' - cmake-args: -DCMAKE_CXX_STANDARD=20 - - runs-on: ubuntu-latest - python-version: '3.11' - cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_STANDARD=17 - - runs-on: ubuntu-latest - python-version: '3.12' - cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON - - runs-on: ubuntu-latest - python-version: '3.13t' - 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" - - runs-on: ubuntu-latest - python-version: 'pypy-3.10' - cmake-args: -DCMAKE_CXX_STANDARD=14 - - runs-on: ubuntu-latest - python-version: 'graalpy-24.1' - - # No SciPy for macOS ARM - - runs-on: macos-15-intel - python-version: '3.8' - cmake-args: -DCMAKE_CXX_STANDARD=14 - - runs-on: macos-15-intel - python-version: '3.11' - cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON - - runs-on: macos-latest - python-version: '3.12' - cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON - - runs-on: macos-15-intel - python-version: '3.13t' - cmake-args: -DCMAKE_CXX_STANDARD=11 - - runs-on: macos-latest - python-version: '3.14t' - cmake-args: -DCMAKE_CXX_STANDARD=20 - - runs-on: macos-15-intel - python-version: 'pypy-3.10' - cmake-args: -DCMAKE_CXX_STANDARD=17 - - runs-on: macos-latest - python-version: 'pypy-3.11' - - runs-on: macos-latest - python-version: 'graalpy-24.2' - - - runs-on: windows-latest - python-version: '3.9' - cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON - - runs-on: windows-2022 - python-version: '3.8' - cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPYBIND11_NUMPY_1_ONLY=ON - - runs-on: windows-2022 - python-version: '3.9' - cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_CXX_STANDARD=14 - # This needs a python built with MTd - # - runs-on: windows-2022 - # python-version: '3.11' - # cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug - - runs-on: windows-2022 - python-version: '3.10' - cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_FLAGS="/GR /EHsc" - - runs-on: windows-2022 - python-version: '3.13' - cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL - - runs-on: windows-latest - python-version: '3.13t' - cmake-args: -DCMAKE_CXX_STANDARD=17 - - runs-on: windows-latest - python-version: '3.14' - cmake-args: -DCMAKE_CXX_STANDARD=20 - - runs-on: windows-latest - python-version: '3.14t' - cmake-args: -DCMAKE_CXX_STANDARD=23 - - runs-on: windows-latest - python-version: 'pypy-3.10' - cmake-args: -DCMAKE_CXX_STANDARD=17 - - runs-on: windows-latest - python-version: 'pypy3.11' - cmake-args: -DCMAKE_CXX_STANDARD=20 - # The setup-python action currently doesn't have graalpy for windows - # See https://github.com/actions/setup-python/pull/880 - - name: 🐍 - uses: ./.github/workflows/reusable-standard.yml - with: - runs-on: ${{ matrix.runs-on }} - python-version: ${{ matrix.python-version }} - cmake-args: ${{ matrix.cmake-args }} - - # This checks inplace builds with C++11 - inplace: - if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - include: - - runs-on: ubuntu-latest - python-version: '3.9' - - runs-on: macos-latest - python-version: '3.12' - - runs-on: windows-latest - python-version: '3.11' - - name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++14" - runs-on: ${{ matrix.runs-on }} - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - - name: Prepare env - run: uv pip install --python=python --system -r tests/requirements.txt - - # TODO Resolve Windows Ninja shared object issue on Python 3.8+ - - name: Use Ninja except on Windows - if: runner.os != 'Windows' - run: echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV" - - # More-or-less randomly adding a few extra flags here. - # In particular, use this one to test the next ABI bump (internals version). - - name: Configure - run: > - cmake -S. -B. - -DPYBIND11_WERROR=ON - -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON - -DPYBIND11_PYTEST_ARGS=-v - -DDOWNLOAD_CATCH=ON - -DDOWNLOAD_EIGEN=ON - -DCMAKE_CXX_STANDARD=14 - -DPYBIND11_INTERNALS_VERSION=10000000 - - # Checks to makes sure defining `_` is allowed - # Triggers EHsc missing error on Windows - - name: Add underscore check - if: runner.os != 'Windows' - run: cmake -S. -B. -DCMAKE_CXX_FLAGS="-D_=1" - - - name: Build - run: cmake --build . - - - name: Python tests - run: cmake --build . --target pytest - - - name: Compiled tests - run: cmake --build . --target cpptest - - - name: Interface test - run: cmake --build . --target test_cmake_build - - - name: Visibility test - run: cmake --build . --target test_cross_module_rtti - - - manylinux: - name: Manylinux on 🐍 3.13t • GIL - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - timeout-minutes: 40 - container: quay.io/pypa/musllinux_1_2_x86_64:latest - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Prepare uv's path - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Install ninja - run: uv tool install ninja - - - name: Configure via preset - run: cmake --preset venv -DPYBIND11_CREATE_WITH_UV=python3.13t - - - name: Build C++11 - run: cmake --build --preset venv - - - name: Python tests C++11 - run: cmake --build --preset testsvenv -t pytest - - deadsnakes: - if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - include: - # TODO: Fails on 3.10, investigate - # JOB DISABLED (NEEDS WORK): https://github.com/pybind/pybind11/issues/4889 - # - python-version: "3.9" - # python-debug: true - # valgrind: true - - python-version: "3.11" - python-debug: false - - name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64" - runs-on: ubuntu-latest - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - - name: Setup Python ${{ matrix.python-version }} (deadsnakes) - uses: deadsnakes/action@v3.2.0 - with: - python-version: ${{ matrix.python-version }} - debug: ${{ matrix.python-debug }} - - - name: Update CMake - uses: jwlawson/actions-setup-cmake@v2.0 - - - name: Valgrind cache - if: matrix.valgrind - uses: actions/cache@v4 - id: cache-valgrind - with: - path: valgrind - key: 3.16.1 # Valgrind version - - - name: Compile Valgrind - if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true' - run: | - VALGRIND_VERSION=3.16.1 - curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj - mv valgrind-$VALGRIND_VERSION valgrind - cd valgrind - ./configure - make -j 2 > /dev/null - - - name: Install Valgrind - if: matrix.valgrind - working-directory: valgrind - run: | - sudo make install - sudo apt-get update - sudo apt-get install ninja-build libc6-dbg - - - name: Prepare env - run: | - python -m pip install -r tests/requirements.txt - - - name: Configure - run: cmake --preset default -DCMAKE_CXX_STANDARD=17 - - - name: Build - run: cmake --build --preset default - - - name: Python tests - run: cmake --build --preset default --target pytest - - - name: C++ tests - run: cmake --build --preset default --target cpptest - - - name: Visibility test - run: cmake --build --preset default --target test_cross_module_rtti - - - name: Run Valgrind on Python tests - if: matrix.valgrind - run: cmake --build --preset default --target memcheck - - - # Testing on clang using the excellent silkeh clang docker images - clang: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - clang: 5 - std: 14 - - clang: 11 - std: 20 - - clang: 14 - std: 20 - - clang: 16 - std: 20 - container_suffix: "-bullseye" - - clang: 18 - std: 20 - cxx_flags: "-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" - container_suffix: "-bookworm" - - name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" - container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}" - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - - name: Add wget and python3 - run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev - - - name: Configure - shell: bash - run: > - cmake -S . -B build - -DPYBIND11_WERROR=ON - -DDOWNLOAD_CATCH=ON - -DCMAKE_CXX_STANDARD=${{ matrix.std }} - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - - - name: Build - run: cmake --build build -j 2 - - - name: Python tests - run: cmake --build build --target pytest - - - name: C++ tests - run: cmake --build build --target cpptest - - - name: Interface test - run: cmake --build build --target test_cmake_build - - - name: Visibility test - run: cmake --build build --target test_cross_module_rtti - - # Testing NVCC; forces sources to behave like .cu files - cuda: - runs-on: ubuntu-latest - name: "🐍 3.10 • CUDA 12.2 • Ubuntu 22.04" - container: nvidia/cuda:12.2.0-devel-ubuntu22.04 - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND - - name: Install 🐍 3 - run: apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake git python3-dev python3-pytest python3-numpy - - - name: Configure - run: cmake -S . -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON - - - name: Build - run: cmake --build build -j2 --verbose +# standard-small: +# if: github.event.action != 'ready_for_review' +# strategy: +# fail-fast: false +# matrix: +# include: +# - runs-on: ubuntu-22.04 +# python-version: '3.8' +# cmake-args: -DPYBIND11_FINDPYTHON=OFF -DPYBIND11_NUMPY_1_ONLY=ON +# - runs-on: ubuntu-latest +# python-version: '3.13' +# cmake-args: -DCMAKE_CXX_STANDARD=23 -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON +# - runs-on: ubuntu-latest +# python-version: '3.14t' +# cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON +# - runs-on: ubuntu-latest +# python-version: 'pypy3.11' +# cmake-args: -DCMAKE_CXX_STANDARD=17 +# - runs-on: ubuntu-latest +# python-version: 'graalpy-24.2' +# cmake-args: -DCMAKE_CXX_STANDARD=20 +# - runs-on: macos-latest +# python-version: '3.14' +# cmake-args: -DCMAKE_CXX_STANDARD=14 +# - runs-on: windows-2022 +# python-version: '3.8' +# cmake-args: -DPYBIND11_FINDPYTHON=OFF +# - runs-on: windows-11-arm +# python-version: '3.11' +# cmake-args: -DCMAKE_CXX_STANDARD=17 + + +# name: 🐍 +# uses: ./.github/workflows/reusable-standard.yml +# with: +# runs-on: ${{ matrix.runs-on }} +# python-version: ${{ matrix.python-version }} +# cmake-args: ${{ matrix.cmake-args }} + +# standard-large: +# if: github.event.pull_request.draft == false +# strategy: +# fail-fast: false +# matrix: +# include: +# - runs-on: ubuntu-latest +# python-version: '3.8' +# cmake-args: -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_STANDARD=17 +# - runs-on: ubuntu-latest +# python-version: '3.10' +# cmake-args: -DCMAKE_CXX_STANDARD=20 +# - runs-on: ubuntu-latest +# python-version: '3.11' +# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_STANDARD=17 +# - runs-on: ubuntu-latest +# python-version: '3.12' +# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON +# - runs-on: ubuntu-latest +# python-version: '3.13t' +# 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" +# - runs-on: ubuntu-latest +# python-version: 'pypy-3.10' +# cmake-args: -DCMAKE_CXX_STANDARD=14 +# - runs-on: ubuntu-latest +# python-version: 'graalpy-24.1' + +# # No SciPy for macOS ARM +# - runs-on: macos-15-intel +# python-version: '3.8' +# cmake-args: -DCMAKE_CXX_STANDARD=14 +# - runs-on: macos-15-intel +# python-version: '3.11' +# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON +# - runs-on: macos-latest +# python-version: '3.12' +# cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON +# - runs-on: macos-15-intel +# python-version: '3.13t' +# cmake-args: -DCMAKE_CXX_STANDARD=11 +# - runs-on: macos-latest +# python-version: '3.14t' +# cmake-args: -DCMAKE_CXX_STANDARD=20 +# - runs-on: macos-15-intel +# python-version: 'pypy-3.10' +# cmake-args: -DCMAKE_CXX_STANDARD=17 +# - runs-on: macos-latest +# python-version: 'pypy-3.11' +# - runs-on: macos-latest +# python-version: 'graalpy-24.2' + +# - runs-on: windows-latest +# python-version: '3.9' +# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON +# - runs-on: windows-2022 +# python-version: '3.8' +# cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPYBIND11_NUMPY_1_ONLY=ON +# - runs-on: windows-2022 +# python-version: '3.9' +# cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_CXX_STANDARD=14 +# # This needs a python built with MTd +# # - runs-on: windows-2022 +# # python-version: '3.11' +# # cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug +# - runs-on: windows-2022 +# python-version: '3.10' +# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_FLAGS="/GR /EHsc" +# - runs-on: windows-2022 +# python-version: '3.13' +# cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL +# - runs-on: windows-latest +# python-version: '3.13t' +# cmake-args: -DCMAKE_CXX_STANDARD=17 +# - runs-on: windows-latest +# python-version: '3.14' +# cmake-args: -DCMAKE_CXX_STANDARD=20 +# - runs-on: windows-latest +# python-version: '3.14t' +# cmake-args: -DCMAKE_CXX_STANDARD=23 +# - runs-on: windows-latest +# python-version: 'pypy-3.10' +# cmake-args: -DCMAKE_CXX_STANDARD=17 +# - runs-on: windows-latest +# python-version: 'pypy3.11' +# cmake-args: -DCMAKE_CXX_STANDARD=20 +# # The setup-python action currently doesn't have graalpy for windows +# # See https://github.com/actions/setup-python/pull/880 + +# name: 🐍 +# uses: ./.github/workflows/reusable-standard.yml +# with: +# runs-on: ${{ matrix.runs-on }} +# python-version: ${{ matrix.python-version }} +# cmake-args: ${{ matrix.cmake-args }} + +# # This checks inplace builds with C++11 +# inplace: +# if: github.event.pull_request.draft == false +# strategy: +# fail-fast: false +# matrix: +# include: +# - runs-on: ubuntu-latest +# python-version: '3.9' +# - runs-on: macos-latest +# python-version: '3.12' +# - runs-on: windows-latest +# python-version: '3.11' + +# name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++14" +# runs-on: ${{ matrix.runs-on }} +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# - name: Setup Python ${{ matrix.python-version }} +# uses: actions/setup-python@v6 +# with: +# python-version: ${{ matrix.python-version }} +# allow-prereleases: true + +# - name: Install uv +# uses: astral-sh/setup-uv@v7 +# with: +# enable-cache: true + +# - name: Prepare env +# run: uv pip install --python=python --system -r tests/requirements.txt + +# # TODO Resolve Windows Ninja shared object issue on Python 3.8+ +# - name: Use Ninja except on Windows +# if: runner.os != 'Windows' +# run: echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV" + +# # More-or-less randomly adding a few extra flags here. +# # In particular, use this one to test the next ABI bump (internals version). +# - name: Configure +# run: > +# cmake -S. -B. +# -DPYBIND11_WERROR=ON +# -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON +# -DPYBIND11_PYTEST_ARGS=-v +# -DDOWNLOAD_CATCH=ON +# -DDOWNLOAD_EIGEN=ON +# -DCMAKE_CXX_STANDARD=14 +# -DPYBIND11_INTERNALS_VERSION=10000000 + +# # Checks to makes sure defining `_` is allowed +# # Triggers EHsc missing error on Windows +# - name: Add underscore check +# if: runner.os != 'Windows' +# run: cmake -S. -B. -DCMAKE_CXX_FLAGS="-D_=1" + +# - name: Build +# run: cmake --build . + +# - name: Python tests +# run: cmake --build . --target pytest + +# - name: Compiled tests +# run: cmake --build . --target cpptest + +# - name: Interface test +# run: cmake --build . --target test_cmake_build + +# - name: Visibility test +# run: cmake --build . --target test_cross_module_rtti + + +# manylinux: +# name: Manylinux on 🐍 3.13t • GIL +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# timeout-minutes: 40 +# container: quay.io/pypa/musllinux_1_2_x86_64:latest +# steps: +# - uses: actions/checkout@v6 +# with: +# fetch-depth: 0 + +# - name: Prepare uv's path +# run: echo "$HOME/.local/bin" >> $GITHUB_PATH + +# - name: Install ninja +# run: uv tool install ninja + +# - name: Configure via preset +# run: cmake --preset venv -DPYBIND11_CREATE_WITH_UV=python3.13t + +# - name: Build C++11 +# run: cmake --build --preset venv + +# - name: Python tests C++11 +# run: cmake --build --preset testsvenv -t pytest + +# deadsnakes: +# if: github.event.pull_request.draft == false +# strategy: +# fail-fast: false +# matrix: +# include: +# # TODO: Fails on 3.10, investigate +# # JOB DISABLED (NEEDS WORK): https://github.com/pybind/pybind11/issues/4889 +# # - python-version: "3.9" +# # python-debug: true +# # valgrind: true +# - python-version: "3.11" +# python-debug: false + +# name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64" +# runs-on: ubuntu-latest +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# - name: Setup Python ${{ matrix.python-version }} (deadsnakes) +# uses: deadsnakes/action@v3.2.0 +# with: +# python-version: ${{ matrix.python-version }} +# debug: ${{ matrix.python-debug }} + +# - name: Update CMake +# uses: jwlawson/actions-setup-cmake@v2.0 + +# - name: Valgrind cache +# if: matrix.valgrind +# uses: actions/cache@v4 +# id: cache-valgrind +# with: +# path: valgrind +# key: 3.16.1 # Valgrind version + +# - name: Compile Valgrind +# if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true' +# run: | +# VALGRIND_VERSION=3.16.1 +# curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj +# mv valgrind-$VALGRIND_VERSION valgrind +# cd valgrind +# ./configure +# make -j 2 > /dev/null + +# - name: Install Valgrind +# if: matrix.valgrind +# working-directory: valgrind +# run: | +# sudo make install +# sudo apt-get update +# sudo apt-get install ninja-build libc6-dbg + +# - name: Prepare env +# run: | +# python -m pip install -r tests/requirements.txt + +# - name: Configure +# run: cmake --preset default -DCMAKE_CXX_STANDARD=17 + +# - name: Build +# run: cmake --build --preset default + +# - name: Python tests +# run: cmake --build --preset default --target pytest + +# - name: C++ tests +# run: cmake --build --preset default --target cpptest + +# - name: Visibility test +# run: cmake --build --preset default --target test_cross_module_rtti + +# - name: Run Valgrind on Python tests +# if: matrix.valgrind +# run: cmake --build --preset default --target memcheck + + +# # Testing on clang using the excellent silkeh clang docker images +# clang: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# include: +# - clang: 5 +# std: 14 +# - clang: 11 +# std: 20 +# - clang: 14 +# std: 20 +# - clang: 16 +# std: 20 +# container_suffix: "-bullseye" +# - clang: 18 +# std: 20 +# cxx_flags: "-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" +# container_suffix: "-bookworm" + +# name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" +# container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}" +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# - name: Add wget and python3 +# run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev + +# - name: Configure +# shell: bash +# run: > +# cmake -S . -B build +# -DPYBIND11_WERROR=ON +# -DDOWNLOAD_CATCH=ON +# -DCMAKE_CXX_STANDARD=${{ matrix.std }} +# -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + +# - name: Build +# run: cmake --build build -j 2 + +# - name: Python tests +# run: cmake --build build --target pytest + +# - name: C++ tests +# run: cmake --build build --target cpptest + +# - name: Interface test +# run: cmake --build build --target test_cmake_build + +# - name: Visibility test +# run: cmake --build build --target test_cross_module_rtti + +# # Testing NVCC; forces sources to behave like .cu files +# cuda: +# runs-on: ubuntu-latest +# name: "🐍 3.10 • CUDA 12.2 • Ubuntu 22.04" +# container: nvidia/cuda:12.2.0-devel-ubuntu22.04 +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND +# - name: Install 🐍 3 +# run: apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake git python3-dev python3-pytest python3-numpy + +# - name: Configure +# run: cmake -S . -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON + +# - name: Build +# run: cmake --build build -j2 --verbose + +# - name: Python tests +# run: cmake --build build --target pytest + + +# # TODO: Internal compiler error - report to NVidia +# # # Testing CentOS 8 + PGI compilers +# # centos-nvhpc8: +# # runs-on: ubuntu-latest +# # name: "🐍 3 • CentOS8 / PGI 20.11 • x64" +# # container: centos:8 +# # +# # steps: +# # - uses: actions/checkout@v6 +# # +# # - name: Add Python 3 and a few requirements +# # run: yum update -y && yum install -y git python3-devel python3-numpy python3-pytest make environment-modules +# # +# # - name: Install CMake with pip +# # run: | +# # python3 -m pip install --upgrade pip +# # python3 -m pip install cmake --prefer-binary +# # +# # - name: Install NVidia HPC SDK +# # run: > +# # yum -y install +# # https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-20-11-20.11-1.x86_64.rpm +# # https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-2020-20.11-1.x86_64.rpm +# # +# # - name: Configure +# # shell: bash +# # run: | +# # source /etc/profile.d/modules.sh +# # module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/20.11 +# # cmake -S . -B build -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=14 -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") +# # +# # - name: Build +# # run: cmake --build build -j 2 --verbose +# # +# # - name: Python tests +# # run: cmake --build build --target pytest +# # +# # - name: C++ tests +# # run: cmake --build build --target cpptest +# # +# # - name: Interface test +# # run: cmake --build build --target test_cmake_build + + +# # Testing on Ubuntu + NVHPC (previous PGI) compilers, which seems to require more workarounds +# ubuntu-nvhpc7: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-22.04 +# name: "🐍 3 • NVHPC 23.5 • C++17 • x64" +# timeout-minutes: 90 + +# env: +# # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND +# DEBIAN_FRONTEND: 'noninteractive' +# steps: +# - uses: actions/checkout@v6 + +# - name: Add NVHPC Repo +# run: | +# echo 'deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | \ +# sudo tee /etc/apt/sources.list.d/nvhpc.list + +# - 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 rm -rf /var/lib/apt/lists/* +# python3 -m pip install --upgrade pip +# python3 -m pip install --upgrade pytest + +# # On some systems, you many need further workarounds: +# # https://github.com/pybind/pybind11/pull/2475 +# - name: Configure +# shell: bash +# run: | +# source /etc/profile.d/modules.sh +# module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.5 +# cmake -S . -B build -DDOWNLOAD_CATCH=ON \ +# -DCMAKE_CXX_STANDARD=17 \ +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \ +# -DCMAKE_CXX_FLAGS="-Wc,--pending_instantiations=0" \ +# -DPYBIND11_TEST_FILTER="test_smart_ptr.cpp" + +# - name: Build +# run: cmake --build build -j 2 --verbose + +# - name: Python tests +# run: cmake --build build --target pytest + +# - name: C++ tests +# run: cmake --build build --target cpptest + +# - name: Interface test +# run: cmake --build build --target test_cmake_build + +# - name: Visibility test +# run: cmake --build build --target test_cross_module_rtti + +# # Testing on GCC using the GCC docker images (only recent images supported) +# gcc: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# include: +# - { gcc: 9, std: 20 } +# - { gcc: 10, std: 17 } +# - { gcc: 10, std: 20 } +# - { gcc: 13, std: 20, cxx_flags: "-Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" } + +# name: "🐍 3 • GCC ${{ matrix.gcc }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" +# container: "gcc:${{ matrix.gcc }}" +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# - name: Add Python 3 +# run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev + +# - name: Update pip +# run: python3 -m pip install --upgrade pip + +# - name: Update CMake +# uses: jwlawson/actions-setup-cmake@v2.0 + +# - name: Configure +# shell: bash +# run: > +# cmake -S . -B build +# -DPYBIND11_WERROR=ON +# -DDOWNLOAD_CATCH=ON +# -DCMAKE_CXX_STANDARD=${{ matrix.std }} +# -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + +# - name: Build +# run: cmake --build build -j 2 + +# - name: Python tests +# run: cmake --build build --target pytest + +# - name: C++ tests +# run: cmake --build build --target cpptest + +# - name: Interface test +# run: cmake --build build --target test_cmake_build + +# - name: Visibility test +# run: cmake --build build --target test_cross_module_rtti + +# - name: Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE +# if: matrix.gcc == '12' +# shell: bash +# run: > +# cmake -S . -B build_partial +# -DPYBIND11_WERROR=ON +# -DDOWNLOAD_CATCH=ON +# -DCMAKE_CXX_STANDARD=${{ matrix.std }} +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") +# "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" + +# - name: Build - Exercise cmake -DPYBIND11_TEST_OVERRIDE +# if: matrix.gcc == '12' +# run: cmake --build build_partial -j 2 + +# - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE +# if: matrix.gcc == '12' +# run: cmake --build build_partial --target pytest + +# # Testing on ICC using the oneAPI apt repo +# icc: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-22.04 +# timeout-minutes: 90 + +# name: "🐍 3 • ICC latest • x64" + +# steps: +# - uses: actions/checkout@v6 + +# - name: Add apt repo +# run: | +# sudo apt-get update +# sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg +# wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB +# sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB +# echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + +# - name: Add ICC & Python 3 +# run: sudo apt-get update; sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic cmake python3-dev python3-numpy python3-pytest python3-pip + +# - name: Update pip +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# python3 -m pip install --upgrade pip + +# - name: Install dependencies +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# python3 -m pip install -r tests/requirements.txt + +# - name: Configure C++11 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake -S . -B build-11 \ +# -DPYBIND11_WERROR=ON \ +# -DDOWNLOAD_CATCH=ON \ +# -DDOWNLOAD_EIGEN=OFF \ +# -DCMAKE_CXX_STANDARD=11 \ +# -DCMAKE_CXX_COMPILER=$(which icpc) \ +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + +# - name: Build C++11 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake --build build-11 -j 2 -v + +# - name: Python tests C++11 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# sudo service apport stop +# cmake --build build-11 --target check + +# - name: C++ tests C++11 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake --build build-11 --target cpptest + +# - name: Interface test C++11 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake --build build-11 --target test_cmake_build + +# - name: Visibility test +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake --build build-11 --target test_cross_module_rtti + +# - name: Configure C++17 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake -S . -B build-17 \ +# -DPYBIND11_WERROR=ON \ +# -DDOWNLOAD_CATCH=ON \ +# -DDOWNLOAD_EIGEN=OFF \ +# -DCMAKE_CXX_STANDARD=17 \ +# -DCMAKE_CXX_COMPILER=$(which icpc) \ +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + +# - name: Build C++17 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake --build build-17 -j 2 -v + +# - name: Python tests C++17 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# sudo service apport stop +# cmake --build build-17 --target check + +# - name: C++ tests C++17 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake --build build-17 --target cpptest + +# - name: Interface test C++17 +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake --build build-17 --target test_cmake_build + +# - name: Visibility test +# run: | +# set +e; source /opt/intel/oneapi/setvars.sh; set -e +# cmake --build build-17 --target test_cross_module_rtti + +# # Testing on CentOS (manylinux uses a centos base). +# centos: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# container: +# - "almalinux:8" +# - "almalinux:9" + +# name: "🐍 3 • ${{ matrix.container }} • x64" +# container: "${{ matrix.container }}" +# timeout-minutes: 90 + +# steps: +# - name: Latest actions/checkout +# uses: actions/checkout@v6 + +# - name: Add Python 3.8 +# if: matrix.container == 'almalinux:8' +# run: dnf update -y && dnf install -y python38-devel gcc-c++ make git + +# - name: Add Python 3 (default) +# if: matrix.container != 'almalinux:8' +# run: dnf update -y && dnf install -y python3-devel gcc-c++ make git + +# - name: Update pip +# run: python3 -m pip install --upgrade pip + +# - name: Install dependencies +# run: | +# python3 -m pip install cmake -r tests/requirements.txt + +# - name: Ensure NumPy 2 is used (required Python >= 3.9) +# if: matrix.container == 'almalinux:9' +# run: | +# python3 -m pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1' + +# - name: Configure +# shell: bash +# run: > +# cmake -S . -B build +# -DCMAKE_BUILD_TYPE=MinSizeRel +# -DPYBIND11_WERROR=ON +# -DDOWNLOAD_CATCH=ON +# -DDOWNLOAD_EIGEN=ON +# -DCMAKE_CXX_STANDARD=11 +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + +# - name: Build +# run: cmake --build build -j 2 + +# - name: Python tests +# run: cmake --build build --target pytest + +# - name: C++ tests +# run: cmake --build build --target cpptest + +# - name: Interface test +# run: cmake --build build --target test_cmake_build + +# - name: Visibility test +# run: cmake --build build --target test_cross_module_rtti + + +# # This tests an "install" with the CMake tools +# install-classic: +# if: github.event.pull_request.draft == false +# name: "🐍 3.9 • Debian • x86 • Install" +# runs-on: ubuntu-latest +# container: i386/debian:bullseye +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v1 # v1 is required to run inside docker + +# - name: Install requirements +# run: | +# apt-get update +# apt-get install -y git make cmake g++ libeigen3-dev python3-dev python3-pip +# pip3 install "pytest==6.*" + +# - name: Configure for install +# run: > +# cmake . +# -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + +# - name: Make and install +# run: make install + +# - name: Copy tests to new directory +# run: cp -a tests /pybind11-tests + +# - name: Make a new test directory +# run: mkdir /build-tests + +# - name: Configure tests +# run: > +# cmake ../pybind11-tests +# -DDOWNLOAD_CATCH=ON +# -DPYBIND11_WERROR=ON +# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") +# working-directory: /build-tests + +# - name: Python tests +# run: make pytest -j 2 +# working-directory: /build-tests + + +# # This verifies that the documentation is not horribly broken, and does a +# # basic validation check on the SDist. +# doxygen: +# if: github.event.pull_request.draft == false +# name: "Documentation build test" +# runs-on: ubuntu-latest +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# - uses: actions/setup-python@v6 +# with: +# python-version: "3.x" + +# - name: Install Doxygen +# run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04 + +# - name: Build docs +# run: pipx run nox -s docs + +# - name: Make SDist +# run: pipx run nox -s build -- --sdist + +# - run: git status --ignored + +# - name: Check local include dir +# run: > +# ls pybind11; +# python3 -c "import pybind11, pathlib; assert (a := pybind11.get_include()) == (b := str(pathlib.Path('include').resolve())), f'{a} != {b}'" + +# - name: Compare Dists (headers only) +# working-directory: include +# run: | +# python3 -m pip install --user -U ../dist/*.tar.gz +# installed=$(python3 -c "import pybind11; print(pybind11.get_include() + '/pybind11')") +# diff -rq $installed ./pybind11 + +# win32: +# if: github.event.pull_request.draft == false +# strategy: +# fail-fast: false +# matrix: +# include: +# - python: '3.8' +# args: -DCMAKE_CXX_STANDARD=17 +# - python: '3.10' +# args: -DCMAKE_CXX_STANDARD=20 +# - python: '3.13' + + +# name: "🐍 ${{ matrix.python }} • MSVC 2022 • x86 ${{ matrix.args }}" +# runs-on: windows-2022 +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# - name: Setup Python ${{ matrix.python }} +# uses: actions/setup-python@v6 +# with: +# python-version: ${{ matrix.python }} +# architecture: x86 +# # Python 3.13.4 broken on Windows +# check-latest: >- +# ${{ matrix.python == '3.13' && runner.os == 'Windows' }} + +# - name: Update CMake +# uses: jwlawson/actions-setup-cmake@v2.0 + +# - name: Prepare MSVC +# uses: ilammy/msvc-dev-cmd@v1.13.0 +# with: +# arch: x86 + +# - name: Prepare env +# run: | +# python -m pip install -r tests/requirements.txt + +# - name: Configure ${{ matrix.args }} +# run: > +# cmake -S . -B build +# -G "Visual Studio 17 2022" -A Win32 +# -DPYBIND11_WERROR=ON +# -DDOWNLOAD_CATCH=ON +# -DDOWNLOAD_EIGEN=ON +# ${{ matrix.args }} +# - name: Build C++11 +# run: cmake --build build -j 2 + +# - name: Python tests +# run: cmake --build build -t pytest + +# win32-debug: +# if: github.event.pull_request.draft == false +# strategy: +# fail-fast: false +# matrix: +# include: +# - python: 3.9 +# args: -DCMAKE_CXX_STANDARD=20 +# - python: 3.8 +# args: -DCMAKE_CXX_STANDARD=17 + +# name: "🐍 ${{ matrix.python }} • MSVC 2022 (Debug) • x86 ${{ matrix.args }}" +# runs-on: windows-2022 +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# - name: Setup Python ${{ matrix.python }} +# uses: actions/setup-python@v6 +# with: +# python-version: ${{ matrix.python }} +# architecture: x86 + +# - name: Update CMake +# uses: jwlawson/actions-setup-cmake@v2.0 + +# - name: Prepare MSVC +# uses: ilammy/msvc-dev-cmd@v1.13.0 +# with: +# arch: x86 + +# - name: Prepare env +# run: | +# python -m pip install -r tests/requirements.txt + +# - name: Configure ${{ matrix.args }} +# run: > +# cmake -S . -B build +# -G "Visual Studio 17 2022" -A Win32 +# -DCMAKE_BUILD_TYPE=Debug +# -DPYBIND11_WERROR=ON +# -DDOWNLOAD_CATCH=ON +# -DDOWNLOAD_EIGEN=ON +# ${{ matrix.args }} +# - name: Build C++11 +# run: cmake --build build --config Debug -j 2 + +# - name: Python tests +# run: cmake --build build --config Debug -t pytest + + +# windows-2022: +# if: github.event.pull_request.draft == false +# strategy: +# fail-fast: false +# matrix: +# python: +# - 3.9 + +# name: "🐍 ${{ matrix.python }} • MSVC 2022 C++20 • x64" +# runs-on: windows-2022 +# timeout-minutes: 90 + +# steps: +# - uses: actions/checkout@v6 + +# - name: Setup Python ${{ matrix.python }} +# uses: actions/setup-python@v6 +# with: +# python-version: ${{ matrix.python }} + +# - name: Prepare env +# run: python3 -m pip install -r tests/requirements.txt + +# - name: Update CMake +# uses: jwlawson/actions-setup-cmake@v2.0 + +# - name: Configure C++20 +# run: > +# cmake -S . -B build +# -DPYBIND11_WERROR=ON +# -DDOWNLOAD_CATCH=ON +# -DDOWNLOAD_EIGEN=ON +# -DCMAKE_CXX_STANDARD=20 + +# - name: Build C++20 +# run: cmake --build build -j 2 + +# - name: Python tests +# run: cmake --build build --target pytest + +# - name: C++20 tests +# run: cmake --build build --target cpptest -j 2 + +# - name: Interface test C++20 +# run: cmake --build build --target test_cmake_build + +# - name: Visibility test +# run: cmake --build build --target test_cross_module_rtti + +# - name: Configure C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE +# run: > +# cmake -S . -B build_partial +# -DPYBIND11_WERROR=ON +# -DDOWNLOAD_CATCH=ON +# -DDOWNLOAD_EIGEN=ON +# -DCMAKE_CXX_STANDARD=20 +# "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" + +# - name: Build C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE +# run: cmake --build build_partial -j 2 + +# - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE +# run: cmake --build build_partial --target pytest + +# mingw: +# if: github.event.pull_request.draft == false +# name: "🐍 3 • windows-latest • ${{ matrix.sys }}" +# runs-on: windows-latest +# timeout-minutes: 90 +# defaults: +# run: +# shell: msys2 {0} +# strategy: +# fail-fast: false +# matrix: +# include: +# - sys: mingw32 +# env: i686 +# extra_install: "" +# - sys: mingw64 +# env: x86_64 +# extra_install: | +# mingw-w64-x86_64-python-numpy +# mingw-w64-x86_64-python-scipy +# mingw-w64-x86_64-eigen3 +# steps: +# - uses: msys2/setup-msys2@v2 +# with: +# msystem: ${{matrix.sys}} +# install: >- +# git +# mingw-w64-${{matrix.env}}-gcc +# mingw-w64-${{matrix.env}}-python-pip +# mingw-w64-${{matrix.env}}-cmake +# mingw-w64-${{matrix.env}}-make +# mingw-w64-${{matrix.env}}-python-pytest +# mingw-w64-${{matrix.env}}-boost +# mingw-w64-${{matrix.env}}-catch +# ${{ matrix.extra_install }} + +# - uses: actions/checkout@v6 + +# - name: Configure C++11 +# # LTO leads to many undefined reference like +# # `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&) +# run: >- +# cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON +# -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") +# -S . -B build + +# - name: Build C++11 +# run: cmake --build build -j 2 + +# - name: Python tests C++11 +# run: cmake --build build --target pytest -j 2 + +# - name: C++11 tests +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 2 + +# - name: Interface test C++11 +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cmake_build + +# - name: Visibility test +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cross_module_rtti + +# - name: Clean directory +# run: git clean -fdx + +# - name: Configure C++14 +# run: >- +# cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON +# -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") +# -S . -B build2 + +# - name: Build C++14 +# run: cmake --build build2 -j 2 + +# - name: Python tests C++14 +# run: cmake --build build2 --target pytest -j 2 + +# - name: C++14 tests +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target cpptest -j 2 + +# - name: Interface test C++14 +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cmake_build + +# - name: Visibility test +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cross_module_rtti + +# - name: Clean directory +# run: git clean -fdx + +# - name: Configure C++17 +# run: >- +# cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON +# -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") +# -S . -B build3 + +# - name: Build C++17 +# run: cmake --build build3 -j 2 + +# - name: Python tests C++17 +# run: cmake --build build3 --target pytest -j 2 + +# - name: C++17 tests +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target cpptest -j 2 + +# - name: Interface test C++17 +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cmake_build + +# - name: Visibility test +# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cross_module_rtti + +# windows_clang: +# if: github.event.pull_request.draft == false + +# strategy: +# matrix: +# os: [windows-latest] +# python: ['3.10'] - - name: Python tests - run: cmake --build build --target pytest - - -# TODO: Internal compiler error - report to NVidia -# # Testing CentOS 8 + PGI compilers -# centos-nvhpc8: -# runs-on: ubuntu-latest -# name: "🐍 3 • CentOS8 / PGI 20.11 • x64" -# container: centos:8 -# -# steps: -# - uses: actions/checkout@v6 -# -# - name: Add Python 3 and a few requirements -# run: yum update -y && yum install -y git python3-devel python3-numpy python3-pytest make environment-modules -# -# - name: Install CMake with pip -# run: | -# python3 -m pip install --upgrade pip -# python3 -m pip install cmake --prefer-binary -# -# - name: Install NVidia HPC SDK -# run: > -# yum -y install -# https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-20-11-20.11-1.x86_64.rpm -# https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-2020-20.11-1.x86_64.rpm -# -# - name: Configure -# shell: bash -# run: | -# source /etc/profile.d/modules.sh -# module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/20.11 -# cmake -S . -B build -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=14 -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") -# -# - name: Build -# run: cmake --build build -j 2 --verbose -# -# - name: Python tests -# run: cmake --build build --target pytest -# -# - name: C++ tests -# run: cmake --build build --target cpptest -# -# - name: Interface test -# run: cmake --build build --target test_cmake_build - - - # Testing on Ubuntu + NVHPC (previous PGI) compilers, which seems to require more workarounds - ubuntu-nvhpc7: - if: github.event.pull_request.draft == false - runs-on: ubuntu-22.04 - name: "🐍 3 • NVHPC 23.5 • C++17 • x64" - timeout-minutes: 90 - - env: - # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND - DEBIAN_FRONTEND: 'noninteractive' - steps: - - uses: actions/checkout@v6 - - - name: Add NVHPC Repo - run: | - echo 'deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | \ - sudo tee /etc/apt/sources.list.d/nvhpc.list - - - 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 rm -rf /var/lib/apt/lists/* - python3 -m pip install --upgrade pip - python3 -m pip install --upgrade pytest - - # On some systems, you many need further workarounds: - # https://github.com/pybind/pybind11/pull/2475 - - name: Configure - shell: bash - run: | - source /etc/profile.d/modules.sh - module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.5 - cmake -S . -B build -DDOWNLOAD_CATCH=ON \ - -DCMAKE_CXX_STANDARD=17 \ - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \ - -DCMAKE_CXX_FLAGS="-Wc,--pending_instantiations=0" \ - -DPYBIND11_TEST_FILTER="test_smart_ptr.cpp" - - - name: Build - run: cmake --build build -j 2 --verbose - - - name: Python tests - run: cmake --build build --target pytest - - - name: C++ tests - run: cmake --build build --target cpptest - - - name: Interface test - run: cmake --build build --target test_cmake_build - - - name: Visibility test - run: cmake --build build --target test_cross_module_rtti - - # Testing on GCC using the GCC docker images (only recent images supported) - gcc: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - { gcc: 9, std: 20 } - - { gcc: 10, std: 17 } - - { gcc: 10, std: 20 } - - { gcc: 13, std: 20, cxx_flags: "-Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" } - - name: "🐍 3 • GCC ${{ matrix.gcc }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" - container: "gcc:${{ matrix.gcc }}" - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - - name: Add Python 3 - run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev - - - name: Update pip - run: python3 -m pip install --upgrade pip - - - name: Update CMake - uses: jwlawson/actions-setup-cmake@v2.0 - - - name: Configure - shell: bash - run: > - cmake -S . -B build - -DPYBIND11_WERROR=ON - -DDOWNLOAD_CATCH=ON - -DCMAKE_CXX_STANDARD=${{ matrix.std }} - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - - - name: Build - run: cmake --build build -j 2 - - - name: Python tests - run: cmake --build build --target pytest - - - name: C++ tests - run: cmake --build build --target cpptest - - - name: Interface test - run: cmake --build build --target test_cmake_build - - - name: Visibility test - run: cmake --build build --target test_cross_module_rtti - - - name: Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE - if: matrix.gcc == '12' - shell: bash - run: > - cmake -S . -B build_partial - -DPYBIND11_WERROR=ON - -DDOWNLOAD_CATCH=ON - -DCMAKE_CXX_STANDARD=${{ matrix.std }} - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" - - - name: Build - Exercise cmake -DPYBIND11_TEST_OVERRIDE - if: matrix.gcc == '12' - run: cmake --build build_partial -j 2 - - - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE - if: matrix.gcc == '12' - run: cmake --build build_partial --target pytest - - # Testing on ICC using the oneAPI apt repo - icc: - if: github.event.pull_request.draft == false - runs-on: ubuntu-22.04 - timeout-minutes: 90 - - name: "🐍 3 • ICC latest • x64" - - steps: - - uses: actions/checkout@v6 - - - name: Add apt repo - run: | - sudo apt-get update - sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB - echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list +# runs-on: "${{ matrix.os }}" +# timeout-minutes: 90 - - name: Add ICC & Python 3 - run: sudo apt-get update; sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic cmake python3-dev python3-numpy python3-pytest python3-pip +# name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest" - - name: Update pip - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - python3 -m pip install --upgrade pip +# steps: +# - name: Show env +# run: env - - name: Install dependencies - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - python3 -m pip install -r tests/requirements.txt +# - name: Checkout +# uses: actions/checkout@v6 - - name: Configure C++11 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake -S . -B build-11 \ - -DPYBIND11_WERROR=ON \ - -DDOWNLOAD_CATCH=ON \ - -DDOWNLOAD_EIGEN=OFF \ - -DCMAKE_CXX_STANDARD=11 \ - -DCMAKE_CXX_COMPILER=$(which icpc) \ - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - - - name: Build C++11 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-11 -j 2 -v +# - name: Set up Clang +# uses: egor-tensin/setup-clang@v1 - - name: Python tests C++11 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - sudo service apport stop - cmake --build build-11 --target check +# - name: Setup Python ${{ matrix.python }} +# uses: actions/setup-python@v6 +# with: +# python-version: ${{ matrix.python }} - - name: C++ tests C++11 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-11 --target cpptest +# - name: Update CMake +# uses: jwlawson/actions-setup-cmake@v2.0 - - name: Interface test C++11 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-11 --target test_cmake_build +# - name: Install ninja-build tool +# uses: seanmiddleditch/gha-setup-ninja@v6 - - name: Visibility test - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-11 --target test_cross_module_rtti +# - name: Run pip installs +# run: | +# python -m pip install --upgrade pip +# python -m pip install -r tests/requirements.txt - - name: Configure C++17 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake -S . -B build-17 \ - -DPYBIND11_WERROR=ON \ - -DDOWNLOAD_CATCH=ON \ - -DDOWNLOAD_EIGEN=OFF \ - -DCMAKE_CXX_STANDARD=17 \ - -DCMAKE_CXX_COMPILER=$(which icpc) \ - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - - - name: Build C++17 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-17 -j 2 -v +# - name: Show Clang++ version +# run: clang++ --version - - name: Python tests C++17 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - sudo service apport stop - cmake --build build-17 --target check +# - name: Show CMake version +# run: cmake --version - - name: C++ tests C++17 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-17 --target cpptest +# # TODO: WERROR=ON +# - name: Configure Clang +# 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=17 - - name: Interface test C++17 - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-17 --target test_cmake_build +# - name: Build +# run: cmake --build . -j 2 - - name: Visibility test - run: | - set +e; source /opt/intel/oneapi/setvars.sh; set -e - cmake --build build-17 --target test_cross_module_rtti +# - name: Python tests +# run: cmake --build . --target pytest -j 2 - # Testing on CentOS (manylinux uses a centos base). - centos: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - container: - - "almalinux:8" - - "almalinux:9" +# - name: C++ tests +# run: cmake --build . --target cpptest -j 2 - name: "🐍 3 • ${{ matrix.container }} • x64" - container: "${{ matrix.container }}" - timeout-minutes: 90 +# - name: Interface test +# run: cmake --build . --target test_cmake_build -j 2 - steps: - - name: Latest actions/checkout - uses: actions/checkout@v6 - - - name: Add Python 3.8 - if: matrix.container == 'almalinux:8' - run: dnf update -y && dnf install -y python38-devel gcc-c++ make git - - - name: Add Python 3 (default) - if: matrix.container != 'almalinux:8' - run: dnf update -y && dnf install -y python3-devel gcc-c++ make git - - - name: Update pip - run: python3 -m pip install --upgrade pip - - - name: Install dependencies - run: | - python3 -m pip install cmake -r tests/requirements.txt - - - name: Ensure NumPy 2 is used (required Python >= 3.9) - if: matrix.container == 'almalinux:9' - run: | - python3 -m pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1' - - - name: Configure - shell: bash - run: > - cmake -S . -B build - -DCMAKE_BUILD_TYPE=MinSizeRel - -DPYBIND11_WERROR=ON - -DDOWNLOAD_CATCH=ON - -DDOWNLOAD_EIGEN=ON - -DCMAKE_CXX_STANDARD=11 - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - - - name: Build - run: cmake --build build -j 2 - - - name: Python tests - run: cmake --build build --target pytest - - - name: C++ tests - run: cmake --build build --target cpptest - - - name: Interface test - run: cmake --build build --target test_cmake_build - - - name: Visibility test - run: cmake --build build --target test_cross_module_rtti - - - # This tests an "install" with the CMake tools - install-classic: - if: github.event.pull_request.draft == false - name: "🐍 3.9 • Debian • x86 • Install" - runs-on: ubuntu-latest - container: i386/debian:bullseye - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v1 # v1 is required to run inside docker - - - name: Install requirements - run: | - apt-get update - apt-get install -y git make cmake g++ libeigen3-dev python3-dev python3-pip - pip3 install "pytest==6.*" - - - name: Configure for install - run: > - cmake . - -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - - - name: Make and install - run: make install - - - name: Copy tests to new directory - run: cp -a tests /pybind11-tests - - - name: Make a new test directory - run: mkdir /build-tests - - - name: Configure tests - run: > - cmake ../pybind11-tests - -DDOWNLOAD_CATCH=ON - -DPYBIND11_WERROR=ON - -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - working-directory: /build-tests - - - name: Python tests - run: make pytest -j 2 - working-directory: /build-tests - - - # This verifies that the documentation is not horribly broken, and does a - # basic validation check on the SDist. - doxygen: - if: github.event.pull_request.draft == false - name: "Documentation build test" - runs-on: ubuntu-latest - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-python@v6 - with: - python-version: "3.x" - - - name: Install Doxygen - run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04 - - - name: Build docs - run: pipx run nox -s docs - - - name: Make SDist - run: pipx run nox -s build -- --sdist - - - run: git status --ignored - - - name: Check local include dir - run: > - ls pybind11; - python3 -c "import pybind11, pathlib; assert (a := pybind11.get_include()) == (b := str(pathlib.Path('include').resolve())), f'{a} != {b}'" - - - name: Compare Dists (headers only) - working-directory: include - run: | - python3 -m pip install --user -U ../dist/*.tar.gz - installed=$(python3 -c "import pybind11; print(pybind11.get_include() + '/pybind11')") - diff -rq $installed ./pybind11 - - win32: - if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - include: - - python: '3.8' - args: -DCMAKE_CXX_STANDARD=17 - - python: '3.10' - args: -DCMAKE_CXX_STANDARD=20 - - python: '3.13' - - - name: "🐍 ${{ matrix.python }} • MSVC 2022 • x86 ${{ matrix.args }}" - runs-on: windows-2022 - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python }} - architecture: x86 - # Python 3.13.4 broken on Windows - check-latest: >- - ${{ matrix.python == '3.13' && runner.os == 'Windows' }} - - - name: Update CMake - uses: jwlawson/actions-setup-cmake@v2.0 - - - name: Prepare MSVC - uses: ilammy/msvc-dev-cmd@v1.13.0 - with: - arch: x86 - - - name: Prepare env - run: | - python -m pip install -r tests/requirements.txt - - - name: Configure ${{ matrix.args }} - run: > - cmake -S . -B build - -G "Visual Studio 17 2022" -A Win32 - -DPYBIND11_WERROR=ON - -DDOWNLOAD_CATCH=ON - -DDOWNLOAD_EIGEN=ON - ${{ matrix.args }} - - name: Build C++11 - run: cmake --build build -j 2 - - - name: Python tests - run: cmake --build build -t pytest - - win32-debug: - if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - include: - - python: 3.9 - args: -DCMAKE_CXX_STANDARD=20 - - python: 3.8 - args: -DCMAKE_CXX_STANDARD=17 - - name: "🐍 ${{ matrix.python }} • MSVC 2022 (Debug) • x86 ${{ matrix.args }}" - runs-on: windows-2022 - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python }} - architecture: x86 - - - name: Update CMake - uses: jwlawson/actions-setup-cmake@v2.0 - - - name: Prepare MSVC - uses: ilammy/msvc-dev-cmd@v1.13.0 - with: - arch: x86 - - - name: Prepare env - run: | - python -m pip install -r tests/requirements.txt - - - name: Configure ${{ matrix.args }} - run: > - cmake -S . -B build - -G "Visual Studio 17 2022" -A Win32 - -DCMAKE_BUILD_TYPE=Debug - -DPYBIND11_WERROR=ON - -DDOWNLOAD_CATCH=ON - -DDOWNLOAD_EIGEN=ON - ${{ matrix.args }} - - name: Build C++11 - run: cmake --build build --config Debug -j 2 - - - name: Python tests - run: cmake --build build --config Debug -t pytest - - - windows-2022: - if: github.event.pull_request.draft == false - strategy: - fail-fast: false - matrix: - python: - - 3.9 - - name: "🐍 ${{ matrix.python }} • MSVC 2022 C++20 • x64" - runs-on: windows-2022 - timeout-minutes: 90 - - steps: - - uses: actions/checkout@v6 - - - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python }} - - - name: Prepare env - run: python3 -m pip install -r tests/requirements.txt - - - name: Update CMake - uses: jwlawson/actions-setup-cmake@v2.0 - - - name: Configure C++20 - run: > - cmake -S . -B build - -DPYBIND11_WERROR=ON - -DDOWNLOAD_CATCH=ON - -DDOWNLOAD_EIGEN=ON - -DCMAKE_CXX_STANDARD=20 - - - name: Build C++20 - run: cmake --build build -j 2 - - - name: Python tests - run: cmake --build build --target pytest - - - name: C++20 tests - run: cmake --build build --target cpptest -j 2 - - - name: Interface test C++20 - run: cmake --build build --target test_cmake_build - - - name: Visibility test - run: cmake --build build --target test_cross_module_rtti - - - name: Configure C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE - run: > - cmake -S . -B build_partial - -DPYBIND11_WERROR=ON - -DDOWNLOAD_CATCH=ON - -DDOWNLOAD_EIGEN=ON - -DCMAKE_CXX_STANDARD=20 - "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" - - - name: Build C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE - run: cmake --build build_partial -j 2 - - - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE - run: cmake --build build_partial --target pytest - - mingw: - if: github.event.pull_request.draft == false - name: "🐍 3 • windows-latest • ${{ matrix.sys }}" - runs-on: windows-latest - timeout-minutes: 90 - defaults: - run: - shell: msys2 {0} - strategy: - fail-fast: false - matrix: - include: - - sys: mingw32 - env: i686 - extra_install: "" - - sys: mingw64 - env: x86_64 - extra_install: | - mingw-w64-x86_64-python-numpy - mingw-w64-x86_64-python-scipy - mingw-w64-x86_64-eigen3 - steps: - - uses: msys2/setup-msys2@v2 - with: - msystem: ${{matrix.sys}} - install: >- - git - mingw-w64-${{matrix.env}}-gcc - mingw-w64-${{matrix.env}}-python-pip - mingw-w64-${{matrix.env}}-cmake - mingw-w64-${{matrix.env}}-make - mingw-w64-${{matrix.env}}-python-pytest - mingw-w64-${{matrix.env}}-boost - mingw-w64-${{matrix.env}}-catch - ${{ matrix.extra_install }} - - - uses: actions/checkout@v6 - - - name: Configure C++11 - # LTO leads to many undefined reference like - # `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&) - run: >- - cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON - -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") - -S . -B build - - - name: Build C++11 - run: cmake --build build -j 2 - - - name: Python tests C++11 - run: cmake --build build --target pytest -j 2 - - - name: C++11 tests - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 2 - - - name: Interface test C++11 - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cmake_build - - - name: Visibility test - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cross_module_rtti - - - name: Clean directory - run: git clean -fdx - - - name: Configure C++14 - run: >- - cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON - -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") - -S . -B build2 - - - name: Build C++14 - run: cmake --build build2 -j 2 - - - name: Python tests C++14 - run: cmake --build build2 --target pytest -j 2 - - - name: C++14 tests - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target cpptest -j 2 - - - name: Interface test C++14 - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cmake_build - - - name: Visibility test - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cross_module_rtti - - - name: Clean directory - run: git clean -fdx - - - name: Configure C++17 - run: >- - cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON - -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") - -S . -B build3 - - - name: Build C++17 - run: cmake --build build3 -j 2 - - - name: Python tests C++17 - run: cmake --build build3 --target pytest -j 2 - - - name: C++17 tests - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target cpptest -j 2 - - - name: Interface test C++17 - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cmake_build - - - name: Visibility test - run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cross_module_rtti - - windows_clang: - if: github.event.pull_request.draft == false - - strategy: - matrix: - os: [windows-latest] - python: ['3.10'] - - runs-on: "${{ matrix.os }}" - timeout-minutes: 90 - - name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest" - - steps: - - name: Show env - run: env - - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Clang - uses: egor-tensin/setup-clang@v1 - - - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python }} - - - name: Update CMake - uses: jwlawson/actions-setup-cmake@v2.0 - - - name: Install ninja-build tool - uses: seanmiddleditch/gha-setup-ninja@v6 - - - name: Run pip installs - run: | - python -m pip install --upgrade pip - python -m pip install -r tests/requirements.txt - - - name: Show Clang++ version - run: clang++ --version - - - name: Show CMake version - run: cmake --version - - # TODO: WERROR=ON - - name: Configure Clang - 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=17 - - - name: Build - run: cmake --build . -j 2 - - - name: Python tests - run: cmake --build . --target pytest -j 2 - - - name: C++ tests - 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 +# - name: Visibility test +# run: cmake --build . --target test_cross_module_rtti -j 2 - - name: Clean directory - run: git clean -fdx +# - name: Clean directory +# run: git clean -fdx windows_arm: if: github.event.pull_request.draft == false From 479da2fb8a814120e68b5633b0439ad615a929aa Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Thu, 11 Dec 2025 13:36:58 -0600 Subject: [PATCH 08/15] Ignore unnmaed namespace on arm windows with mingw - Updatig XFAIL condition to expect a failure on windows arm with mingw and clang - setting python home and path variables in c++ tests --- .github/workflows/ci.yml | 7 +++---- tests/test_unnamed_namespace_a.py | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29b4eac43c..df15398e2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1242,7 +1242,7 @@ jobs: python -m pip install --upgrade pip python -m pip install -r tests/requirements.txt - - name: Configure Clang + - name: Configure CMake run: > cmake -G Ninja -S . -B . -DPYBIND11_WERROR=OFF @@ -1324,11 +1324,10 @@ jobs: run: cmake --build build -j 2 - name: Python tests - run: > - cmake --build build --target pytest -j 2 + run: cmake --build build --target pytest -j 2 - name: C++ tests - run: cmake --build build --target cpptest -j 2 + 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 diff --git a/tests/test_unnamed_namespace_a.py b/tests/test_unnamed_namespace_a.py index fabf1312af..514a81272e 100644 --- a/tests/test_unnamed_namespace_a.py +++ b/tests/test_unnamed_namespace_a.py @@ -5,7 +5,10 @@ from pybind11_tests import unnamed_namespace_a as m from pybind11_tests import unnamed_namespace_b as mb -XFAIL_CONDITION = "not m.defined_WIN32_or__WIN32 and (m.defined___clang__ or m.defined__LIBCPP_VERSION)" +XFAIL_CONDITION = ( + "m.defined__LIBCPP_VERSION or " + "(not m.defined_WIN32_or__WIN32 and m.defined___clang__)" +) XFAIL_REASON = "Known issues: https://github.com/pybind/pybind11/pull/4319" From 721b57aabb7a3b24c40a761d26b0400334bb7a79 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Thu, 11 Dec 2025 14:10:36 -0600 Subject: [PATCH 09/15] Revert "commenting out other tests" This reverts commit dc75243963f96295c2ce9e2a5180cd6ac384a4ed. --- .github/workflows/ci.yml | 2322 +++++++++++++++++++------------------- 1 file changed, 1161 insertions(+), 1161 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df15398e2f..d3fcf4d702 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,1185 +30,1185 @@ jobs: # This is the "main" test suite, which tests a large number of different # versions of default compilers and Python versions in GitHub Actions. # It is in two parts: one that always runs, and one that runs on non-draft -# standard-small: -# if: github.event.action != 'ready_for_review' -# strategy: -# fail-fast: false -# matrix: -# include: -# - runs-on: ubuntu-22.04 -# python-version: '3.8' -# cmake-args: -DPYBIND11_FINDPYTHON=OFF -DPYBIND11_NUMPY_1_ONLY=ON -# - runs-on: ubuntu-latest -# python-version: '3.13' -# cmake-args: -DCMAKE_CXX_STANDARD=23 -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON -# - runs-on: ubuntu-latest -# python-version: '3.14t' -# cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON -# - runs-on: ubuntu-latest -# python-version: 'pypy3.11' -# cmake-args: -DCMAKE_CXX_STANDARD=17 -# - runs-on: ubuntu-latest -# python-version: 'graalpy-24.2' -# cmake-args: -DCMAKE_CXX_STANDARD=20 -# - runs-on: macos-latest -# python-version: '3.14' -# cmake-args: -DCMAKE_CXX_STANDARD=14 -# - runs-on: windows-2022 -# python-version: '3.8' -# cmake-args: -DPYBIND11_FINDPYTHON=OFF -# - runs-on: windows-11-arm -# python-version: '3.11' -# cmake-args: -DCMAKE_CXX_STANDARD=17 - - -# name: 🐍 -# uses: ./.github/workflows/reusable-standard.yml -# with: -# runs-on: ${{ matrix.runs-on }} -# python-version: ${{ matrix.python-version }} -# cmake-args: ${{ matrix.cmake-args }} - -# standard-large: -# if: github.event.pull_request.draft == false -# strategy: -# fail-fast: false -# matrix: -# include: -# - runs-on: ubuntu-latest -# python-version: '3.8' -# cmake-args: -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_STANDARD=17 -# - runs-on: ubuntu-latest -# python-version: '3.10' -# cmake-args: -DCMAKE_CXX_STANDARD=20 -# - runs-on: ubuntu-latest -# python-version: '3.11' -# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_STANDARD=17 -# - runs-on: ubuntu-latest -# python-version: '3.12' -# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON -# - runs-on: ubuntu-latest -# python-version: '3.13t' -# 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" -# - runs-on: ubuntu-latest -# python-version: 'pypy-3.10' -# cmake-args: -DCMAKE_CXX_STANDARD=14 -# - runs-on: ubuntu-latest -# python-version: 'graalpy-24.1' - -# # No SciPy for macOS ARM -# - runs-on: macos-15-intel -# python-version: '3.8' -# cmake-args: -DCMAKE_CXX_STANDARD=14 -# - runs-on: macos-15-intel -# python-version: '3.11' -# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -# - runs-on: macos-latest -# python-version: '3.12' -# cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON -# - runs-on: macos-15-intel -# python-version: '3.13t' -# cmake-args: -DCMAKE_CXX_STANDARD=11 -# - runs-on: macos-latest -# python-version: '3.14t' -# cmake-args: -DCMAKE_CXX_STANDARD=20 -# - runs-on: macos-15-intel -# python-version: 'pypy-3.10' -# cmake-args: -DCMAKE_CXX_STANDARD=17 -# - runs-on: macos-latest -# python-version: 'pypy-3.11' -# - runs-on: macos-latest -# python-version: 'graalpy-24.2' - -# - runs-on: windows-latest -# python-version: '3.9' -# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -# - runs-on: windows-2022 -# python-version: '3.8' -# cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPYBIND11_NUMPY_1_ONLY=ON -# - runs-on: windows-2022 -# python-version: '3.9' -# cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_CXX_STANDARD=14 -# # This needs a python built with MTd -# # - runs-on: windows-2022 -# # python-version: '3.11' -# # cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug -# - runs-on: windows-2022 -# python-version: '3.10' -# cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_FLAGS="/GR /EHsc" -# - runs-on: windows-2022 -# python-version: '3.13' -# cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL -# - runs-on: windows-latest -# python-version: '3.13t' -# cmake-args: -DCMAKE_CXX_STANDARD=17 -# - runs-on: windows-latest -# python-version: '3.14' -# cmake-args: -DCMAKE_CXX_STANDARD=20 -# - runs-on: windows-latest -# python-version: '3.14t' -# cmake-args: -DCMAKE_CXX_STANDARD=23 -# - runs-on: windows-latest -# python-version: 'pypy-3.10' -# cmake-args: -DCMAKE_CXX_STANDARD=17 -# - runs-on: windows-latest -# python-version: 'pypy3.11' -# cmake-args: -DCMAKE_CXX_STANDARD=20 -# # The setup-python action currently doesn't have graalpy for windows -# # See https://github.com/actions/setup-python/pull/880 - -# name: 🐍 -# uses: ./.github/workflows/reusable-standard.yml -# with: -# runs-on: ${{ matrix.runs-on }} -# python-version: ${{ matrix.python-version }} -# cmake-args: ${{ matrix.cmake-args }} - -# # This checks inplace builds with C++11 -# inplace: -# if: github.event.pull_request.draft == false -# strategy: -# fail-fast: false -# matrix: -# include: -# - runs-on: ubuntu-latest -# python-version: '3.9' -# - runs-on: macos-latest -# python-version: '3.12' -# - runs-on: windows-latest -# python-version: '3.11' - -# name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++14" -# runs-on: ${{ matrix.runs-on }} -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# - name: Setup Python ${{ matrix.python-version }} -# uses: actions/setup-python@v6 -# with: -# python-version: ${{ matrix.python-version }} -# allow-prereleases: true - -# - name: Install uv -# uses: astral-sh/setup-uv@v7 -# with: -# enable-cache: true - -# - name: Prepare env -# run: uv pip install --python=python --system -r tests/requirements.txt - -# # TODO Resolve Windows Ninja shared object issue on Python 3.8+ -# - name: Use Ninja except on Windows -# if: runner.os != 'Windows' -# run: echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV" - -# # More-or-less randomly adding a few extra flags here. -# # In particular, use this one to test the next ABI bump (internals version). -# - name: Configure -# run: > -# cmake -S. -B. -# -DPYBIND11_WERROR=ON -# -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON -# -DPYBIND11_PYTEST_ARGS=-v -# -DDOWNLOAD_CATCH=ON -# -DDOWNLOAD_EIGEN=ON -# -DCMAKE_CXX_STANDARD=14 -# -DPYBIND11_INTERNALS_VERSION=10000000 - -# # Checks to makes sure defining `_` is allowed -# # Triggers EHsc missing error on Windows -# - name: Add underscore check -# if: runner.os != 'Windows' -# run: cmake -S. -B. -DCMAKE_CXX_FLAGS="-D_=1" - -# - name: Build -# run: cmake --build . - -# - name: Python tests -# run: cmake --build . --target pytest - -# - name: Compiled tests -# run: cmake --build . --target cpptest - -# - name: Interface test -# run: cmake --build . --target test_cmake_build - -# - name: Visibility test -# run: cmake --build . --target test_cross_module_rtti - - -# manylinux: -# name: Manylinux on 🐍 3.13t • GIL -# if: github.event.pull_request.draft == false -# runs-on: ubuntu-latest -# timeout-minutes: 40 -# container: quay.io/pypa/musllinux_1_2_x86_64:latest -# steps: -# - uses: actions/checkout@v6 -# with: -# fetch-depth: 0 - -# - name: Prepare uv's path -# run: echo "$HOME/.local/bin" >> $GITHUB_PATH - -# - name: Install ninja -# run: uv tool install ninja - -# - name: Configure via preset -# run: cmake --preset venv -DPYBIND11_CREATE_WITH_UV=python3.13t - -# - name: Build C++11 -# run: cmake --build --preset venv - -# - name: Python tests C++11 -# run: cmake --build --preset testsvenv -t pytest - -# deadsnakes: -# if: github.event.pull_request.draft == false -# strategy: -# fail-fast: false -# matrix: -# include: -# # TODO: Fails on 3.10, investigate -# # JOB DISABLED (NEEDS WORK): https://github.com/pybind/pybind11/issues/4889 -# # - python-version: "3.9" -# # python-debug: true -# # valgrind: true -# - python-version: "3.11" -# python-debug: false - -# name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64" -# runs-on: ubuntu-latest -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# - name: Setup Python ${{ matrix.python-version }} (deadsnakes) -# uses: deadsnakes/action@v3.2.0 -# with: -# python-version: ${{ matrix.python-version }} -# debug: ${{ matrix.python-debug }} - -# - name: Update CMake -# uses: jwlawson/actions-setup-cmake@v2.0 - -# - name: Valgrind cache -# if: matrix.valgrind -# uses: actions/cache@v4 -# id: cache-valgrind -# with: -# path: valgrind -# key: 3.16.1 # Valgrind version - -# - name: Compile Valgrind -# if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true' -# run: | -# VALGRIND_VERSION=3.16.1 -# curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj -# mv valgrind-$VALGRIND_VERSION valgrind -# cd valgrind -# ./configure -# make -j 2 > /dev/null - -# - name: Install Valgrind -# if: matrix.valgrind -# working-directory: valgrind -# run: | -# sudo make install -# sudo apt-get update -# sudo apt-get install ninja-build libc6-dbg - -# - name: Prepare env -# run: | -# python -m pip install -r tests/requirements.txt - -# - name: Configure -# run: cmake --preset default -DCMAKE_CXX_STANDARD=17 - -# - name: Build -# run: cmake --build --preset default - -# - name: Python tests -# run: cmake --build --preset default --target pytest - -# - name: C++ tests -# run: cmake --build --preset default --target cpptest - -# - name: Visibility test -# run: cmake --build --preset default --target test_cross_module_rtti - -# - name: Run Valgrind on Python tests -# if: matrix.valgrind -# run: cmake --build --preset default --target memcheck - - -# # Testing on clang using the excellent silkeh clang docker images -# clang: -# if: github.event.pull_request.draft == false -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: -# include: -# - clang: 5 -# std: 14 -# - clang: 11 -# std: 20 -# - clang: 14 -# std: 20 -# - clang: 16 -# std: 20 -# container_suffix: "-bullseye" -# - clang: 18 -# std: 20 -# cxx_flags: "-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" -# container_suffix: "-bookworm" - -# name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" -# container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}" -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# - name: Add wget and python3 -# run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev - -# - name: Configure -# shell: bash -# run: > -# cmake -S . -B build -# -DPYBIND11_WERROR=ON -# -DDOWNLOAD_CATCH=ON -# -DCMAKE_CXX_STANDARD=${{ matrix.std }} -# -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - -# - name: Build -# run: cmake --build build -j 2 - -# - name: Python tests -# run: cmake --build build --target pytest - -# - name: C++ tests -# run: cmake --build build --target cpptest - -# - name: Interface test -# run: cmake --build build --target test_cmake_build - -# - name: Visibility test -# run: cmake --build build --target test_cross_module_rtti - -# # Testing NVCC; forces sources to behave like .cu files -# cuda: -# runs-on: ubuntu-latest -# name: "🐍 3.10 • CUDA 12.2 • Ubuntu 22.04" -# container: nvidia/cuda:12.2.0-devel-ubuntu22.04 -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND -# - name: Install 🐍 3 -# run: apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake git python3-dev python3-pytest python3-numpy - -# - name: Configure -# run: cmake -S . -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON - -# - name: Build -# run: cmake --build build -j2 --verbose - -# - name: Python tests -# run: cmake --build build --target pytest - - -# # TODO: Internal compiler error - report to NVidia -# # # Testing CentOS 8 + PGI compilers -# # centos-nvhpc8: -# # runs-on: ubuntu-latest -# # name: "🐍 3 • CentOS8 / PGI 20.11 • x64" -# # container: centos:8 -# # -# # steps: -# # - uses: actions/checkout@v6 -# # -# # - name: Add Python 3 and a few requirements -# # run: yum update -y && yum install -y git python3-devel python3-numpy python3-pytest make environment-modules -# # -# # - name: Install CMake with pip -# # run: | -# # python3 -m pip install --upgrade pip -# # python3 -m pip install cmake --prefer-binary -# # -# # - name: Install NVidia HPC SDK -# # run: > -# # yum -y install -# # https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-20-11-20.11-1.x86_64.rpm -# # https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-2020-20.11-1.x86_64.rpm -# # -# # - name: Configure -# # shell: bash -# # run: | -# # source /etc/profile.d/modules.sh -# # module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/20.11 -# # cmake -S . -B build -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=14 -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") -# # -# # - name: Build -# # run: cmake --build build -j 2 --verbose -# # -# # - name: Python tests -# # run: cmake --build build --target pytest -# # -# # - name: C++ tests -# # run: cmake --build build --target cpptest -# # -# # - name: Interface test -# # run: cmake --build build --target test_cmake_build - - -# # Testing on Ubuntu + NVHPC (previous PGI) compilers, which seems to require more workarounds -# ubuntu-nvhpc7: -# if: github.event.pull_request.draft == false -# runs-on: ubuntu-22.04 -# name: "🐍 3 • NVHPC 23.5 • C++17 • x64" -# timeout-minutes: 90 - -# env: -# # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND -# DEBIAN_FRONTEND: 'noninteractive' -# steps: -# - uses: actions/checkout@v6 - -# - name: Add NVHPC Repo -# run: | -# echo 'deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | \ -# sudo tee /etc/apt/sources.list.d/nvhpc.list - -# - 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 rm -rf /var/lib/apt/lists/* -# python3 -m pip install --upgrade pip -# python3 -m pip install --upgrade pytest - -# # On some systems, you many need further workarounds: -# # https://github.com/pybind/pybind11/pull/2475 -# - name: Configure -# shell: bash -# run: | -# source /etc/profile.d/modules.sh -# module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.5 -# cmake -S . -B build -DDOWNLOAD_CATCH=ON \ -# -DCMAKE_CXX_STANDARD=17 \ -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \ -# -DCMAKE_CXX_FLAGS="-Wc,--pending_instantiations=0" \ -# -DPYBIND11_TEST_FILTER="test_smart_ptr.cpp" - -# - name: Build -# run: cmake --build build -j 2 --verbose - -# - name: Python tests -# run: cmake --build build --target pytest - -# - name: C++ tests -# run: cmake --build build --target cpptest - -# - name: Interface test -# run: cmake --build build --target test_cmake_build - -# - name: Visibility test -# run: cmake --build build --target test_cross_module_rtti - -# # Testing on GCC using the GCC docker images (only recent images supported) -# gcc: -# if: github.event.pull_request.draft == false -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: -# include: -# - { gcc: 9, std: 20 } -# - { gcc: 10, std: 17 } -# - { gcc: 10, std: 20 } -# - { gcc: 13, std: 20, cxx_flags: "-Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" } - -# name: "🐍 3 • GCC ${{ matrix.gcc }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" -# container: "gcc:${{ matrix.gcc }}" -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# - name: Add Python 3 -# run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev - -# - name: Update pip -# run: python3 -m pip install --upgrade pip - -# - name: Update CMake -# uses: jwlawson/actions-setup-cmake@v2.0 - -# - name: Configure -# shell: bash -# run: > -# cmake -S . -B build -# -DPYBIND11_WERROR=ON -# -DDOWNLOAD_CATCH=ON -# -DCMAKE_CXX_STANDARD=${{ matrix.std }} -# -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - -# - name: Build -# run: cmake --build build -j 2 - -# - name: Python tests -# run: cmake --build build --target pytest - -# - name: C++ tests -# run: cmake --build build --target cpptest - -# - name: Interface test -# run: cmake --build build --target test_cmake_build - -# - name: Visibility test -# run: cmake --build build --target test_cross_module_rtti - -# - name: Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE -# if: matrix.gcc == '12' -# shell: bash -# run: > -# cmake -S . -B build_partial -# -DPYBIND11_WERROR=ON -# -DDOWNLOAD_CATCH=ON -# -DCMAKE_CXX_STANDARD=${{ matrix.std }} -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") -# "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" - -# - name: Build - Exercise cmake -DPYBIND11_TEST_OVERRIDE -# if: matrix.gcc == '12' -# run: cmake --build build_partial -j 2 - -# - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE -# if: matrix.gcc == '12' -# run: cmake --build build_partial --target pytest - -# # Testing on ICC using the oneAPI apt repo -# icc: -# if: github.event.pull_request.draft == false -# runs-on: ubuntu-22.04 -# timeout-minutes: 90 - -# name: "🐍 3 • ICC latest • x64" - -# steps: -# - uses: actions/checkout@v6 - -# - name: Add apt repo -# run: | -# sudo apt-get update -# sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg -# wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB -# sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB -# echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - -# - name: Add ICC & Python 3 -# run: sudo apt-get update; sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic cmake python3-dev python3-numpy python3-pytest python3-pip - -# - name: Update pip -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# python3 -m pip install --upgrade pip - -# - name: Install dependencies -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# python3 -m pip install -r tests/requirements.txt - -# - name: Configure C++11 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake -S . -B build-11 \ -# -DPYBIND11_WERROR=ON \ -# -DDOWNLOAD_CATCH=ON \ -# -DDOWNLOAD_EIGEN=OFF \ -# -DCMAKE_CXX_STANDARD=11 \ -# -DCMAKE_CXX_COMPILER=$(which icpc) \ -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - -# - name: Build C++11 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake --build build-11 -j 2 -v - -# - name: Python tests C++11 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# sudo service apport stop -# cmake --build build-11 --target check - -# - name: C++ tests C++11 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake --build build-11 --target cpptest - -# - name: Interface test C++11 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake --build build-11 --target test_cmake_build - -# - name: Visibility test -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake --build build-11 --target test_cross_module_rtti - -# - name: Configure C++17 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake -S . -B build-17 \ -# -DPYBIND11_WERROR=ON \ -# -DDOWNLOAD_CATCH=ON \ -# -DDOWNLOAD_EIGEN=OFF \ -# -DCMAKE_CXX_STANDARD=17 \ -# -DCMAKE_CXX_COMPILER=$(which icpc) \ -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - -# - name: Build C++17 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake --build build-17 -j 2 -v - -# - name: Python tests C++17 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# sudo service apport stop -# cmake --build build-17 --target check - -# - name: C++ tests C++17 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake --build build-17 --target cpptest - -# - name: Interface test C++17 -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake --build build-17 --target test_cmake_build - -# - name: Visibility test -# run: | -# set +e; source /opt/intel/oneapi/setvars.sh; set -e -# cmake --build build-17 --target test_cross_module_rtti - -# # Testing on CentOS (manylinux uses a centos base). -# centos: -# if: github.event.pull_request.draft == false -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: -# container: -# - "almalinux:8" -# - "almalinux:9" - -# name: "🐍 3 • ${{ matrix.container }} • x64" -# container: "${{ matrix.container }}" -# timeout-minutes: 90 - -# steps: -# - name: Latest actions/checkout -# uses: actions/checkout@v6 - -# - name: Add Python 3.8 -# if: matrix.container == 'almalinux:8' -# run: dnf update -y && dnf install -y python38-devel gcc-c++ make git - -# - name: Add Python 3 (default) -# if: matrix.container != 'almalinux:8' -# run: dnf update -y && dnf install -y python3-devel gcc-c++ make git - -# - name: Update pip -# run: python3 -m pip install --upgrade pip - -# - name: Install dependencies -# run: | -# python3 -m pip install cmake -r tests/requirements.txt - -# - name: Ensure NumPy 2 is used (required Python >= 3.9) -# if: matrix.container == 'almalinux:9' -# run: | -# python3 -m pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1' - -# - name: Configure -# shell: bash -# run: > -# cmake -S . -B build -# -DCMAKE_BUILD_TYPE=MinSizeRel -# -DPYBIND11_WERROR=ON -# -DDOWNLOAD_CATCH=ON -# -DDOWNLOAD_EIGEN=ON -# -DCMAKE_CXX_STANDARD=11 -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - -# - name: Build -# run: cmake --build build -j 2 - -# - name: Python tests -# run: cmake --build build --target pytest - -# - name: C++ tests -# run: cmake --build build --target cpptest - -# - name: Interface test -# run: cmake --build build --target test_cmake_build - -# - name: Visibility test -# run: cmake --build build --target test_cross_module_rtti - - -# # This tests an "install" with the CMake tools -# install-classic: -# if: github.event.pull_request.draft == false -# name: "🐍 3.9 • Debian • x86 • Install" -# runs-on: ubuntu-latest -# container: i386/debian:bullseye -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v1 # v1 is required to run inside docker - -# - name: Install requirements -# run: | -# apt-get update -# apt-get install -y git make cmake g++ libeigen3-dev python3-dev python3-pip -# pip3 install "pytest==6.*" - -# - name: Configure for install -# run: > -# cmake . -# -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - -# - name: Make and install -# run: make install - -# - name: Copy tests to new directory -# run: cp -a tests /pybind11-tests - -# - name: Make a new test directory -# run: mkdir /build-tests - -# - name: Configure tests -# run: > -# cmake ../pybind11-tests -# -DDOWNLOAD_CATCH=ON -# -DPYBIND11_WERROR=ON -# -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") -# working-directory: /build-tests - -# - name: Python tests -# run: make pytest -j 2 -# working-directory: /build-tests - - -# # This verifies that the documentation is not horribly broken, and does a -# # basic validation check on the SDist. -# doxygen: -# if: github.event.pull_request.draft == false -# name: "Documentation build test" -# runs-on: ubuntu-latest -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# - uses: actions/setup-python@v6 -# with: -# python-version: "3.x" - -# - name: Install Doxygen -# run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04 - -# - name: Build docs -# run: pipx run nox -s docs - -# - name: Make SDist -# run: pipx run nox -s build -- --sdist - -# - run: git status --ignored - -# - name: Check local include dir -# run: > -# ls pybind11; -# python3 -c "import pybind11, pathlib; assert (a := pybind11.get_include()) == (b := str(pathlib.Path('include').resolve())), f'{a} != {b}'" - -# - name: Compare Dists (headers only) -# working-directory: include -# run: | -# python3 -m pip install --user -U ../dist/*.tar.gz -# installed=$(python3 -c "import pybind11; print(pybind11.get_include() + '/pybind11')") -# diff -rq $installed ./pybind11 - -# win32: -# if: github.event.pull_request.draft == false -# strategy: -# fail-fast: false -# matrix: -# include: -# - python: '3.8' -# args: -DCMAKE_CXX_STANDARD=17 -# - python: '3.10' -# args: -DCMAKE_CXX_STANDARD=20 -# - python: '3.13' - - -# name: "🐍 ${{ matrix.python }} • MSVC 2022 • x86 ${{ matrix.args }}" -# runs-on: windows-2022 -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# - name: Setup Python ${{ matrix.python }} -# uses: actions/setup-python@v6 -# with: -# python-version: ${{ matrix.python }} -# architecture: x86 -# # Python 3.13.4 broken on Windows -# check-latest: >- -# ${{ matrix.python == '3.13' && runner.os == 'Windows' }} - -# - name: Update CMake -# uses: jwlawson/actions-setup-cmake@v2.0 - -# - name: Prepare MSVC -# uses: ilammy/msvc-dev-cmd@v1.13.0 -# with: -# arch: x86 - -# - name: Prepare env -# run: | -# python -m pip install -r tests/requirements.txt - -# - name: Configure ${{ matrix.args }} -# run: > -# cmake -S . -B build -# -G "Visual Studio 17 2022" -A Win32 -# -DPYBIND11_WERROR=ON -# -DDOWNLOAD_CATCH=ON -# -DDOWNLOAD_EIGEN=ON -# ${{ matrix.args }} -# - name: Build C++11 -# run: cmake --build build -j 2 - -# - name: Python tests -# run: cmake --build build -t pytest - -# win32-debug: -# if: github.event.pull_request.draft == false -# strategy: -# fail-fast: false -# matrix: -# include: -# - python: 3.9 -# args: -DCMAKE_CXX_STANDARD=20 -# - python: 3.8 -# args: -DCMAKE_CXX_STANDARD=17 - -# name: "🐍 ${{ matrix.python }} • MSVC 2022 (Debug) • x86 ${{ matrix.args }}" -# runs-on: windows-2022 -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# - name: Setup Python ${{ matrix.python }} -# uses: actions/setup-python@v6 -# with: -# python-version: ${{ matrix.python }} -# architecture: x86 - -# - name: Update CMake -# uses: jwlawson/actions-setup-cmake@v2.0 - -# - name: Prepare MSVC -# uses: ilammy/msvc-dev-cmd@v1.13.0 -# with: -# arch: x86 - -# - name: Prepare env -# run: | -# python -m pip install -r tests/requirements.txt - -# - name: Configure ${{ matrix.args }} -# run: > -# cmake -S . -B build -# -G "Visual Studio 17 2022" -A Win32 -# -DCMAKE_BUILD_TYPE=Debug -# -DPYBIND11_WERROR=ON -# -DDOWNLOAD_CATCH=ON -# -DDOWNLOAD_EIGEN=ON -# ${{ matrix.args }} -# - name: Build C++11 -# run: cmake --build build --config Debug -j 2 - -# - name: Python tests -# run: cmake --build build --config Debug -t pytest - - -# windows-2022: -# if: github.event.pull_request.draft == false -# strategy: -# fail-fast: false -# matrix: -# python: -# - 3.9 - -# name: "🐍 ${{ matrix.python }} • MSVC 2022 C++20 • x64" -# runs-on: windows-2022 -# timeout-minutes: 90 - -# steps: -# - uses: actions/checkout@v6 - -# - name: Setup Python ${{ matrix.python }} -# uses: actions/setup-python@v6 -# with: -# python-version: ${{ matrix.python }} - -# - name: Prepare env -# run: python3 -m pip install -r tests/requirements.txt - -# - name: Update CMake -# uses: jwlawson/actions-setup-cmake@v2.0 - -# - name: Configure C++20 -# run: > -# cmake -S . -B build -# -DPYBIND11_WERROR=ON -# -DDOWNLOAD_CATCH=ON -# -DDOWNLOAD_EIGEN=ON -# -DCMAKE_CXX_STANDARD=20 - -# - name: Build C++20 -# run: cmake --build build -j 2 - -# - name: Python tests -# run: cmake --build build --target pytest - -# - name: C++20 tests -# run: cmake --build build --target cpptest -j 2 - -# - name: Interface test C++20 -# run: cmake --build build --target test_cmake_build - -# - name: Visibility test -# run: cmake --build build --target test_cross_module_rtti - -# - name: Configure C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE -# run: > -# cmake -S . -B build_partial -# -DPYBIND11_WERROR=ON -# -DDOWNLOAD_CATCH=ON -# -DDOWNLOAD_EIGEN=ON -# -DCMAKE_CXX_STANDARD=20 -# "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" - -# - name: Build C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE -# run: cmake --build build_partial -j 2 - -# - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE -# run: cmake --build build_partial --target pytest - -# mingw: -# if: github.event.pull_request.draft == false -# name: "🐍 3 • windows-latest • ${{ matrix.sys }}" -# runs-on: windows-latest -# timeout-minutes: 90 -# defaults: -# run: -# shell: msys2 {0} -# strategy: -# fail-fast: false -# matrix: -# include: -# - sys: mingw32 -# env: i686 -# extra_install: "" -# - sys: mingw64 -# env: x86_64 -# extra_install: | -# mingw-w64-x86_64-python-numpy -# mingw-w64-x86_64-python-scipy -# mingw-w64-x86_64-eigen3 -# steps: -# - uses: msys2/setup-msys2@v2 -# with: -# msystem: ${{matrix.sys}} -# install: >- -# git -# mingw-w64-${{matrix.env}}-gcc -# mingw-w64-${{matrix.env}}-python-pip -# mingw-w64-${{matrix.env}}-cmake -# mingw-w64-${{matrix.env}}-make -# mingw-w64-${{matrix.env}}-python-pytest -# mingw-w64-${{matrix.env}}-boost -# mingw-w64-${{matrix.env}}-catch -# ${{ matrix.extra_install }} - -# - uses: actions/checkout@v6 - -# - name: Configure C++11 -# # LTO leads to many undefined reference like -# # `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&) -# run: >- -# cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -# -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") -# -S . -B build - -# - name: Build C++11 -# run: cmake --build build -j 2 - -# - name: Python tests C++11 -# run: cmake --build build --target pytest -j 2 - -# - name: C++11 tests -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 2 - -# - name: Interface test C++11 -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cmake_build - -# - name: Visibility test -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cross_module_rtti - -# - name: Clean directory -# run: git clean -fdx - -# - name: Configure C++14 -# run: >- -# cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -# -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") -# -S . -B build2 - -# - name: Build C++14 -# run: cmake --build build2 -j 2 - -# - name: Python tests C++14 -# run: cmake --build build2 --target pytest -j 2 - -# - name: C++14 tests -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target cpptest -j 2 - -# - name: Interface test C++14 -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cmake_build - -# - name: Visibility test -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cross_module_rtti - -# - name: Clean directory -# run: git clean -fdx - -# - name: Configure C++17 -# run: >- -# cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -# -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") -# -S . -B build3 - -# - name: Build C++17 -# run: cmake --build build3 -j 2 - -# - name: Python tests C++17 -# run: cmake --build build3 --target pytest -j 2 - -# - name: C++17 tests -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target cpptest -j 2 - -# - name: Interface test C++17 -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cmake_build - -# - name: Visibility test -# run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cross_module_rtti - -# windows_clang: -# if: github.event.pull_request.draft == false - -# strategy: -# matrix: -# os: [windows-latest] -# python: ['3.10'] + standard-small: + if: github.event.action != 'ready_for_review' + strategy: + fail-fast: false + matrix: + include: + - runs-on: ubuntu-22.04 + python-version: '3.8' + cmake-args: -DPYBIND11_FINDPYTHON=OFF -DPYBIND11_NUMPY_1_ONLY=ON + - runs-on: ubuntu-latest + python-version: '3.13' + cmake-args: -DCMAKE_CXX_STANDARD=23 -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON + - runs-on: ubuntu-latest + python-version: '3.14t' + cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON + - runs-on: ubuntu-latest + python-version: 'pypy3.11' + cmake-args: -DCMAKE_CXX_STANDARD=17 + - runs-on: ubuntu-latest + python-version: 'graalpy-24.2' + cmake-args: -DCMAKE_CXX_STANDARD=20 + - runs-on: macos-latest + python-version: '3.14' + cmake-args: -DCMAKE_CXX_STANDARD=14 + - runs-on: windows-2022 + python-version: '3.8' + cmake-args: -DPYBIND11_FINDPYTHON=OFF + - runs-on: windows-11-arm + python-version: '3.11' + cmake-args: -DCMAKE_CXX_STANDARD=17 + + + name: 🐍 + uses: ./.github/workflows/reusable-standard.yml + with: + runs-on: ${{ matrix.runs-on }} + python-version: ${{ matrix.python-version }} + cmake-args: ${{ matrix.cmake-args }} + + standard-large: + if: github.event.pull_request.draft == false + strategy: + fail-fast: false + matrix: + include: + - runs-on: ubuntu-latest + python-version: '3.8' + cmake-args: -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_STANDARD=17 + - runs-on: ubuntu-latest + python-version: '3.10' + cmake-args: -DCMAKE_CXX_STANDARD=20 + - runs-on: ubuntu-latest + python-version: '3.11' + cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_STANDARD=17 + - runs-on: ubuntu-latest + python-version: '3.12' + cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON + - runs-on: ubuntu-latest + python-version: '3.13t' + 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" + - runs-on: ubuntu-latest + python-version: 'pypy-3.10' + cmake-args: -DCMAKE_CXX_STANDARD=14 + - runs-on: ubuntu-latest + python-version: 'graalpy-24.1' + + # No SciPy for macOS ARM + - runs-on: macos-15-intel + python-version: '3.8' + cmake-args: -DCMAKE_CXX_STANDARD=14 + - runs-on: macos-15-intel + python-version: '3.11' + cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON + - runs-on: macos-latest + python-version: '3.12' + cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON + - runs-on: macos-15-intel + python-version: '3.13t' + cmake-args: -DCMAKE_CXX_STANDARD=11 + - runs-on: macos-latest + python-version: '3.14t' + cmake-args: -DCMAKE_CXX_STANDARD=20 + - runs-on: macos-15-intel + python-version: 'pypy-3.10' + cmake-args: -DCMAKE_CXX_STANDARD=17 + - runs-on: macos-latest + python-version: 'pypy-3.11' + - runs-on: macos-latest + python-version: 'graalpy-24.2' + + - runs-on: windows-latest + python-version: '3.9' + cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON + - runs-on: windows-2022 + python-version: '3.8' + cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPYBIND11_NUMPY_1_ONLY=ON + - runs-on: windows-2022 + python-version: '3.9' + cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_CXX_STANDARD=14 + # This needs a python built with MTd + # - runs-on: windows-2022 + # python-version: '3.11' + # cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug + - runs-on: windows-2022 + python-version: '3.10' + cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_FLAGS="/GR /EHsc" + - runs-on: windows-2022 + python-version: '3.13' + cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL + - runs-on: windows-latest + python-version: '3.13t' + cmake-args: -DCMAKE_CXX_STANDARD=17 + - runs-on: windows-latest + python-version: '3.14' + cmake-args: -DCMAKE_CXX_STANDARD=20 + - runs-on: windows-latest + python-version: '3.14t' + cmake-args: -DCMAKE_CXX_STANDARD=23 + - runs-on: windows-latest + python-version: 'pypy-3.10' + cmake-args: -DCMAKE_CXX_STANDARD=17 + - runs-on: windows-latest + python-version: 'pypy3.11' + cmake-args: -DCMAKE_CXX_STANDARD=20 + # The setup-python action currently doesn't have graalpy for windows + # See https://github.com/actions/setup-python/pull/880 + + name: 🐍 + uses: ./.github/workflows/reusable-standard.yml + with: + runs-on: ${{ matrix.runs-on }} + python-version: ${{ matrix.python-version }} + cmake-args: ${{ matrix.cmake-args }} + + # This checks inplace builds with C++11 + inplace: + if: github.event.pull_request.draft == false + strategy: + fail-fast: false + matrix: + include: + - runs-on: ubuntu-latest + python-version: '3.9' + - runs-on: macos-latest + python-version: '3.12' + - runs-on: windows-latest + python-version: '3.11' + + name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++14" + runs-on: ${{ matrix.runs-on }} + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v6 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + + - name: Prepare env + run: uv pip install --python=python --system -r tests/requirements.txt + + # TODO Resolve Windows Ninja shared object issue on Python 3.8+ + - name: Use Ninja except on Windows + if: runner.os != 'Windows' + run: echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV" + + # More-or-less randomly adding a few extra flags here. + # In particular, use this one to test the next ABI bump (internals version). + - name: Configure + run: > + cmake -S. -B. + -DPYBIND11_WERROR=ON + -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON + -DPYBIND11_PYTEST_ARGS=-v + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + -DCMAKE_CXX_STANDARD=14 + -DPYBIND11_INTERNALS_VERSION=10000000 + + # Checks to makes sure defining `_` is allowed + # Triggers EHsc missing error on Windows + - name: Add underscore check + if: runner.os != 'Windows' + run: cmake -S. -B. -DCMAKE_CXX_FLAGS="-D_=1" + + - name: Build + run: cmake --build . + + - name: Python tests + run: cmake --build . --target pytest + + - name: Compiled tests + run: cmake --build . --target cpptest + + - name: Interface test + run: cmake --build . --target test_cmake_build + + - name: Visibility test + run: cmake --build . --target test_cross_module_rtti + + + manylinux: + name: Manylinux on 🐍 3.13t • GIL + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + timeout-minutes: 40 + container: quay.io/pypa/musllinux_1_2_x86_64:latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Prepare uv's path + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Install ninja + run: uv tool install ninja + + - name: Configure via preset + run: cmake --preset venv -DPYBIND11_CREATE_WITH_UV=python3.13t + + - name: Build C++11 + run: cmake --build --preset venv + + - name: Python tests C++11 + run: cmake --build --preset testsvenv -t pytest + + deadsnakes: + if: github.event.pull_request.draft == false + strategy: + fail-fast: false + matrix: + include: + # TODO: Fails on 3.10, investigate + # JOB DISABLED (NEEDS WORK): https://github.com/pybind/pybind11/issues/4889 + # - python-version: "3.9" + # python-debug: true + # valgrind: true + - python-version: "3.11" + python-debug: false + + name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64" + runs-on: ubuntu-latest + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v6 + + - name: Setup Python ${{ matrix.python-version }} (deadsnakes) + uses: deadsnakes/action@v3.2.0 + with: + python-version: ${{ matrix.python-version }} + debug: ${{ matrix.python-debug }} + + - name: Update CMake + uses: jwlawson/actions-setup-cmake@v2.0 + + - name: Valgrind cache + if: matrix.valgrind + uses: actions/cache@v4 + id: cache-valgrind + with: + path: valgrind + key: 3.16.1 # Valgrind version + + - name: Compile Valgrind + if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true' + run: | + VALGRIND_VERSION=3.16.1 + curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj + mv valgrind-$VALGRIND_VERSION valgrind + cd valgrind + ./configure + make -j 2 > /dev/null + + - name: Install Valgrind + if: matrix.valgrind + working-directory: valgrind + run: | + sudo make install + sudo apt-get update + sudo apt-get install ninja-build libc6-dbg + + - name: Prepare env + run: | + python -m pip install -r tests/requirements.txt + + - name: Configure + run: cmake --preset default -DCMAKE_CXX_STANDARD=17 + + - name: Build + run: cmake --build --preset default + + - name: Python tests + run: cmake --build --preset default --target pytest + + - name: C++ tests + run: cmake --build --preset default --target cpptest + + - name: Visibility test + run: cmake --build --preset default --target test_cross_module_rtti + + - name: Run Valgrind on Python tests + if: matrix.valgrind + run: cmake --build --preset default --target memcheck + + + # Testing on clang using the excellent silkeh clang docker images + clang: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - clang: 5 + std: 14 + - clang: 11 + std: 20 + - clang: 14 + std: 20 + - clang: 16 + std: 20 + container_suffix: "-bullseye" + - clang: 18 + std: 20 + cxx_flags: "-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" + container_suffix: "-bookworm" + + name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" + container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}" + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v6 + + - name: Add wget and python3 + run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev + + - name: Configure + shell: bash + run: > + cmake -S . -B build + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DCMAKE_CXX_STANDARD=${{ matrix.std }} + -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + + - name: Build + run: cmake --build build -j 2 + + - name: Python tests + run: cmake --build build --target pytest + + - name: C++ tests + run: cmake --build build --target cpptest + + - name: Interface test + run: cmake --build build --target test_cmake_build + + - name: Visibility test + run: cmake --build build --target test_cross_module_rtti + + # Testing NVCC; forces sources to behave like .cu files + cuda: + runs-on: ubuntu-latest + name: "🐍 3.10 • CUDA 12.2 • Ubuntu 22.04" + container: nvidia/cuda:12.2.0-devel-ubuntu22.04 + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v6 + + # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND + - name: Install 🐍 3 + run: apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake git python3-dev python3-pytest python3-numpy + + - name: Configure + run: cmake -S . -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON + + - name: Build + run: cmake --build build -j2 --verbose + + - name: Python tests + run: cmake --build build --target pytest + + +# TODO: Internal compiler error - report to NVidia +# # Testing CentOS 8 + PGI compilers +# centos-nvhpc8: +# runs-on: ubuntu-latest +# name: "🐍 3 • CentOS8 / PGI 20.11 • x64" +# container: centos:8 +# +# steps: +# - uses: actions/checkout@v6 +# +# - name: Add Python 3 and a few requirements +# run: yum update -y && yum install -y git python3-devel python3-numpy python3-pytest make environment-modules +# +# - name: Install CMake with pip +# run: | +# python3 -m pip install --upgrade pip +# python3 -m pip install cmake --prefer-binary +# +# - name: Install NVidia HPC SDK +# run: > +# yum -y install +# https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-20-11-20.11-1.x86_64.rpm +# https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-2020-20.11-1.x86_64.rpm +# +# - name: Configure +# shell: bash +# run: | +# source /etc/profile.d/modules.sh +# module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/20.11 +# cmake -S . -B build -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=14 -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") +# +# - name: Build +# run: cmake --build build -j 2 --verbose +# +# - name: Python tests +# run: cmake --build build --target pytest +# +# - name: C++ tests +# run: cmake --build build --target cpptest +# +# - name: Interface test +# run: cmake --build build --target test_cmake_build + + + # Testing on Ubuntu + NVHPC (previous PGI) compilers, which seems to require more workarounds + ubuntu-nvhpc7: + if: github.event.pull_request.draft == false + runs-on: ubuntu-22.04 + name: "🐍 3 • NVHPC 23.5 • C++17 • x64" + timeout-minutes: 90 + + env: + # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND + DEBIAN_FRONTEND: 'noninteractive' + steps: + - uses: actions/checkout@v6 + + - name: Add NVHPC Repo + run: | + echo 'deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | \ + sudo tee /etc/apt/sources.list.d/nvhpc.list + + - 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 rm -rf /var/lib/apt/lists/* + python3 -m pip install --upgrade pip + python3 -m pip install --upgrade pytest + + # On some systems, you many need further workarounds: + # https://github.com/pybind/pybind11/pull/2475 + - name: Configure + shell: bash + run: | + source /etc/profile.d/modules.sh + module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.5 + cmake -S . -B build -DDOWNLOAD_CATCH=ON \ + -DCMAKE_CXX_STANDARD=17 \ + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \ + -DCMAKE_CXX_FLAGS="-Wc,--pending_instantiations=0" \ + -DPYBIND11_TEST_FILTER="test_smart_ptr.cpp" + + - name: Build + run: cmake --build build -j 2 --verbose + + - name: Python tests + run: cmake --build build --target pytest + + - name: C++ tests + run: cmake --build build --target cpptest + + - name: Interface test + run: cmake --build build --target test_cmake_build + + - name: Visibility test + run: cmake --build build --target test_cross_module_rtti + + # Testing on GCC using the GCC docker images (only recent images supported) + gcc: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - { gcc: 9, std: 20 } + - { gcc: 10, std: 17 } + - { gcc: 10, std: 20 } + - { gcc: 13, std: 20, cxx_flags: "-Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" } + + name: "🐍 3 • GCC ${{ matrix.gcc }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" + container: "gcc:${{ matrix.gcc }}" + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v6 + + - name: Add Python 3 + run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev + + - name: Update pip + run: python3 -m pip install --upgrade pip + + - name: Update CMake + uses: jwlawson/actions-setup-cmake@v2.0 + + - name: Configure + shell: bash + run: > + cmake -S . -B build + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DCMAKE_CXX_STANDARD=${{ matrix.std }} + -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + + - name: Build + run: cmake --build build -j 2 + + - name: Python tests + run: cmake --build build --target pytest + + - name: C++ tests + run: cmake --build build --target cpptest + + - name: Interface test + run: cmake --build build --target test_cmake_build + + - name: Visibility test + run: cmake --build build --target test_cross_module_rtti + + - name: Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE + if: matrix.gcc == '12' + shell: bash + run: > + cmake -S . -B build_partial + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DCMAKE_CXX_STANDARD=${{ matrix.std }} + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" + + - name: Build - Exercise cmake -DPYBIND11_TEST_OVERRIDE + if: matrix.gcc == '12' + run: cmake --build build_partial -j 2 + + - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE + if: matrix.gcc == '12' + run: cmake --build build_partial --target pytest + + # Testing on ICC using the oneAPI apt repo + icc: + if: github.event.pull_request.draft == false + runs-on: ubuntu-22.04 + timeout-minutes: 90 + + name: "🐍 3 • ICC latest • x64" + + steps: + - uses: actions/checkout@v6 + + - name: Add apt repo + run: | + sudo apt-get update + sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + + - name: Add ICC & Python 3 + run: sudo apt-get update; sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic cmake python3-dev python3-numpy python3-pytest python3-pip + + - name: Update pip + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + python3 -m pip install --upgrade pip + + - name: Install dependencies + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + python3 -m pip install -r tests/requirements.txt + + - name: Configure C++11 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake -S . -B build-11 \ + -DPYBIND11_WERROR=ON \ + -DDOWNLOAD_CATCH=ON \ + -DDOWNLOAD_EIGEN=OFF \ + -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_CXX_COMPILER=$(which icpc) \ + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + + - name: Build C++11 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake --build build-11 -j 2 -v + + - name: Python tests C++11 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + sudo service apport stop + cmake --build build-11 --target check + + - name: C++ tests C++11 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake --build build-11 --target cpptest + + - name: Interface test C++11 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake --build build-11 --target test_cmake_build + + - name: Visibility test + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake --build build-11 --target test_cross_module_rtti + + - name: Configure C++17 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake -S . -B build-17 \ + -DPYBIND11_WERROR=ON \ + -DDOWNLOAD_CATCH=ON \ + -DDOWNLOAD_EIGEN=OFF \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_COMPILER=$(which icpc) \ + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + + - name: Build C++17 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake --build build-17 -j 2 -v + + - name: Python tests C++17 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + sudo service apport stop + cmake --build build-17 --target check + + - name: C++ tests C++17 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake --build build-17 --target cpptest + + - name: Interface test C++17 + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake --build build-17 --target test_cmake_build + + - name: Visibility test + run: | + set +e; source /opt/intel/oneapi/setvars.sh; set -e + cmake --build build-17 --target test_cross_module_rtti + + # Testing on CentOS (manylinux uses a centos base). + centos: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + container: + - "almalinux:8" + - "almalinux:9" + + name: "🐍 3 • ${{ matrix.container }} • x64" + container: "${{ matrix.container }}" + timeout-minutes: 90 + + steps: + - name: Latest actions/checkout + uses: actions/checkout@v6 + + - name: Add Python 3.8 + if: matrix.container == 'almalinux:8' + run: dnf update -y && dnf install -y python38-devel gcc-c++ make git + + - name: Add Python 3 (default) + if: matrix.container != 'almalinux:8' + run: dnf update -y && dnf install -y python3-devel gcc-c++ make git + + - name: Update pip + run: python3 -m pip install --upgrade pip + + - name: Install dependencies + run: | + python3 -m pip install cmake -r tests/requirements.txt + + - name: Ensure NumPy 2 is used (required Python >= 3.9) + if: matrix.container == 'almalinux:9' + run: | + python3 -m pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1' + + - name: Configure + shell: bash + run: > + cmake -S . -B build + -DCMAKE_BUILD_TYPE=MinSizeRel + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + -DCMAKE_CXX_STANDARD=11 + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + + - name: Build + run: cmake --build build -j 2 + + - name: Python tests + run: cmake --build build --target pytest + + - name: C++ tests + run: cmake --build build --target cpptest + + - name: Interface test + run: cmake --build build --target test_cmake_build + + - name: Visibility test + run: cmake --build build --target test_cross_module_rtti + + + # This tests an "install" with the CMake tools + install-classic: + if: github.event.pull_request.draft == false + name: "🐍 3.9 • Debian • x86 • Install" + runs-on: ubuntu-latest + container: i386/debian:bullseye + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v1 # v1 is required to run inside docker + + - name: Install requirements + run: | + apt-get update + apt-get install -y git make cmake g++ libeigen3-dev python3-dev python3-pip + pip3 install "pytest==6.*" + + - name: Configure for install + run: > + cmake . + -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + + - name: Make and install + run: make install + + - name: Copy tests to new directory + run: cp -a tests /pybind11-tests + + - name: Make a new test directory + run: mkdir /build-tests + + - name: Configure tests + run: > + cmake ../pybind11-tests + -DDOWNLOAD_CATCH=ON + -DPYBIND11_WERROR=ON + -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") + working-directory: /build-tests + + - name: Python tests + run: make pytest -j 2 + working-directory: /build-tests + + + # This verifies that the documentation is not horribly broken, and does a + # basic validation check on the SDist. + doxygen: + if: github.event.pull_request.draft == false + name: "Documentation build test" + runs-on: ubuntu-latest + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-python@v6 + with: + python-version: "3.x" + + - name: Install Doxygen + run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04 + + - name: Build docs + run: pipx run nox -s docs + + - name: Make SDist + run: pipx run nox -s build -- --sdist + + - run: git status --ignored + + - name: Check local include dir + run: > + ls pybind11; + python3 -c "import pybind11, pathlib; assert (a := pybind11.get_include()) == (b := str(pathlib.Path('include').resolve())), f'{a} != {b}'" + + - name: Compare Dists (headers only) + working-directory: include + run: | + python3 -m pip install --user -U ../dist/*.tar.gz + installed=$(python3 -c "import pybind11; print(pybind11.get_include() + '/pybind11')") + diff -rq $installed ./pybind11 + + win32: + if: github.event.pull_request.draft == false + strategy: + fail-fast: false + matrix: + include: + - python: '3.8' + args: -DCMAKE_CXX_STANDARD=17 + - python: '3.10' + args: -DCMAKE_CXX_STANDARD=20 + - python: '3.13' + + + name: "🐍 ${{ matrix.python }} • MSVC 2022 • x86 ${{ matrix.args }}" + runs-on: windows-2022 + timeout-minutes: 90 -# runs-on: "${{ matrix.os }}" -# timeout-minutes: 90 + steps: + - uses: actions/checkout@v6 -# name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest" + - name: Setup Python ${{ matrix.python }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python }} + architecture: x86 + # Python 3.13.4 broken on Windows + check-latest: >- + ${{ matrix.python == '3.13' && runner.os == 'Windows' }} -# steps: -# - name: Show env -# run: env + - name: Update CMake + uses: jwlawson/actions-setup-cmake@v2.0 -# - name: Checkout -# uses: actions/checkout@v6 + - name: Prepare MSVC + uses: ilammy/msvc-dev-cmd@v1.13.0 + with: + arch: x86 -# - name: Set up Clang -# uses: egor-tensin/setup-clang@v1 + - name: Prepare env + run: | + python -m pip install -r tests/requirements.txt -# - name: Setup Python ${{ matrix.python }} -# uses: actions/setup-python@v6 -# with: -# python-version: ${{ matrix.python }} + - name: Configure ${{ matrix.args }} + run: > + cmake -S . -B build + -G "Visual Studio 17 2022" -A Win32 + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + ${{ matrix.args }} + - name: Build C++11 + run: cmake --build build -j 2 -# - name: Update CMake -# uses: jwlawson/actions-setup-cmake@v2.0 + - name: Python tests + run: cmake --build build -t pytest -# - name: Install ninja-build tool -# uses: seanmiddleditch/gha-setup-ninja@v6 + win32-debug: + if: github.event.pull_request.draft == false + strategy: + fail-fast: false + matrix: + include: + - python: 3.9 + args: -DCMAKE_CXX_STANDARD=20 + - python: 3.8 + args: -DCMAKE_CXX_STANDARD=17 + + name: "🐍 ${{ matrix.python }} • MSVC 2022 (Debug) • x86 ${{ matrix.args }}" + runs-on: windows-2022 + timeout-minutes: 90 -# - name: Run pip installs -# run: | -# python -m pip install --upgrade pip -# python -m pip install -r tests/requirements.txt + steps: + - uses: actions/checkout@v6 -# - name: Show Clang++ version -# run: clang++ --version + - name: Setup Python ${{ matrix.python }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python }} + architecture: x86 -# - name: Show CMake version -# run: cmake --version + - name: Update CMake + uses: jwlawson/actions-setup-cmake@v2.0 -# # TODO: WERROR=ON -# - name: Configure Clang -# 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=17 + - name: Prepare MSVC + uses: ilammy/msvc-dev-cmd@v1.13.0 + with: + arch: x86 -# - name: Build -# run: cmake --build . -j 2 + - name: Prepare env + run: | + python -m pip install -r tests/requirements.txt -# - name: Python tests -# run: cmake --build . --target pytest -j 2 + - name: Configure ${{ matrix.args }} + run: > + cmake -S . -B build + -G "Visual Studio 17 2022" -A Win32 + -DCMAKE_BUILD_TYPE=Debug + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + ${{ matrix.args }} + - name: Build C++11 + run: cmake --build build --config Debug -j 2 -# - name: C++ tests -# run: cmake --build . --target cpptest -j 2 + - name: Python tests + run: cmake --build build --config Debug -t pytest -# - 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 + windows-2022: + if: github.event.pull_request.draft == false + strategy: + fail-fast: false + matrix: + python: + - 3.9 + + name: "🐍 ${{ matrix.python }} • MSVC 2022 C++20 • x64" + runs-on: windows-2022 + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v6 + + - name: Setup Python ${{ matrix.python }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python }} + + - name: Prepare env + run: python3 -m pip install -r tests/requirements.txt + + - name: Update CMake + uses: jwlawson/actions-setup-cmake@v2.0 + + - name: Configure C++20 + run: > + cmake -S . -B build + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + -DCMAKE_CXX_STANDARD=20 + + - name: Build C++20 + run: cmake --build build -j 2 + + - name: Python tests + run: cmake --build build --target pytest + + - name: C++20 tests + run: cmake --build build --target cpptest -j 2 + + - name: Interface test C++20 + run: cmake --build build --target test_cmake_build + + - name: Visibility test + run: cmake --build build --target test_cross_module_rtti + + - name: Configure C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE + run: > + cmake -S . -B build_partial + -DPYBIND11_WERROR=ON + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + -DCMAKE_CXX_STANDARD=20 + "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" + + - name: Build C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE + run: cmake --build build_partial -j 2 + + - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE + run: cmake --build build_partial --target pytest + + mingw: + if: github.event.pull_request.draft == false + name: "🐍 3 • windows-latest • ${{ matrix.sys }}" + runs-on: windows-latest + timeout-minutes: 90 + defaults: + run: + shell: msys2 {0} + strategy: + fail-fast: false + matrix: + include: + - sys: mingw32 + env: i686 + extra_install: "" + - sys: mingw64 + env: x86_64 + extra_install: | + mingw-w64-x86_64-python-numpy + mingw-w64-x86_64-python-scipy + mingw-w64-x86_64-eigen3 + steps: + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.sys}} + install: >- + git + mingw-w64-${{matrix.env}}-gcc + mingw-w64-${{matrix.env}}-python-pip + mingw-w64-${{matrix.env}}-cmake + mingw-w64-${{matrix.env}}-make + mingw-w64-${{matrix.env}}-python-pytest + mingw-w64-${{matrix.env}}-boost + mingw-w64-${{matrix.env}}-catch + ${{ matrix.extra_install }} + + - uses: actions/checkout@v6 + + - name: Configure C++11 + # LTO leads to many undefined reference like + # `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&) + run: >- + cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON + -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") + -S . -B build + + - name: Build C++11 + run: cmake --build build -j 2 + + - name: Python tests C++11 + run: cmake --build build --target pytest -j 2 + + - name: C++11 tests + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 2 + + - name: Interface test C++11 + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cmake_build + + - name: Visibility test + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cross_module_rtti + + - name: Clean directory + run: git clean -fdx + + - name: Configure C++14 + run: >- + cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON + -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") + -S . -B build2 + + - name: Build C++14 + run: cmake --build build2 -j 2 + + - name: Python tests C++14 + run: cmake --build build2 --target pytest -j 2 + + - name: C++14 tests + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target cpptest -j 2 + + - name: Interface test C++14 + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cmake_build + + - name: Visibility test + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cross_module_rtti + + - name: Clean directory + run: git clean -fdx + + - name: Configure C++17 + run: >- + cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON + -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") + -S . -B build3 + + - name: Build C++17 + run: cmake --build build3 -j 2 + + - name: Python tests C++17 + run: cmake --build build3 --target pytest -j 2 + + - name: C++17 tests + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target cpptest -j 2 + + - name: Interface test C++17 + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cmake_build + + - name: Visibility test + run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cross_module_rtti + + windows_clang: + if: github.event.pull_request.draft == false + + strategy: + matrix: + os: [windows-latest] + python: ['3.10'] + + runs-on: "${{ matrix.os }}" + timeout-minutes: 90 + + name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest" + + steps: + - name: Show env + run: env + + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Clang + uses: egor-tensin/setup-clang@v1 + + - name: Setup Python ${{ matrix.python }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python }} + + - name: Update CMake + uses: jwlawson/actions-setup-cmake@v2.0 + + - name: Install ninja-build tool + uses: seanmiddleditch/gha-setup-ninja@v6 + + - name: Run pip installs + run: | + python -m pip install --upgrade pip + python -m pip install -r tests/requirements.txt + + - name: Show Clang++ version + run: clang++ --version + + - name: Show CMake version + run: cmake --version + + # TODO: WERROR=ON + - name: Configure Clang + 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=17 + + - name: Build + run: cmake --build . -j 2 + + - name: Python tests + run: cmake --build . --target pytest -j 2 + + - name: C++ tests + 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 -# - name: Clean directory -# run: git clean -fdx + - name: Clean directory + run: git clean -fdx windows_arm: if: github.event.pull_request.draft == false From d370ce368214e9c8b8ead2c31ba0321f255ab9a6 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Thu, 11 Dec 2025 14:40:41 -0600 Subject: [PATCH 10/15] removing windows-11-arm from big test, push --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3fcf4d702..a2e2af03d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,6 @@ name: CI on: workflow_dispatch: - push: pull_request: types: - opened @@ -57,9 +56,6 @@ jobs: - runs-on: windows-2022 python-version: '3.8' cmake-args: -DPYBIND11_FINDPYTHON=OFF - - runs-on: windows-11-arm - python-version: '3.11' - cmake-args: -DCMAKE_CXX_STANDARD=17 name: 🐍 From b23e3f9ed64f5bfb6626deb0e52a4903c3b4917c Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Thu, 11 Dec 2025 15:52:20 -0600 Subject: [PATCH 11/15] removing redundant shell --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2e2af03d3..700ff3692c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1248,7 +1248,6 @@ jobs: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_STANDARD=20 -DPython_ROOT_DIR="$env:Python_ROOT_DIR" - shell: pwsh - name: Build run: cmake --build . -j 2 From 6d2119057fc1c28924120ce20ae6918ec78284df Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Fri, 12 Dec 2025 14:06:02 -0600 Subject: [PATCH 12/15] removing trailing whitespace --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 700ff3692c..e9aeeaa0a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1292,7 +1292,7 @@ jobs: mingw-w64-clang-aarch64-python-pip mingw-w64-clang-aarch64-python-pytest mingw-w64-clang-aarch64-python-numpy - + - name: Debug info run: | clang++ --version From 832a6ab5901a1a8de9e42bc63e72d1d3bb290c5e Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 12 Dec 2025 20:28:51 -0800 Subject: [PATCH 13/15] Clarify Windows ARM clang job naming Rename the Windows ARM clang jobs to windows_arm_clang_msvc and windows_arm_clang_msys2 and adjust their display names to clang-msvc / clang-msys2. The first runs clang against the MSVC/Windows SDK toolchain and python.org CPython for Windows ARM, while the second runs clang inside the MSYS2/MinGW-w64 CLANGARM64 environment with MSYS2 Python. Using clearly distinguished job names makes it easier to discuss failures and behavior in each environment without ambiguity, both in logs and in PR review discussions. --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9aeeaa0a0..3f54a919d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1206,7 +1206,8 @@ jobs: - name: Clean directory run: git clean -fdx - windows_arm: + # Clang with MSVC/Windows SDK toolchain + python.org CPython (Windows ARM) + windows_arm_clang_msvc: if: github.event.pull_request.draft == false strategy: @@ -1218,7 +1219,7 @@ jobs: runs-on: "${{ matrix.os }}" timeout-minutes: 90 - name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang" + name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-msvc" steps: - name: Show env @@ -1264,13 +1265,14 @@ jobs: - name: Visibility test run: cmake --build . --target test_cross_module_rtti -j 2 - windows_arm_msys2: + # Clang in MSYS2/MinGW-w64 CLANGARM64 toolchain + MSYS2 Python (Windows ARM) + windows_arm_clang_msys2: if: github.event.pull_request.draft == false runs-on: windows-11-arm timeout-minutes: 90 - name: "🐍 3.12 • windows-11-arm • clang • msys2" + name: "🐍 3.12 • windows-11-arm • clang-msys2" defaults: run: From 40a932130e04bad4342e1489958daee371931921 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 12 Dec 2025 21:03:26 -0800 Subject: [PATCH 14/15] Reduce Windows ARM clang matrix size Limit the windows_arm_clang_msvc job to Python 3.13 and the windows_arm_clang_msys2 job to Python 3.12 to stay within our constrained GitHub Actions resources. Keep both jobs using a matrix over os and python so their structure stays aligned and it remains easy to expand coverage when needed. --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f54a919d8..313f5e0f4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1214,7 +1214,7 @@ jobs: fail-fast: false matrix: os: [windows-11-arm] - python: ['3.11', '3.12', '3.13', '3.14'] + python: ['3.13'] runs-on: "${{ matrix.os }}" timeout-minutes: 90 @@ -1269,10 +1269,16 @@ jobs: windows_arm_clang_msys2: if: github.event.pull_request.draft == false - runs-on: windows-11-arm + strategy: + fail-fast: false + matrix: + os: [windows-11-arm] + python: ['3.12'] + + runs-on: "${{ matrix.os }}" timeout-minutes: 90 - name: "🐍 3.12 • windows-11-arm • clang-msys2" + name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-msys2" defaults: run: From c727eef5a60546e63cc475a71d5df8610c5d0d8c Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 12 Dec 2025 23:22:38 -0800 Subject: [PATCH 15/15] Remove matrix.python from windows_arm_clang_msys2 job: the Python version is determined by the msys2/setup-msys2 action and cannot be changed --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 313f5e0f4b..d00ee6d27e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1273,12 +1273,11 @@ jobs: fail-fast: false matrix: os: [windows-11-arm] - python: ['3.12'] runs-on: "${{ matrix.os }}" timeout-minutes: 90 - name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-msys2" + name: "${{ matrix.os }} • clang-msys2" defaults: run: