Skip to content

Commit

Permalink
Merge branch 'smart_holder' into bakein_sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Jul 31, 2024
2 parents 8ffe837 + 6765d4e commit 2e9769a
Show file tree
Hide file tree
Showing 25 changed files with 68 additions and 128 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,6 @@ jobs:
fail-fast: false
matrix:
clang:
- 3.6
- 3.7
- 3.9
- 7
- 9
- dev
std:
- 11
Expand All @@ -325,8 +320,6 @@ jobs:
include:
- clang: 5
std: 14
- clang: 10
std: 17
- clang: 11
std: 20
- clang: 12
Expand Down Expand Up @@ -504,10 +497,6 @@ 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 }
Expand Down Expand Up @@ -728,9 +717,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 @@ -810,7 +799,6 @@ jobs:
fail-fast: false
matrix:
python:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand All @@ -828,8 +816,6 @@ jobs:
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
18 changes: 2 additions & 16 deletions .github/workflows/ci_sh_def.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,6 @@ jobs:
fail-fast: false
matrix:
clang:
- 3.6
- 3.7
- 3.9
- 7
- 9
- dev
std:
- 11
Expand All @@ -342,8 +337,6 @@ jobs:
include:
- clang: 5
std: 14
- clang: 10
std: 17
- clang: 11
std: 20
- clang: 12
Expand Down Expand Up @@ -522,10 +515,6 @@ 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 }
Expand Down Expand Up @@ -751,9 +740,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 @@ -834,7 +823,6 @@ jobs:
fail-fast: false
matrix:
python:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand All @@ -852,8 +840,6 @@ jobs:
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
42 changes: 21 additions & 21 deletions .github/workflows/ci_sh_def.yml.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- ci.yml 2024-07-29 11:18:11.967568957 -0700
+++ ci_sh_def.yml 2024-07-29 11:18:42.087538968 -0700
--- ci.yml 2024-07-30 11:20:28.997003056 -0700
+++ ci_sh_def.yml 2024-07-30 11:21:39.724969167 -0700
@@ -1,4 +1,16 @@
-name: CI
+# PLEASE KEEP THIS GROUP OF FILES IN SYNC AT ALL TIMES:
Expand Down Expand Up @@ -67,15 +67,15 @@

- name: Build
run: cmake --build build -j 2
@@ -364,6 +381,7 @@
@@ -357,6 +374,7 @@
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
@@ -393,7 +411,7 @@
@@ -386,7 +404,7 @@
run: apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake git python3-dev python3-pytest python3-numpy

- name: Configure
Expand All @@ -84,7 +84,7 @@

- name: Build
run: cmake --build build -j2 --verbose
@@ -481,7 +499,7 @@
@@ -474,7 +492,7 @@
cmake -S . -B build -DDOWNLOAD_CATCH=ON \
-DCMAKE_CXX_STANDARD=17 \
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \
Expand All @@ -93,127 +93,127 @@
-DPYBIND11_TEST_FILTER="test_smart_ptr.cpp"

- name: Build
@@ -537,6 +555,7 @@
@@ -526,6 +544,7 @@
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
@@ -559,6 +578,7 @@
@@ -548,6 +567,7 @@
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
"-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp"

@@ -608,6 +628,7 @@
@@ -597,6 +617,7 @@
-DDOWNLOAD_CATCH=ON \
-DDOWNLOAD_EIGEN=OFF \
-DCMAKE_CXX_STANDARD=11 \
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT" \
-DCMAKE_CXX_COMPILER=$(which icpc) \
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

@@ -640,6 +661,7 @@
@@ -629,6 +650,7 @@
-DDOWNLOAD_CATCH=ON \
-DDOWNLOAD_EIGEN=OFF \
-DCMAKE_CXX_STANDARD=17 \
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT" \
-DCMAKE_CXX_COMPILER=$(which icpc) \
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

@@ -711,6 +733,7 @@
@@ -700,6 +722,7 @@
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=11
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
@@ -761,6 +784,7 @@
@@ -750,6 +773,7 @@
cmake ../pybind11-tests
-DDOWNLOAD_CATCH=ON
-DPYBIND11_WERROR=ON
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
working-directory: /build-tests

@@ -864,6 +888,7 @@
@@ -850,6 +874,7 @@
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
+ -DCMAKE_CXX_FLAGS="/GR /EHsc /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
${{ matrix.args }}
- name: Build C++11
run: cmake --build build -j 2
@@ -918,6 +943,7 @@
@@ -904,6 +929,7 @@
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
+ -DCMAKE_CXX_FLAGS="/GR /EHsc /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
${{ matrix.args }}
- name: Build C++11
run: cmake --build build --config Debug -j 2
@@ -960,6 +986,7 @@
@@ -946,6 +972,7 @@
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=20
+ -DCMAKE_CXX_FLAGS="/GR /EHsc /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"

- name: Build C++20
run: cmake --build build -j 2
@@ -980,6 +1007,7 @@
@@ -966,6 +993,7 @@
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=20
+ -DCMAKE_CXX_FLAGS="/GR /EHsc /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
"-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp"

- name: Build C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE
@@ -1032,6 +1060,7 @@
@@ -1018,6 +1046,7 @@
run: >-
cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-S . -B build

- name: Build C++11
@@ -1053,6 +1082,7 @@
@@ -1039,6 +1068,7 @@
run: >-
cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-S . -B build2

- name: Build C++14
@@ -1074,6 +1104,7 @@
@@ -1060,6 +1090,7 @@
run: >-
cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-S . -B build3

- name: Build C++17
@@ -1141,6 +1172,7 @@
@@ -1127,6 +1158,7 @@
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=17
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"

- name: Build
run: cmake --build . -j 2
@@ -1206,6 +1238,7 @@
@@ -1192,6 +1224,7 @@
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=17
+ -DCMAKE_CXX_FLAGS="-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT"
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
@@ -1229,6 +1262,7 @@
@@ -1215,6 +1248,7 @@
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=17
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ jobs:

- runs-on: macos-13
arch: x64
cmake: "3.7"
cmake: "3.8"

- runs-on: windows-2019
arch: x64 # x86 compilers seem to be missing on 2019 image
cmake: "3.18"

name: 🐍 3.7 • CMake ${{ matrix.cmake }} • ${{ matrix.runs-on }}
name: 🐍 3.8 • CMake ${{ matrix.cmake }} • ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v4

- name: Setup Python 3.7
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.8
architecture: ${{ matrix.arch }}

- name: Prepare env
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependency.
Think of this library as a tiny self-contained version of Boost.Python
with everything stripped away that isn't relevant for binding
generation. Without comments, the core header files only require ~4K
lines of code and depend on Python (3.7+, or PyPy) and the C++
lines of code and depend on Python (3.8+, or PyPy) and the C++
standard library. This compact implementation was possible thanks to
some C++11 language features (specifically: tuples, lambda functions and
variadic templates). Since its creation, this library has grown beyond
Expand Down Expand Up @@ -83,7 +83,7 @@ Goodies
In addition to the core functionality, pybind11 provides some extra
goodies:

- Python 3.7+, and PyPy3 7.3 are supported with an implementation-agnostic
- Python 3.8+, and PyPy3 7.3 are supported with an implementation-agnostic
interface (pybind11 2.9 was the last version to support Python 2 and 3.5).

- It is possible to bind C++11 lambda functions with captured
Expand Down
3 changes: 1 addition & 2 deletions docs/advanced/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,7 @@ An instance can now be pickled as follows:
always use the latest available version. Beware: failure to follow these
instructions will cause important pybind11 memory allocation routines to be
skipped during unpickling, which will likely lead to memory corruption
and/or segmentation faults. Python defaults to version 3 (Python 3-3.7) and
version 4 for Python 3.8+.
and/or segmentation faults.

.. seealso::

Expand Down
3 changes: 1 addition & 2 deletions docs/advanced/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ Should they throw or fail to catch any exceptions in their call graph,
the C++ runtime calls ``std::terminate()`` to abort immediately.

Similarly, Python exceptions raised in a class's ``__del__`` method do not
propagate, but are logged by Python as an unraisable error. In Python 3.8+, a
`system hook is triggered
propagate, but ``sys.unraisablehook()`` `is triggered
<https://docs.python.org/3/library/sys.html#sys.unraisablehook>`_
and an auditing event is logged.

Expand Down
4 changes: 2 additions & 2 deletions docs/compiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ with ``PYTHON_EXECUTABLE``. For example:

.. code-block:: bash
cmake -DPYBIND11_PYTHON_VERSION=3.7 ..
cmake -DPYBIND11_PYTHON_VERSION=3.8 ..
# Another method:
cmake -DPYTHON_EXECUTABLE=/path/to/python ..
Expand Down Expand Up @@ -493,7 +493,7 @@ existing targets instead:
cmake_minimum_required(VERSION 3.15...3.22)
project(example LANGUAGES CXX)
find_package(Python 3.7 COMPONENTS Interpreter Development REQUIRED)
find_package(Python 3.8 COMPONENTS Interpreter Development REQUIRED)
find_package(pybind11 CONFIG REQUIRED)
# or add_subdirectory(pybind11)
Expand Down
Loading

0 comments on commit 2e9769a

Please sign in to comment.