Merge branch 'master' into henryiii-patch-3

This commit is contained in:
Henry Schreiner
2025-12-03 01:41:37 -05:00
committed by GitHub
102 changed files with 2260 additions and 587 deletions

View File

@@ -96,22 +96,22 @@ jobs:
python-version: 'graalpy-24.1'
# No SciPy for macOS ARM
- runs-on: macos-13
- runs-on: macos-15-intel
python-version: '3.8'
cmake-args: -DCMAKE_CXX_STANDARD=14
- runs-on: macos-13
- 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-13
- 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-13
- runs-on: macos-15-intel
python-version: 'pypy-3.10'
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: macos-latest
@@ -179,18 +179,19 @@ jobs:
name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++14"
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
@@ -202,7 +203,8 @@ jobs:
if: runner.os != 'Windows'
run: echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV"
# More-or-less randomly adding a few extra flags here
# 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.
@@ -212,6 +214,7 @@ jobs:
-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
@@ -242,7 +245,7 @@ jobs:
timeout-minutes: 40
container: quay.io/pypa/musllinux_1_2_x86_64:latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
@@ -277,9 +280,10 @@ jobs:
name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64"
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python-version }} (deadsnakes)
uses: deadsnakes/action@v3.2.0
@@ -364,9 +368,10 @@ jobs:
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@v4
- 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
@@ -401,9 +406,10 @@ jobs:
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@v4
- uses: actions/checkout@v6
# tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
- name: Install 🐍 3
@@ -427,7 +433,7 @@ jobs:
# container: centos:8
#
# steps:
# - uses: actions/checkout@v4
# - 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
@@ -468,12 +474,13 @@ jobs:
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@v4
- uses: actions/checkout@v6
- name: Add NVHPC Repo
run: |
@@ -532,9 +539,10 @@ jobs:
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@v4
- 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
@@ -593,11 +601,12 @@ jobs:
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@v4
- uses: actions/checkout@v6
- name: Add apt repo
run: |
@@ -707,10 +716,11 @@ jobs:
name: "🐍 3 • ${{ matrix.container }} • x64"
container: "${{ matrix.container }}"
timeout-minutes: 90
steps:
- name: Latest actions/checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Add Python 3.8
if: matrix.container == 'almalinux:8'
@@ -765,6 +775,7 @@ jobs:
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
@@ -809,11 +820,12 @@ jobs:
if: github.event.pull_request.draft == false
name: "Documentation build test"
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: "3.x"
@@ -855,12 +867,13 @@ jobs:
name: "🐍 ${{ matrix.python }} • MSVC 2022 • x86 ${{ matrix.args }}"
runs-on: windows-2022
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
architecture: x86
@@ -907,12 +920,13 @@ jobs:
name: "🐍 ${{ matrix.python }} • MSVC 2022 (Debug) • x86 ${{ matrix.args }}"
runs-on: windows-2022
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
architecture: x86
@@ -955,12 +969,13 @@ jobs:
name: "🐍 ${{ matrix.python }} • MSVC 2022 C++20 • x64"
runs-on: windows-2022
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
@@ -1012,6 +1027,7 @@ jobs:
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}
@@ -1019,8 +1035,15 @@ jobs:
fail-fast: false
matrix:
include:
- { sys: mingw64, env: x86_64 }
- { sys: mingw32, env: i686 }
- 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:
@@ -1034,17 +1057,9 @@ jobs:
mingw-w64-${{matrix.env}}-python-pytest
mingw-w64-${{matrix.env}}-boost
mingw-w64-${{matrix.env}}-catch
${{ matrix.extra_install }}
- uses: msys2/setup-msys2@v2
if: matrix.sys == 'mingw64'
with:
msystem: ${{matrix.sys}}
install: >-
mingw-w64-${{matrix.env}}-python-numpy
mingw-w64-${{matrix.env}}-python-scipy
mingw-w64-${{matrix.env}}-eigen3
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Configure C++11
# LTO leads to many undefined reference like
@@ -1126,6 +1141,7 @@ jobs:
python: ['3.10']
runs-on: "${{ matrix.os }}"
timeout-minutes: 90
name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest"
@@ -1134,13 +1150,13 @@ jobs:
run: env
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
@@ -1189,91 +1205,3 @@ jobs:
- name: Clean directory
run: git clean -fdx
macos_brew_install_llvm:
if: github.event.pull_request.draft == false
name: "macos-13 • brew install llvm"
runs-on: macos-13
env:
# https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew
LDFLAGS: '-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib'
steps:
- name: Update PATH
run: echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
- name: Show env
run: env
- name: Checkout
uses: actions/checkout@v4
- name: Show Clang++ version before brew install llvm
run: clang++ --version
- name: brew install llvm
run: brew install llvm
- name: Show Clang++ version after brew install llvm
run: clang++ --version
- name: Update CMake
uses: jwlawson/actions-setup-cmake@v2.0
- name: Run pip installs
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r tests/requirements.txt
python3 -m pip install numpy
python3 -m pip install scipy
- name: Show CMake version
run: cmake --version
- name: CMake Configure
run: >
cmake -S . -B .
-DPYBIND11_WERROR=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
- 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: CMake Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE
run: >
cmake -S . -B build_partial
-DPYBIND11_WERROR=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=17
-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
run: cmake --build build_partial -j 2
- name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE
run: cmake --build build_partial --target pytest -j 2
- name: Clean directory
run: git clean -fdx

View File

@@ -35,7 +35,7 @@ jobs:
- runs-on: ubuntu-24.04
cmake: "3.29"
- runs-on: macos-13
- runs-on: macos-15-intel
cmake: "3.15"
- runs-on: macos-14
@@ -48,15 +48,15 @@ jobs:
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.11
- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
- name: Prepare env
run: uv pip install --python=python --system -r tests/requirements.txt

View File

@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Check for docs changes
id: docs_changes

View File

@@ -25,8 +25,8 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Add matchers
@@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
container: silkeh/clang:20
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install requirements
run: apt-get update && apt-get install -y git python3-dev python3-pytest ninja-build

View File

@@ -14,7 +14,7 @@ jobs:
pull-requests: write
steps:
- uses: actions/labeler@v5
- uses: actions/labeler@v6
if: >
github.event.pull_request.merged == true &&
!startsWith(github.event.pull_request.title, 'chore(deps):') &&

View File

@@ -20,12 +20,12 @@ jobs:
if: github.repository_owner == 'pybind'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
- name: Build SDist and wheels
run: |
@@ -33,7 +33,7 @@ jobs:
nox -s build
nox -s build_global
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: Packages
path: dist/*
@@ -44,7 +44,7 @@ jobs:
needs: [build_wheel]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v5
- uses: actions/download-artifact@v6
with:
name: Packages
path: dist

View File

@@ -23,15 +23,15 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup 🐍 3.8
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.8
- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
- name: Prepare env
run: uv pip install --system -r tests/requirements.txt
@@ -47,15 +47,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup 🐍 3.8
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.8
- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
- name: Prepare env
run: uv pip install --system -r tests/requirements.txt twine nox
@@ -72,13 +72,13 @@ jobs:
run: twine check dist/*
- name: Save standard package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: standard
path: dist/pybind11-*
- name: Save global package
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: global
path: dist/*global-*
@@ -100,10 +100,10 @@ jobs:
steps:
# Downloads all to directories matching the artifact names
- uses: actions/download-artifact@v5
- uses: actions/download-artifact@v6
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v2
uses: actions/attest-build-provenance@v3
with:
subject-path: "*/pybind11*"

View File

@@ -28,12 +28,13 @@ jobs:
standard:
name: 🧪
runs-on: ${{ inputs.runs-on }}
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true
@@ -50,7 +51,7 @@ jobs:
run: brew install boost
- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

View File

@@ -17,12 +17,12 @@ jobs:
name: Pyodide wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 0
- uses: pypa/cibuildwheel@v3.1
- uses: pypa/cibuildwheel@v3.3
env:
PYODIDE_BUILD_EXPORTS: whole_archive
with:
@@ -35,16 +35,17 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on: [macos-14, macos-13]
runs-on: [macos-14, macos-15-intel]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 0
- run: brew upgrade cmake
# We have to uninstall first because GH is now using a local tap to build cmake<4, iOS needs cmake>=4
- run: brew uninstall cmake && brew install cmake
- uses: pypa/cibuildwheel@v3.1
- uses: pypa/cibuildwheel@v3.3
env:
CIBW_PLATFORM: ios
with:
@@ -56,9 +57,9 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on: [macos-latest, macos-13, ubuntu-latest]
runs-on: [macos-latest, macos-15-intel, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 0
@@ -68,6 +69,14 @@ jobs:
if: contains(matrix.runs-on, 'macos')
run: echo "CIBW_TEST_COMMAND=" >> "$GITHUB_ENV"
# Temporarily disable Android tests on ubuntu-latest due to emulator issues.
# See https://github.com/pybind/pybind11/pull/5914.
- name: "NOTE: Android tests are disabled on ubuntu-latest"
if: contains(matrix.runs-on, 'ubuntu')
run: |
echo "CIBW_TEST_COMMAND=" >> "$GITHUB_ENV"
echo '::warning::Android cibuildwheel tests are disabled on ubuntu-latest (CIBW_TEST_COMMAND is empty). See PR 5914.'
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
- name: Enable KVM for Android emulator
if: contains(matrix.runs-on, 'ubuntu')
@@ -78,7 +87,7 @@ jobs:
- run: pipx install patchelf
- uses: pypa/cibuildwheel@v3.1
- uses: pypa/cibuildwheel@v3.3
env:
CIBW_PLATFORM: android
with:

View File

@@ -24,10 +24,10 @@ jobs:
if: "contains(github.event.pull_request.labels.*.name, 'python dev')"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Python 3.13
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.13"
allow-prereleases: true