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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ build_script:
- cmake -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
-DPython_ROOT_DIR="%PYTHON_ROOT%"
-DCMAKE_MAP_IMPORTED_CONFIG_DEBUG=Release
-DCMAKE_CXX_STANDARD=14
-DCMAKE_CXX_STANDARD=17
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DCMAKE_SUPPRESS_REGENERATION=1
Expand Down
152 changes: 38 additions & 114 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
include:
- runs-on: ubuntu-22.04
python-version: '3.9'
cmake-args: -DPYBIND11_FINDPYTHON=OFF -DPYBIND11_NUMPY_1_ONLY=ON
cmake-args: -DPYBIND11_FINDPYTHON=OFF
- runs-on: ubuntu-latest
python-version: '3.13'
cmake-args: -DCMAKE_CXX_STANDARD=23 -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
Expand All @@ -58,7 +58,7 @@ jobs:
cmake-args: -DCMAKE_CXX_STANDARD=20
- runs-on: macos-latest
python-version: '3.14'
cmake-args: -DCMAKE_CXX_STANDARD=14
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: windows-2022
python-version: '3.9'
cmake-args: -DPYBIND11_FINDPYTHON=OFF
Expand Down Expand Up @@ -88,18 +88,18 @@ jobs:
cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
- runs-on: ubuntu-latest
python-version: '3.14'
cmake-args: -DCMAKE_CXX_STANDARD=14
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: ubuntu-latest
python-version: '3.15t'
cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON

# No SciPy for macOS ARM
- runs-on: macos-15-intel
python-version: '3.9'
cmake-args: -DCMAKE_CXX_STANDARD=14
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: macos-15-intel
python-version: '3.13'
cmake-args: -DCMAKE_CXX_STANDARD=11
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: macos-latest
python-version: '3.12'
cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
Expand All @@ -119,7 +119,7 @@ jobs:
cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON
- runs-on: windows-2022
python-version: '3.9'
cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPYBIND11_NUMPY_1_ONLY=ON
cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
# This needs a python built with MTd
# - runs-on: windows-2022
# python-version: '3.11'
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cmake-args: ${{ matrix.cmake-args }}

# This checks inplace builds with C++11
# This checks inplace builds with C++17.
inplace:
if: github.event.pull_request.draft == false
strategy:
Expand All @@ -166,7 +166,7 @@ jobs:
- runs-on: windows-latest
python-version: '3.11'

name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++14"
name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++17"
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 90

Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=14
-DCMAKE_CXX_STANDARD=17
-DPYBIND11_INTERNALS_VERSION=10000000

# Checks to makes sure defining `_` is allowed
Expand Down Expand Up @@ -254,12 +254,15 @@ jobs:
run: uv tool install ninja

- name: Configure via preset
run: cmake --preset venv -DPYBIND11_CREATE_WITH_UV="${{ matrix.python-version }}"
run: >
cmake --preset venv
-DPYBIND11_CREATE_WITH_UV="${{ matrix.python-version }}"
-DCMAKE_CXX_STANDARD=17

- name: Build C++11
- name: Build C++17
run: cmake --build --preset venv

- name: Python tests C++11
- name: Python tests C++17
run: cmake --build --preset testsvenv -t pytest

# Testing on clang using the excellent silkeh clang docker images
Expand All @@ -270,10 +273,11 @@ jobs:
fail-fast: false
matrix:
include:
- clang: 5
std: 14
# Clang 11 is the oldest LLVM toolchain available on a Debian base
# that meets pybind11's current Python and CMake requirements.
- clang: 11
std: 20
std: 17
container_suffix: "-bullseye"
- clang: 16
std: 20
container_suffix: "-bullseye"
Expand Down Expand Up @@ -333,7 +337,12 @@ jobs:
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
run: >
cmake -S . -B build
-DPYBIND11_CUDA_TESTS=ON
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DCMAKE_CXX_STANDARD=17

- name: Build
run: cmake --build build -j2 --verbose
Expand Down Expand Up @@ -371,7 +380,7 @@ jobs:
# 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)")
# cmake -S . -B build -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=17 -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
#
# - name: Build
# run: cmake --build build -j 2 --verbose
Expand Down Expand Up @@ -536,44 +545,6 @@ jobs:
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
timeout-minutes: 3
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
Expand Down Expand Up @@ -659,7 +630,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=11
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
Expand Down Expand Up @@ -701,6 +672,7 @@ jobs:
run: >
cmake .
-DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Make and install
Expand All @@ -717,6 +689,7 @@ jobs:
cmake ../pybind11-tests
-DDOWNLOAD_CATCH=ON
-DPYBIND11_WERROR=ON
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
working-directory: /build-tests

Expand Down Expand Up @@ -772,6 +745,7 @@ jobs:
- python: '3.9'
args: -DCMAKE_CXX_STANDARD=17
- python: '3.13'
args: -DCMAKE_CXX_STANDARD=17


name: "🐍 ${{ matrix.python }} • MSVC 2022 • x86 ${{ matrix.args }}"
Expand Down Expand Up @@ -810,7 +784,7 @@ jobs:
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
${{ matrix.args }}
- name: Build C++11
- name: Build C++17
run: cmake --build build -j 2

- name: Python tests
Expand Down Expand Up @@ -859,7 +833,7 @@ jobs:
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
${{ matrix.args }}
- name: Build C++11
- name: Build C++20
run: cmake --build build --config Debug -j 2

- name: Python tests
Expand Down Expand Up @@ -969,80 +943,30 @@ jobs:

- uses: actions/checkout@v7

- name: Configure C++11
- name: Configure C++17
# 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
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 build

- name: Build C++11
- name: Build C++17
run: cmake --build build -j 2

- name: Python tests C++11
- name: Python tests C++17
run: cmake --build build --target pytest -j 2

- name: C++11 tests
- name: C++17 tests
timeout-minutes: 3
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 2

- name: Interface test C++11
- name: Interface test C++17
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
timeout-minutes: 3
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
timeout-minutes: 3
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

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ jobs:
# These steps use a directory with a space in it intentionally
- name: Configure
shell: bash
run: cmake -S. -B"build dir" -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
run: >
cmake -S. -B"build dir"
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DCMAKE_CXX_STANDARD=17

# Only build and test if this was manually triggered in the GitHub UI
- name: Build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=${{ steps.python.outputs.python-path }}
${{ inputs.cmake-args }}

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests-cibw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CIBW_CONFIG_SETTINGS: "cmake.define.CMAKE_CXX_STANDARD=17"

jobs:
build-wasm-emscripten:
name: Pyodide wheel
Expand Down
Loading
Loading