Skip to content

Commit

Permalink
Merge branch 'pybind11clif_main' into functional_type_caster_rvpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Aug 29, 2024
2 parents b456ffb + 0bf3e8e commit f31d28a
Show file tree
Hide file tree
Showing 246 changed files with 5,110 additions and 5,492 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ platform:
- x86
environment:
matrix:
- PYTHON: 36
- PYTHON: 38
CONFIG: Debug
install:
- ps: |
Expand Down
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ Checks: |
readability-string-compare,
readability-suspicious-call-argument,
readability-uniqueptr-delete-release,
-bugprone-chained-comparison,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-reserved-identifier,
-bugprone-unused-raii,
-performance-enum-size,
CheckOptions:
- key: modernize-use-equals-default.IgnoreMacros
Expand Down
10 changes: 5 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ nox -s build
### Full setup

To setup an ideal development environment, run the following commands on a
system with CMake 3.14+:
system with CMake 3.15+:

```bash
python3 -m venv venv
Expand All @@ -96,8 +96,8 @@ Tips:
* You can use `virtualenv` (faster, from PyPI) instead of `venv`.
* You can select any name for your environment folder; if it contains "env" it
will be ignored by git.
* If you don't have CMake 3.14+, just add "cmake" to the pip install command.
* You can use `-DPYBIND11_FINDPYTHON=ON` to use FindPython on CMake 3.12+
* If you don't have CMake 3.15+, just add "cmake" to the pip install command.
* You can use `-DPYBIND11_FINDPYTHON=ON` to use FindPython.
* In classic mode, you may need to set `-DPYTHON_EXECUTABLE=/path/to/python`.
FindPython uses `-DPython_ROOT_DIR=/path/to` or
`-DPython_EXECUTABLE=/path/to/python`.
Expand Down Expand Up @@ -149,8 +149,8 @@ To run the tests, you can "build" the check target:
cmake --build build --target check
```

`--target` can be spelled `-t` in CMake 3.15+. You can also run individual
tests with these targets:
`--target` can be spelled `-t`. You can also run individual tests with these
targets:

* `pytest`: Python tests only, using the
[pytest](https://docs.pytest.org/en/stable/) framework
Expand Down
15 changes: 10 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
docs:
- any:
- 'docs/**/*.rst'
- '!docs/changelog.rst'
- '!docs/upgrade.rst'
all:
- changed-files:
- all-globs-to-all-files:
- '!docs/changelog.rst'
- '!docs/upgrade.rst'
- base-branch: "^(?!dependabot).*"
- base-branch: "^(?!pre-commit-ci).*"

ci:
- '.github/workflows/*.yml'
- changed-files:
- any-glob-to-any-file:
- '.github/workflows/*.yml'
9 changes: 7 additions & 2 deletions .github/labeler_merged.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Add 'needs changelog` label to any change to code files as long as the `CHANGELOG` hasn't changed
# Skip dependabot and pre-commit-ci PRs
needs changelog:
- all:
- '!docs/changelog.rst'
- all:
- changed-files:
- all-globs-to-all-files: "!docs/changelog.rst"
- base-branch: "^(?!dependabot).*"
- base-branch: "^(?!pre-commit-ci).*"
136 changes: 86 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-20.04, windows-2022, macos-latest]
runs-on: [ubuntu-20.04, windows-2022, macos-13]
python:
- '3.6'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- 'pypy-3.8'
- 'pypy-3.9'
- 'pypy-3.10'
Expand All @@ -50,21 +49,37 @@ jobs:
include:
# Just add a key
- runs-on: ubuntu-20.04
python: '3.6'
python: '3.8'
args: >
-DPYBIND11_FINDPYTHON=ON
-DCMAKE_CXX_FLAGS="-D_=1"
exercise_D_: 1
- runs-on: ubuntu-20.04
python: 'pypy-3.8'
args: >
-DPYBIND11_FINDPYTHON=ON
- runs-on: windows-2019
python: '3.6'
python: '3.8'
args: >
-DPYBIND11_FINDPYTHON=ON
# Inject a couple Windows 2019 runs
- runs-on: windows-2019
python: '3.9'
# Extra ubuntu latest job
- runs-on: ubuntu-latest
python: '3.11'
- runs-on: ubuntu-latest
python: '3.12'
args: >
-DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
- runs-on: macos-13
python: '3.12'
args: >
-DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
- runs-on: windows-2022
python: '3.12'
args: >
-DCMAKE_CXX_FLAGS="/DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT /GR /EHsc"
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
runs-on: ${{ matrix.runs-on }}
Expand All @@ -76,10 +91,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true

- name: Setup Boost (Linux)
# Can't use boost + define _
if: runner.os == 'Linux' && matrix.python != '3.6'
if: runner.os == 'Linux' && matrix.exercise_D_ != 1
run: sudo apt-get install libboost-dev

- name: Setup Boost (macOS)
Expand Down Expand Up @@ -130,9 +146,7 @@ jobs:
run: cmake --build . --target pytest -j 2

- name: C++11 tests
# TODO: Figure out how to load the DLL on Python 3.8+
if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10' || matrix.python == '3.11' || matrix.python == 'pypy-3.8'))"
run: cmake --build . --target cpptest -j 2
run: cmake --build . --target cpptest -j 2

- name: Interface test C++11
run: cmake --build . --target test_cmake_build
Expand Down Expand Up @@ -161,8 +175,6 @@ jobs:
run: cmake --build build2 --target pytest

- name: C++ tests
# TODO: Figure out how to load the DLL on Python 3.8+
if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10' || matrix.python == '3.11' || matrix.python == 'pypy-3.8'))"
run: cmake --build build2 --target cpptest

# Third build - C++17 mode with unstable ABI
Expand Down Expand Up @@ -193,6 +205,35 @@ jobs:
pytest tests/extra_setuptools
if: "!(matrix.runs-on == 'windows-2022')"

manylinux:
name: Manylinux on 🐍 3.13t • GIL
runs-on: ubuntu-latest
timeout-minutes: 40
container: quay.io/pypa/musllinux_1_2_x86_64:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Prepare venv
run: python3.13t -m venv .venv

- name: Install Python deps
run: .venv/bin/pip install -r tests/requirements.txt

- name: Configure C++11
run: >
cmake -S. -Bbuild
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DPython_ROOT_DIR=.venv
- name: Build C++11
run: cmake --build build -j2

- name: Python tests C++11
run: cmake --build build --target pytest -j2

deadsnakes:
strategy:
Expand Down Expand Up @@ -282,11 +323,6 @@ jobs:
fail-fast: false
matrix:
clang:
- 3.6
- 3.7
- 3.9
- 7
- 9
- dev
std:
- 11
Expand All @@ -295,8 +331,6 @@ jobs:
include:
- clang: 5
std: 14
- clang: 10
std: 17
- clang: 11
std: 20
- clang: 12
Expand All @@ -311,6 +345,12 @@ jobs:
- clang: 16
std: 20
container_suffix: "-bullseye"
- clang: 17
std: 20
container_suffix: "-bookworm"
- clang: 18
std: 20
container_suffix: "-bookworm"

name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64"
container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}"
Expand Down Expand Up @@ -468,11 +508,9 @@ jobs:
fail-fast: false
matrix:
include:
- { gcc: 7, std: 11 }
- { gcc: 7, std: 17 }
- { gcc: 8, std: 14 }
- { gcc: 8, std: 17 }
- { gcc: 9, std: 20 }
- { gcc: 10, std: 17 }
- { gcc: 10, std: 20 }
- { gcc: 11, std: 20 }
- { gcc: 12, std: 20 }
- { gcc: 13, std: 20 }
Expand Down Expand Up @@ -627,15 +665,13 @@ jobs:
cmake --build build-17 --target test_cmake_build
# Testing on CentOS (manylinux uses a centos base, and this is an easy way
# to get GCC 4.8, which is the manylinux1 compiler).
# Testing on CentOS (manylinux uses a centos base).
centos:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container:
- "centos:7" # GCC 4.8
- "almalinux:8"
- "almalinux:9"

Expand All @@ -645,18 +681,13 @@ jobs:
steps:
- name: Latest actions/checkout
uses: actions/checkout@v4
if: matrix.container != 'centos:7'

- name: Pin actions/checkout as required for centos:7
uses: actions/checkout@v3
if: matrix.container == 'centos:7'
- 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 (RHEL 7)
if: matrix.container == 'centos:7'
run: yum update -y && yum install -y python3-devel gcc-c++ make git

- name: Add Python 3 (RHEL 8+)
if: matrix.container != 'centos:7'
- 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
Expand Down Expand Up @@ -697,9 +728,9 @@ jobs:

# This tests an "install" with the CMake tools
install-classic:
name: "🐍 3.7 • Debian • x86 • Install"
name: "🐍 3.9 • Debian • x86 • Install"
runs-on: ubuntu-latest
container: i386/debian:buster
container: i386/debian:bullseye

steps:
- uses: actions/checkout@v1 # v1 is required to run inside docker
Expand Down Expand Up @@ -779,18 +810,23 @@ jobs:
fail-fast: false
matrix:
python:
- 3.6
- 3.7
- 3.8
- 3.9
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'

include:
- python: 3.9
- python: '3.12'
args: -DCMAKE_CXX_STANDARD=20
- python: 3.8
- python: '3.11'
args: -DCMAKE_CXX_STANDARD=20
- python: '3.10'
args: -DCMAKE_CXX_STANDARD=20
- python: '3.9'
args: -DCMAKE_CXX_STANDARD=20
- python: '3.8'
args: -DCMAKE_CXX_STANDARD=17
- python: 3.7
args: -DCMAKE_CXX_STANDARD=14


name: "🐍 ${{ matrix.python }} • MSVC 2019 • x86 ${{ matrix.args }}"
Expand Down Expand Up @@ -973,7 +1009,6 @@ jobs:
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-make
mingw-w64-${{matrix.env}}-python-pytest
mingw-w64-${{matrix.env}}-eigen3
mingw-w64-${{matrix.env}}-boost
mingw-w64-${{matrix.env}}-catch
Expand All @@ -984,6 +1019,7 @@ jobs:
install: >-
git
mingw-w64-${{matrix.env}}-python-scipy
mingw-w64-${{matrix.env}}-eigen3
- uses: actions/checkout@v4

Expand Down Expand Up @@ -1079,7 +1115,7 @@ jobs:
uses: jwlawson/[email protected]

- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v4
uses: seanmiddleditch/gha-setup-ninja@v5

- name: Run pip installs
run: |
Expand Down Expand Up @@ -1119,8 +1155,8 @@ jobs:
run: git clean -fdx

macos_brew_install_llvm:
name: "macos-latest • brew install llvm"
runs-on: macos-latest
name: "macos-13 • brew install llvm"
runs-on: macos-13

env:
# https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew
Expand Down
Loading

0 comments on commit f31d28a

Please sign in to comment.