2021-10-27 17:55:24 +00:00
|
|
|
name: CI
|
2020-07-22 14:24:11 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- stable
|
2021-03-18 18:29:22 +00:00
|
|
|
- smart_holder
|
2020-07-22 14:24:11 +00:00
|
|
|
- v*
|
|
|
|
|
2023-05-15 17:02:25 +00:00
|
|
|
permissions: read-all
|
|
|
|
|
2021-10-18 01:40:10 +00:00
|
|
|
concurrency:
|
2024-09-02 18:10:57 +00:00
|
|
|
group: test-${{ github.ref }}
|
2021-10-18 01:40:10 +00:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-10-26 18:50:34 +00:00
|
|
|
env:
|
2023-06-17 14:02:23 +00:00
|
|
|
PIP_BREAK_SYSTEM_PACKAGES: 1
|
2021-10-26 18:50:34 +00:00
|
|
|
PIP_ONLY_BINARY: numpy
|
2022-02-12 00:06:16 +00:00
|
|
|
FORCE_COLOR: 3
|
|
|
|
PYTEST_TIMEOUT: 300
|
2022-12-15 21:19:13 +00:00
|
|
|
# For cmake:
|
|
|
|
VERBOSE: 1
|
2021-10-26 18:50:34 +00:00
|
|
|
|
2020-07-22 14:24:11 +00:00
|
|
|
jobs:
|
2020-09-16 21:13:41 +00:00
|
|
|
# This is the "main" test suite, which tests a large number of different
|
|
|
|
# versions of default compilers and Python versions in GitHub Actions.
|
2020-07-22 14:24:11 +00:00
|
|
|
standard:
|
|
|
|
strategy:
|
2020-09-08 13:26:50 +00:00
|
|
|
fail-fast: false
|
2020-07-22 14:24:11 +00:00
|
|
|
matrix:
|
2024-05-06 16:11:41 +00:00
|
|
|
runs-on: [ubuntu-20.04, windows-2022, macos-13]
|
2020-07-22 14:24:11 +00:00
|
|
|
python:
|
2024-06-22 04:55:00 +00:00
|
|
|
- '3.8'
|
2021-10-26 18:50:34 +00:00
|
|
|
- '3.9'
|
2023-06-21 17:25:10 +00:00
|
|
|
- '3.12'
|
2024-05-24 15:00:30 +00:00
|
|
|
- '3.13'
|
2022-03-01 17:42:52 +00:00
|
|
|
- 'pypy-3.8'
|
2022-03-25 16:34:32 +00:00
|
|
|
- 'pypy-3.9'
|
2023-07-09 16:40:47 +00:00
|
|
|
- 'pypy-3.10'
|
2024-10-07 21:12:04 +00:00
|
|
|
- 'graalpy-24.1'
|
2020-07-22 14:24:11 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# Items in here will either be added to the build matrix (if not
|
|
|
|
# present), or add new keys to an existing matrix element if all the
|
|
|
|
# existing keys match.
|
|
|
|
#
|
2021-12-03 19:10:36 +00:00
|
|
|
# We support an optional key: args, for cmake args
|
2020-07-22 14:24:11 +00:00
|
|
|
include:
|
2020-10-06 14:04:13 +00:00
|
|
|
# Just add a key
|
2022-12-05 03:39:25 +00:00
|
|
|
- runs-on: ubuntu-20.04
|
2024-06-22 04:55:00 +00:00
|
|
|
python: '3.8'
|
2020-08-24 18:31:20 +00:00
|
|
|
args: >
|
|
|
|
-DPYBIND11_FINDPYTHON=ON
|
2022-02-18 19:51:56 +00:00
|
|
|
-DCMAKE_CXX_FLAGS="-D_=1"
|
2024-06-22 04:55:00 +00:00
|
|
|
exercise_D_: 1
|
2022-12-05 03:39:25 +00:00
|
|
|
- runs-on: ubuntu-20.04
|
2022-03-25 18:54:43 +00:00
|
|
|
python: 'pypy-3.8'
|
2022-03-25 16:34:32 +00:00
|
|
|
args: >
|
|
|
|
-DPYBIND11_FINDPYTHON=ON
|
2022-02-23 22:56:41 +00:00
|
|
|
- runs-on: windows-2019
|
2024-06-22 04:55:00 +00:00
|
|
|
python: '3.8'
|
2020-08-24 18:31:20 +00:00
|
|
|
args: >
|
|
|
|
-DPYBIND11_FINDPYTHON=ON
|
2021-12-03 19:10:36 +00:00
|
|
|
# Inject a couple Windows 2019 runs
|
|
|
|
- runs-on: windows-2019
|
|
|
|
python: '3.9'
|
2024-05-24 15:00:30 +00:00
|
|
|
# Extra ubuntu latest job
|
|
|
|
- runs-on: ubuntu-latest
|
|
|
|
python: '3.11'
|
2024-09-01 21:34:36 +00:00
|
|
|
# Exercise PYBIND11_USE_SMART_HOLDER_AS_DEFAULT
|
|
|
|
# with recent (or ideally latest) released Python version.
|
2024-08-14 06:59:12 +00:00
|
|
|
- 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"
|
2024-09-01 21:34:36 +00:00
|
|
|
# Exercise PYBIND11_SMART_HOLDER_DISABLE
|
|
|
|
# with recent (or ideally latest) released Python version.
|
|
|
|
- runs-on: ubuntu-latest
|
|
|
|
python: '3.12'
|
|
|
|
args: >
|
|
|
|
-DCMAKE_CXX_FLAGS="-DPYBIND11_SMART_HOLDER_DISABLE"
|
|
|
|
- runs-on: macos-13
|
|
|
|
python: '3.12'
|
|
|
|
args: >
|
|
|
|
-DCMAKE_CXX_FLAGS="-DPYBIND11_SMART_HOLDER_DISABLE"
|
|
|
|
- runs-on: windows-2022
|
|
|
|
python: '3.12'
|
|
|
|
args: >
|
|
|
|
-DCMAKE_CXX_FLAGS="/DPYBIND11_SMART_HOLDER_DISABLE /GR /EHsc"
|
2024-10-07 21:12:04 +00:00
|
|
|
exclude:
|
|
|
|
# The setup-python action currently doesn't have graalpy for windows
|
|
|
|
- python: 'graalpy-24.1'
|
|
|
|
runs-on: 'windows-2022'
|
2024-05-24 15:00:30 +00:00
|
|
|
|
2020-10-23 02:34:44 +00:00
|
|
|
|
2020-10-15 18:58:34 +00:00
|
|
|
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
|
2020-07-26 22:17:11 +00:00
|
|
|
runs-on: ${{ matrix.runs-on }}
|
2020-07-22 14:24:11 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-07-22 14:24:11 +00:00
|
|
|
|
|
|
|
- name: Setup Python ${{ matrix.python }}
|
2023-12-07 05:09:08 +00:00
|
|
|
uses: actions/setup-python@v5
|
2020-07-22 14:24:11 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
2024-05-24 15:00:30 +00:00
|
|
|
allow-prereleases: true
|
2020-07-22 14:24:11 +00:00
|
|
|
|
2021-04-22 04:03:07 +00:00
|
|
|
- name: Setup Boost (Linux)
|
2021-12-21 19:24:21 +00:00
|
|
|
# Can't use boost + define _
|
2024-06-22 04:55:00 +00:00
|
|
|
if: runner.os == 'Linux' && matrix.exercise_D_ != 1
|
2021-04-22 04:03:07 +00:00
|
|
|
run: sudo apt-get install libboost-dev
|
|
|
|
|
|
|
|
- name: Setup Boost (macOS)
|
|
|
|
if: runner.os == 'macOS'
|
|
|
|
run: brew install boost
|
2020-08-14 16:24:58 +00:00
|
|
|
|
2020-08-19 16:26:26 +00:00
|
|
|
- name: Update CMake
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2.0
|
2020-08-19 16:26:26 +00:00
|
|
|
|
2020-07-24 15:45:22 +00:00
|
|
|
- name: Cache wheels
|
2020-08-14 16:24:58 +00:00
|
|
|
if: runner.os == 'macOS'
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: actions/cache@v4
|
2020-07-24 15:45:22 +00:00
|
|
|
with:
|
|
|
|
# This path is specific to macOS - we really only need it for PyPy NumPy wheels
|
|
|
|
# See https://github.com/actions/cache/blob/master/examples.md#python---pip
|
|
|
|
# for ways to do this more generally
|
|
|
|
path: ~/Library/Caches/pip
|
|
|
|
# Look to see if there is a cache hit for the corresponding requirements file
|
2020-10-15 18:58:34 +00:00
|
|
|
key: ${{ runner.os }}-pip-${{ matrix.python }}-x64-${{ hashFiles('tests/requirements.txt') }}
|
2020-07-24 15:45:22 +00:00
|
|
|
|
2020-07-22 14:24:11 +00:00
|
|
|
- name: Prepare env
|
2021-10-26 18:50:34 +00:00
|
|
|
run: |
|
|
|
|
python -m pip install -r tests/requirements.txt
|
2020-07-22 14:24:11 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
- name: Setup annotations on Linux
|
2020-09-08 13:26:50 +00:00
|
|
|
if: runner.os == 'Linux'
|
2020-08-24 22:04:37 +00:00
|
|
|
run: python -m pip install pytest-github-actions-annotate-failures
|
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# First build - C++11 mode and inplace
|
2024-03-26 22:20:11 +00:00
|
|
|
# More-or-less randomly adding -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON here
|
|
|
|
# (same for PYBIND11_NUMPY_1_ONLY, but requires a NumPy 1.x at runtime).
|
2020-08-24 22:04:37 +00:00
|
|
|
- name: Configure C++11 ${{ matrix.args }}
|
2020-07-22 14:24:11 +00:00
|
|
|
run: >
|
2020-08-19 17:11:57 +00:00
|
|
|
cmake -S . -B .
|
2020-07-22 14:24:11 +00:00
|
|
|
-DPYBIND11_WERROR=ON
|
2024-03-27 19:39:05 +00:00
|
|
|
-DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
|
Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216)
* Add option to force the use of the PYPY GIL scoped acquire/release logic to support nested gil access, see https://github.com/pybind/pybind11/issues/1276 and https://github.com/pytorch/pytorch/issues/83101
* Apply suggestions from code review
* Update CMakeLists.txt
* docs: update upgrade guide
* Update docs/upgrade.rst
* All bells & whistles.
* Add Reminder to common.h, so that we will not forget to purge `!WITH_THREAD` branches when dropping Python 3.6
* New sentence instead of semicolon.
* Temporarily pull in snapshot of PR #4246
* Add `test_release_acquire`
* Add more unit tests for nested gil locking
* Add test_report_builtins_internals_keys
* Very minor enhancement: sort list only after filtering.
* Revert change in docs/upgrade.rst
* Add test_multi_acquire_release_cross_module, while also forcing unique PYBIND11_INTERNALS_VERSION for cross_module_gil_utils.cpp
* Hopefully fix apparently new ICC error.
```
2022-10-28T07:57:54.5187728Z -- The CXX compiler identification is Intel 2021.7.0.20220726
...
2022-10-28T07:58:53.6758994Z icpc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
2022-10-28T07:58:54.5801597Z In file included from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../detail/type_caster_base.h(15),
2022-10-28T07:58:54.5803794Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../cast.h(15),
2022-10-28T07:58:54.5805740Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../attr.h(14),
2022-10-28T07:58:54.5809556Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/class.h(12),
2022-10-28T07:58:54.5812154Z from /home/runner/work/pybind11/pybind11/include/pybind11/pybind11.h(13),
2022-10-28T07:58:54.5948523Z from /home/runner/work/pybind11/pybind11/tests/cross_module_gil_utils.cpp(13):
2022-10-28T07:58:54.5949009Z /home/runner/work/pybind11/pybind11/include/pybind11/detail/../detail/internals.h(177): error #2282: unrecognized GCC pragma
2022-10-28T07:58:54.5949374Z PYBIND11_TLS_KEY_INIT(tstate)
2022-10-28T07:58:54.5949579Z ^
2022-10-28T07:58:54.5949695Z
```
* clang-tidy fixes
* Workaround for PYPY WIN exitcode None
* Revert "Temporarily pull in snapshot of PR #4246"
This reverts commit 23ac16e859150f27fda25ca865cabcb4444e0770.
* Another workaround for PYPY WIN exitcode None
* Clean up how the tests are run "run in process" Part 1: uniformity
* Clean up how the tests are run "run in process" Part 2: use `@pytest.mark.parametrize` and clean up the naming.
* Skip some tests `#if defined(THREAD_SANITIZER)` (tested with TSAN using the Google-internal toolchain).
* Run all tests again but ignore ThreadSanitizer exitcode 66 (this is less likely to mask unrelated ThreadSanitizer issues in the future).
* bug fix: missing common.h include before using `PYBIND11_SIMPLE_GIL_MANAGEMENT`
For the tests in the github CI this does not matter, because
`PYBIND11_SIMPLE_GIL_MANAGEMENT` is always defined from the command line,
but when monkey-patching common.h locally, it matters.
* if process.exitcode is None: assert t_delta > 9.9
* More sophisiticated `_run_in_process()` implementation, clearly reporting `DEADLOCK`, additionally exercised via added `intentional_deadlock()`
* Wrap m.intentional_deadlock in a Python function, for `ForkingPickler` compatibility.
```
> ForkingPickler(file, protocol).dump(obj)
E TypeError: cannot pickle 'PyCapsule' object
```
Observed with all Windows builds including mingw but not PyPy, and macos-latest with Python 3.9, 3.10, 3.11 but not 3.6.
* Add link to potential solution for WOULD-BE-NICE-TO-HAVE feature.
* Add `SKIP_IF_DEADLOCK = True` option, to not pollute the CI results with expected `DEADLOCK` failures while we figure out what to do about them.
* Add COPY-PASTE-THIS: gdb ... command (to be used for debugging the detected deadlock)
* style: pre-commit fixes
* Do better than automatic pre-commit fixes.
* Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` to `pytest_report_header()` (so that we can easily know when harvesting deadlock information from the CI logs).
Co-authored-by: Arnim Balzer <arnim@seechange.ai>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-30 15:57:23 +00:00
|
|
|
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
|
2024-03-26 22:20:11 +00:00
|
|
|
-DPYBIND11_NUMPY_1_ONLY=ON
|
2021-07-11 07:40:38 +00:00
|
|
|
-DDOWNLOAD_CATCH=ON
|
2020-07-26 17:44:10 +00:00
|
|
|
-DDOWNLOAD_EIGEN=ON
|
2020-07-24 00:30:47 +00:00
|
|
|
-DCMAKE_CXX_STANDARD=11
|
2020-08-19 16:26:26 +00:00
|
|
|
${{ matrix.args }}
|
2020-07-24 00:30:47 +00:00
|
|
|
|
|
|
|
- name: Build C++11
|
2020-08-19 17:11:57 +00:00
|
|
|
run: cmake --build . -j 2
|
2020-07-24 00:30:47 +00:00
|
|
|
|
|
|
|
- name: Python tests C++11
|
2020-08-19 17:11:57 +00:00
|
|
|
run: cmake --build . --target pytest -j 2
|
2020-07-24 00:30:47 +00:00
|
|
|
|
2021-07-11 07:40:38 +00:00
|
|
|
- name: C++11 tests
|
2024-06-21 14:41:17 +00:00
|
|
|
run: cmake --build . --target cpptest -j 2
|
2020-07-24 00:30:47 +00:00
|
|
|
|
|
|
|
- name: Interface test C++11
|
2020-08-19 17:11:57 +00:00
|
|
|
run: cmake --build . --target test_cmake_build
|
|
|
|
|
|
|
|
- name: Clean directory
|
|
|
|
run: git clean -fdx
|
2020-07-24 00:30:47 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# Second build - C++17 mode and in a build directory
|
Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216)
* Add option to force the use of the PYPY GIL scoped acquire/release logic to support nested gil access, see https://github.com/pybind/pybind11/issues/1276 and https://github.com/pytorch/pytorch/issues/83101
* Apply suggestions from code review
* Update CMakeLists.txt
* docs: update upgrade guide
* Update docs/upgrade.rst
* All bells & whistles.
* Add Reminder to common.h, so that we will not forget to purge `!WITH_THREAD` branches when dropping Python 3.6
* New sentence instead of semicolon.
* Temporarily pull in snapshot of PR #4246
* Add `test_release_acquire`
* Add more unit tests for nested gil locking
* Add test_report_builtins_internals_keys
* Very minor enhancement: sort list only after filtering.
* Revert change in docs/upgrade.rst
* Add test_multi_acquire_release_cross_module, while also forcing unique PYBIND11_INTERNALS_VERSION for cross_module_gil_utils.cpp
* Hopefully fix apparently new ICC error.
```
2022-10-28T07:57:54.5187728Z -- The CXX compiler identification is Intel 2021.7.0.20220726
...
2022-10-28T07:58:53.6758994Z icpc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
2022-10-28T07:58:54.5801597Z In file included from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../detail/type_caster_base.h(15),
2022-10-28T07:58:54.5803794Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../cast.h(15),
2022-10-28T07:58:54.5805740Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../attr.h(14),
2022-10-28T07:58:54.5809556Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/class.h(12),
2022-10-28T07:58:54.5812154Z from /home/runner/work/pybind11/pybind11/include/pybind11/pybind11.h(13),
2022-10-28T07:58:54.5948523Z from /home/runner/work/pybind11/pybind11/tests/cross_module_gil_utils.cpp(13):
2022-10-28T07:58:54.5949009Z /home/runner/work/pybind11/pybind11/include/pybind11/detail/../detail/internals.h(177): error #2282: unrecognized GCC pragma
2022-10-28T07:58:54.5949374Z PYBIND11_TLS_KEY_INIT(tstate)
2022-10-28T07:58:54.5949579Z ^
2022-10-28T07:58:54.5949695Z
```
* clang-tidy fixes
* Workaround for PYPY WIN exitcode None
* Revert "Temporarily pull in snapshot of PR #4246"
This reverts commit 23ac16e859150f27fda25ca865cabcb4444e0770.
* Another workaround for PYPY WIN exitcode None
* Clean up how the tests are run "run in process" Part 1: uniformity
* Clean up how the tests are run "run in process" Part 2: use `@pytest.mark.parametrize` and clean up the naming.
* Skip some tests `#if defined(THREAD_SANITIZER)` (tested with TSAN using the Google-internal toolchain).
* Run all tests again but ignore ThreadSanitizer exitcode 66 (this is less likely to mask unrelated ThreadSanitizer issues in the future).
* bug fix: missing common.h include before using `PYBIND11_SIMPLE_GIL_MANAGEMENT`
For the tests in the github CI this does not matter, because
`PYBIND11_SIMPLE_GIL_MANAGEMENT` is always defined from the command line,
but when monkey-patching common.h locally, it matters.
* if process.exitcode is None: assert t_delta > 9.9
* More sophisiticated `_run_in_process()` implementation, clearly reporting `DEADLOCK`, additionally exercised via added `intentional_deadlock()`
* Wrap m.intentional_deadlock in a Python function, for `ForkingPickler` compatibility.
```
> ForkingPickler(file, protocol).dump(obj)
E TypeError: cannot pickle 'PyCapsule' object
```
Observed with all Windows builds including mingw but not PyPy, and macos-latest with Python 3.9, 3.10, 3.11 but not 3.6.
* Add link to potential solution for WOULD-BE-NICE-TO-HAVE feature.
* Add `SKIP_IF_DEADLOCK = True` option, to not pollute the CI results with expected `DEADLOCK` failures while we figure out what to do about them.
* Add COPY-PASTE-THIS: gdb ... command (to be used for debugging the detected deadlock)
* style: pre-commit fixes
* Do better than automatic pre-commit fixes.
* Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` to `pytest_report_header()` (so that we can easily know when harvesting deadlock information from the CI logs).
Co-authored-by: Arnim Balzer <arnim@seechange.ai>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-30 15:57:23 +00:00
|
|
|
# More-or-less randomly adding -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF here.
|
2024-03-26 22:20:11 +00:00
|
|
|
# (same for PYBIND11_NUMPY_1_ONLY, but requires a NumPy 1.x at runtime).
|
2021-11-17 14:44:19 +00:00
|
|
|
- name: Configure C++17
|
2020-07-24 00:30:47 +00:00
|
|
|
run: >
|
2020-07-26 22:42:53 +00:00
|
|
|
cmake -S . -B build2
|
2020-07-30 00:10:38 +00:00
|
|
|
-DPYBIND11_WERROR=ON
|
Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` option (cmake, C++ define) (#4216)
* Add option to force the use of the PYPY GIL scoped acquire/release logic to support nested gil access, see https://github.com/pybind/pybind11/issues/1276 and https://github.com/pytorch/pytorch/issues/83101
* Apply suggestions from code review
* Update CMakeLists.txt
* docs: update upgrade guide
* Update docs/upgrade.rst
* All bells & whistles.
* Add Reminder to common.h, so that we will not forget to purge `!WITH_THREAD` branches when dropping Python 3.6
* New sentence instead of semicolon.
* Temporarily pull in snapshot of PR #4246
* Add `test_release_acquire`
* Add more unit tests for nested gil locking
* Add test_report_builtins_internals_keys
* Very minor enhancement: sort list only after filtering.
* Revert change in docs/upgrade.rst
* Add test_multi_acquire_release_cross_module, while also forcing unique PYBIND11_INTERNALS_VERSION for cross_module_gil_utils.cpp
* Hopefully fix apparently new ICC error.
```
2022-10-28T07:57:54.5187728Z -- The CXX compiler identification is Intel 2021.7.0.20220726
...
2022-10-28T07:58:53.6758994Z icpc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
2022-10-28T07:58:54.5801597Z In file included from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../detail/type_caster_base.h(15),
2022-10-28T07:58:54.5803794Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../cast.h(15),
2022-10-28T07:58:54.5805740Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/../attr.h(14),
2022-10-28T07:58:54.5809556Z from /home/runner/work/pybind11/pybind11/include/pybind11/detail/class.h(12),
2022-10-28T07:58:54.5812154Z from /home/runner/work/pybind11/pybind11/include/pybind11/pybind11.h(13),
2022-10-28T07:58:54.5948523Z from /home/runner/work/pybind11/pybind11/tests/cross_module_gil_utils.cpp(13):
2022-10-28T07:58:54.5949009Z /home/runner/work/pybind11/pybind11/include/pybind11/detail/../detail/internals.h(177): error #2282: unrecognized GCC pragma
2022-10-28T07:58:54.5949374Z PYBIND11_TLS_KEY_INIT(tstate)
2022-10-28T07:58:54.5949579Z ^
2022-10-28T07:58:54.5949695Z
```
* clang-tidy fixes
* Workaround for PYPY WIN exitcode None
* Revert "Temporarily pull in snapshot of PR #4246"
This reverts commit 23ac16e859150f27fda25ca865cabcb4444e0770.
* Another workaround for PYPY WIN exitcode None
* Clean up how the tests are run "run in process" Part 1: uniformity
* Clean up how the tests are run "run in process" Part 2: use `@pytest.mark.parametrize` and clean up the naming.
* Skip some tests `#if defined(THREAD_SANITIZER)` (tested with TSAN using the Google-internal toolchain).
* Run all tests again but ignore ThreadSanitizer exitcode 66 (this is less likely to mask unrelated ThreadSanitizer issues in the future).
* bug fix: missing common.h include before using `PYBIND11_SIMPLE_GIL_MANAGEMENT`
For the tests in the github CI this does not matter, because
`PYBIND11_SIMPLE_GIL_MANAGEMENT` is always defined from the command line,
but when monkey-patching common.h locally, it matters.
* if process.exitcode is None: assert t_delta > 9.9
* More sophisiticated `_run_in_process()` implementation, clearly reporting `DEADLOCK`, additionally exercised via added `intentional_deadlock()`
* Wrap m.intentional_deadlock in a Python function, for `ForkingPickler` compatibility.
```
> ForkingPickler(file, protocol).dump(obj)
E TypeError: cannot pickle 'PyCapsule' object
```
Observed with all Windows builds including mingw but not PyPy, and macos-latest with Python 3.9, 3.10, 3.11 but not 3.6.
* Add link to potential solution for WOULD-BE-NICE-TO-HAVE feature.
* Add `SKIP_IF_DEADLOCK = True` option, to not pollute the CI results with expected `DEADLOCK` failures while we figure out what to do about them.
* Add COPY-PASTE-THIS: gdb ... command (to be used for debugging the detected deadlock)
* style: pre-commit fixes
* Do better than automatic pre-commit fixes.
* Add `PYBIND11_SIMPLE_GIL_MANAGEMENT` to `pytest_report_header()` (so that we can easily know when harvesting deadlock information from the CI logs).
Co-authored-by: Arnim Balzer <arnim@seechange.ai>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-30 15:57:23 +00:00
|
|
|
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
|
2024-03-26 22:20:11 +00:00
|
|
|
-DPYBIND11_NUMPY_1_ONLY=ON
|
2021-07-11 07:40:38 +00:00
|
|
|
-DDOWNLOAD_CATCH=ON
|
2020-07-26 17:44:10 +00:00
|
|
|
-DDOWNLOAD_EIGEN=ON
|
2020-08-24 18:31:20 +00:00
|
|
|
-DCMAKE_CXX_STANDARD=17
|
2020-08-19 16:26:26 +00:00
|
|
|
${{ matrix.args }}
|
2020-07-22 14:24:11 +00:00
|
|
|
|
2020-08-24 18:31:20 +00:00
|
|
|
- name: Build
|
2020-07-30 20:04:26 +00:00
|
|
|
run: cmake --build build2 -j 2
|
2020-07-24 00:30:47 +00:00
|
|
|
|
2020-08-24 18:31:20 +00:00
|
|
|
- name: Python tests
|
2020-07-26 22:42:53 +00:00
|
|
|
run: cmake --build build2 --target pytest
|
2020-07-24 00:30:47 +00:00
|
|
|
|
2021-07-11 07:40:38 +00:00
|
|
|
- name: C++ tests
|
|
|
|
run: cmake --build build2 --target cpptest
|
2020-07-24 00:30:47 +00:00
|
|
|
|
2021-09-20 11:57:38 +00:00
|
|
|
# Third build - C++17 mode with unstable ABI
|
|
|
|
- name: Configure (unstable ABI)
|
|
|
|
run: >
|
|
|
|
cmake -S . -B build3
|
|
|
|
-DPYBIND11_WERROR=ON
|
|
|
|
-DDOWNLOAD_CATCH=ON
|
|
|
|
-DDOWNLOAD_EIGEN=ON
|
|
|
|
-DCMAKE_CXX_STANDARD=17
|
|
|
|
-DPYBIND11_INTERNALS_VERSION=10000000
|
|
|
|
${{ matrix.args }}
|
|
|
|
|
|
|
|
- name: Build (unstable ABI)
|
|
|
|
run: cmake --build build3 -j 2
|
|
|
|
|
|
|
|
- name: Python tests (unstable ABI)
|
|
|
|
run: cmake --build build3 --target pytest
|
|
|
|
|
2020-08-24 18:31:20 +00:00
|
|
|
- name: Interface test
|
2020-07-26 22:42:53 +00:00
|
|
|
run: cmake --build build2 --target test_cmake_build
|
2020-07-24 00:30:47 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# This makes sure the setup_helpers module can build packages using
|
|
|
|
# setuptools
|
|
|
|
- name: Setuptools helpers test
|
2023-06-10 17:14:08 +00:00
|
|
|
run: |
|
|
|
|
pip install setuptools
|
|
|
|
pytest tests/extra_setuptools
|
2022-02-12 00:06:16 +00:00
|
|
|
if: "!(matrix.runs-on == 'windows-2022')"
|
2020-09-16 21:13:41 +00:00
|
|
|
|
2024-05-28 13:07:59 +00:00
|
|
|
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
|
2024-05-30 05:40:55 +00:00
|
|
|
run: python3.13t -m venv .venv
|
2024-05-28 13:07:59 +00:00
|
|
|
|
|
|
|
- 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
|
2020-09-16 21:13:41 +00:00
|
|
|
|
2021-01-14 04:13:19 +00:00
|
|
|
deadsnakes:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-01-15 20:07:31 +00:00
|
|
|
include:
|
2021-10-26 18:50:34 +00:00
|
|
|
# TODO: Fails on 3.10, investigate
|
2023-10-20 06:12:37 +00:00
|
|
|
# JOB DISABLED (NEEDS WORK): https://github.com/pybind/pybind11/issues/4889
|
|
|
|
# - python-version: "3.9"
|
|
|
|
# python-debug: true
|
|
|
|
# valgrind: true
|
2022-10-26 14:41:51 +00:00
|
|
|
- python-version: "3.11"
|
2022-07-06 20:35:12 +00:00
|
|
|
python-debug: false
|
2021-01-14 04:13:19 +00:00
|
|
|
|
2021-01-15 20:07:31 +00:00
|
|
|
name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64"
|
2022-12-05 03:39:25 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2021-01-14 04:13:19 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-01-14 04:13:19 +00:00
|
|
|
|
2021-01-15 20:07:31 +00:00
|
|
|
- name: Setup Python ${{ matrix.python-version }} (deadsnakes)
|
2024-09-09 18:31:38 +00:00
|
|
|
uses: deadsnakes/action@v3.2.0
|
2021-01-14 04:13:19 +00:00
|
|
|
with:
|
2021-01-15 20:07:31 +00:00
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
debug: ${{ matrix.python-debug }}
|
|
|
|
|
|
|
|
- name: Update CMake
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2.0
|
2021-01-15 20:07:31 +00:00
|
|
|
|
|
|
|
- name: Valgrind cache
|
|
|
|
if: matrix.valgrind
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: actions/cache@v4
|
2021-01-15 20:07:31 +00:00
|
|
|
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 libc6-dbg # Needed by Valgrind
|
2021-01-14 04:13:19 +00:00
|
|
|
|
|
|
|
- name: Prepare env
|
2021-10-26 18:50:34 +00:00
|
|
|
run: |
|
|
|
|
python -m pip install -r tests/requirements.txt
|
2021-01-14 04:13:19 +00:00
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
run: >
|
|
|
|
cmake -S . -B build
|
2021-01-15 20:07:31 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=Debug
|
2021-01-14 04:13:19 +00:00
|
|
|
-DPYBIND11_WERROR=ON
|
|
|
|
-DDOWNLOAD_CATCH=ON
|
|
|
|
-DDOWNLOAD_EIGEN=ON
|
|
|
|
-DCMAKE_CXX_STANDARD=17
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2021-01-15 20:07:31 +00:00
|
|
|
- name: Run Valgrind on Python tests
|
|
|
|
if: matrix.valgrind
|
|
|
|
run: cmake --build build --target memcheck
|
|
|
|
|
2021-01-14 04:13:19 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# Testing on clang using the excellent silkeh clang docker images
|
2020-07-24 00:30:47 +00:00
|
|
|
clang:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
clang:
|
|
|
|
- dev
|
2020-10-15 18:58:34 +00:00
|
|
|
std:
|
|
|
|
- 11
|
2023-01-13 01:50:28 +00:00
|
|
|
container_suffix:
|
|
|
|
- ""
|
2020-10-15 18:58:34 +00:00
|
|
|
include:
|
|
|
|
- clang: 5
|
|
|
|
std: 14
|
2022-07-21 13:40:34 +00:00
|
|
|
- clang: 11
|
|
|
|
std: 20
|
|
|
|
- clang: 12
|
|
|
|
std: 20
|
|
|
|
- clang: 13
|
|
|
|
std: 20
|
2022-07-13 14:06:32 +00:00
|
|
|
- clang: 14
|
|
|
|
std: 20
|
2023-01-13 01:50:28 +00:00
|
|
|
- clang: 15
|
|
|
|
std: 20
|
|
|
|
container_suffix: "-bullseye"
|
2023-08-03 20:36:29 +00:00
|
|
|
- clang: 16
|
|
|
|
std: 20
|
|
|
|
container_suffix: "-bullseye"
|
clang-tidy upgrade (to version 18) (#5272)
* `container: silkeh/clang:18-bookworm` in .github/workflows/format.yml
* clang-tidy auto-fix (trivial, in test only)
* Disable `performance-enum-size` (noisy, low value)
* Temporarily turn off 3 diagnostics (to be tackled one-by-one).
* Add explicit `switch` `default` to resolve clang-tidy `bugprone-switch-missing-default-case`
Debian clang version 18.1.8 (++20240718080534+3b5b5c1ec4a3-1~exp1~20240718200641.143)
Target: x86_64-pc-linux-gnu
tests/test_numpy_dtypes.cpp:212:5: warning: switching on non-enum value without default case may not cover all cases [bugprone-switch-missing-default-case]
* Add clang-17 and clang-18 testing.
* Add `NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)` in test_tagbased_polymorphic.cpp
Debian clang version 18.1.8 (++20240718080534+3b5b5c1ec4a3-1~exp1~20240718200641.143)
Target: x86_64-pc-linux-gnu
tests/test_tagbased_polymorphic.cpp:77:40: warning: The value '150' provided to the cast expression is not in the valid range of values for 'Kind' [clang-analyzer-optin.core.EnumCastOutOfRange]
* Fix inconsistent pybind11/eigen/tensor.h behavior:
This existing comment in pybind11/eigen/tensor.h
```
// move, take_ownership don't make any sense for a ref/map:
```
is at odds with the `delete src;` three lines up.
In real-world client code `take_ownership` will not exist (unless the client code is untested and unused). I.e. the `delete` is essentially only useful to avoid leaks in the pybind11 unit tests.
While upgrading to clang-tidy 18, the warning below appeared. Apparently it is produced during LTO, and it appears difficult to suppress. Regardless, the best way to resolve this is to remove the `delete` and to simply make the test objects `static` in the unit test code.
________
Debian clang version 18.1.8 (++20240718080534+3b5b5c1ec4a3-1~exp1~20240718200641.143)
Target: x86_64-pc-linux-gnu
________
```
lto-wrapper: warning: using serial compilation of 3 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
In function ‘cast_impl’,
inlined from ‘cast’ at /mounted_pybind11/include/pybind11/eigen/tensor.h:414:25,
inlined from ‘operator()’ at /mounted_pybind11/include/pybind11/eigen/../pybind11.h:296:40,
inlined from ‘_FUN’ at /mounted_pybind11/include/pybind11/eigen/../pybind11.h:267:21:
/mounted_pybind11/include/pybind11/eigen/tensor.h:475:17: warning: ‘operator delete’ called on unallocated object ‘<anonymous>’ [-Wfree-nonheap-object]
475 | delete src;
| ^
/mounted_pybind11/include/pybind11/eigen/../pybind11.h: In function ‘_FUN’:
/mounted_pybind11/include/pybind11/eigen/../pybind11.h:297:75: note: declared here
297 | std::move(args_converter).template call<Return, Guard>(cap->f),
| ^
```
* Disable `bugprone-chained-comparison`: this clang-tidy check is incompatible with the Catch2 `REQUIRE` macro (26 warnings like the one below).
________
Debian clang version 18.1.8 (++20240718080534+3b5b5c1ec4a3-1~exp1~20240718200641.143)
Target: x86_64-pc-linux-gnu
________
```
/mounted_pybind11/tests/test_embed/test_interpreter.cpp:127:9: warning: chained comparison 'v0 <= v1 == v2' may generate unintended results, use parentheses to specify order of evaluation or a logical operator to separate comparison expressions [bugprone-chained-comparison]
127 | REQUIRE(ret == 42);
| ^
/build/tests/catch/catch.hpp:17670:24: note: expanded from macro 'REQUIRE'
17670 | #define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/tests/catch/catch.hpp:2710:47: note: expanded from macro 'INTERNAL_CATCH_TEST'
2710 | catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mounted_pybind11/tests/test_embed/test_interpreter.cpp:127:9: note: operand 'v0' is here
127 | REQUIRE(ret == 42);
| ^
/build/tests/catch/catch.hpp:17670:24: note: expanded from macro 'REQUIRE'
17670 | #define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/tests/catch/catch.hpp:2710:47: note: expanded from macro 'INTERNAL_CATCH_TEST'
2710 | catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
| ^~~~~~~~~~~~~~~~~~~
/mounted_pybind11/tests/test_embed/test_interpreter.cpp:127:17: note: operand 'v1' is here
127 | REQUIRE(ret == 42);
| ^
/build/tests/catch/catch.hpp:17670:90: note: expanded from macro 'REQUIRE'
17670 | #define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
| ^~~~~~~~~~~
/build/tests/catch/catch.hpp:2710:70: note: expanded from macro 'INTERNAL_CATCH_TEST'
2710 | catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
| ^~~~~~~~~~~
/mounted_pybind11/tests/test_embed/test_interpreter.cpp:127:24: note: operand 'v2' is here
127 | REQUIRE(ret == 42);
| ^
/build/tests/catch/catch.hpp:17670:90: note: expanded from macro 'REQUIRE'
17670 | #define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
| ^~~~~~~~~~~
/build/tests/catch/catch.hpp:2710:70: note: expanded from macro 'INTERNAL_CATCH_TEST'
2710 | catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
| ^~~~~~~~~~~
```
* Add 8 `// NOLINT(bugprone-empty-catch)`
* Resolve clang-tidy `bugprone-multi-level-implicit-pointer-conversion` warnings.
________
Debian clang version 18.1.8 (++20240718080534+3b5b5c1ec4a3-1~exp1~20240718200641.143)
Target: x86_64-pc-linux-gnu
________
```
pybind11/detail/internals.h:556:53: warning: multilevel pointer conversion from 'internals **' to 'const void *', please use explicit cast [bugprone-multi-level-implicit-pointer-conversion]
pybind11/detail/type_caster_base.h:431:20: warning: multilevel pointer conversion from 'void **' to 'void *', please use explicit cast [bugprone-multi-level-implicit-pointer-conversion]
pybind11/numpy.h:904:81: warning: multilevel pointer conversion from '_object *const *' to 'const void *', please use explicit cast [bugprone-multi-level-implicit-pointer-conversion]
pybind11/numpy.h:1989:39: warning: multilevel pointer conversion from 'typename vectorize_arg<const double *>::type *' (aka 'const double **') to 'void *', please use explicit cast [bugprone-multi-level-implicit-pointer-conversion]
pybind11/numpy.h:1989:39: warning: multilevel pointer conversion from 'typename vectorize_arg<const VectorizeTestClass *>::type *' (aka 'const VectorizeTestClass **') to 'void *', please use explicit cast [bugprone-multi-level-implicit-pointer-conversion]
pybind11/stl/filesystem.h:75:44: warning: multilevel pointer conversion from 'PyObject **' (aka '_object **') to 'void *', please use explicit cast [bugprone-multi-level-implicit-pointer-conversion]
pybind11/stl/filesystem.h:83:42: warning: multilevel pointer conversion from 'PyObject **' (aka '_object **') to 'void *', please use explicit cast [bugprone-multi-level-implicit-pointer-conversion]
```
* Introduce `PYBIND11_REINTERPRET_CAST_VOID_PTR_IF_NOT_PYPY` to resolve PyPy build errors:
```
In file included from /Users/runner/work/pybind11/pybind11/tests/test_stl.cpp:18:
/Users/runner/work/pybind11/pybind11/include/pybind11/stl/filesystem.h:75:17: error: no matching function for call to 'PyPyUnicode_FSConverter'
if (PyUnicode_FSConverter(buf, reinterpret_cast<void *>(&native)) != 0) {
^~~~~~~~~~~~~~~~~~~~~
/Users/runner/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10/pypy_decl.h:969:31: note: expanded from macro 'PyUnicode_FSConverter'
^~~~~~~~~~~~~~~~~~~~~~~
/Users/runner/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10/pypy_decl.h:970:17: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to 'struct _object **' for 2nd argument
PyAPI_FUNC(int) PyUnicode_FSConverter(struct _object *arg0, struct _object **arg1);
^
/Users/runner/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10/pypy_decl.h:969:31: note: expanded from macro 'PyUnicode_FSConverter'
^
In file included from /Users/runner/work/pybind11/pybind11/tests/test_stl.cpp:18:
/Users/runner/work/pybind11/pybind11/include/pybind11/stl/filesystem.h:83:17: error: no matching function for call to 'PyPyUnicode_FSDecoder'
if (PyUnicode_FSDecoder(buf, reinterpret_cast<void *>(&native)) != 0) {
^~~~~~~~~~~~~~~~~~~
/Users/runner/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10/pypy_decl.h:971:29: note: expanded from macro 'PyUnicode_FSDecoder'
^~~~~~~~~~~~~~~~~~~~~
/Users/runner/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10/pypy_decl.h:972:17: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to 'struct _object **' for 2nd argument
PyAPI_FUNC(int) PyUnicode_FSDecoder(struct _object *arg0, struct _object **arg1);
^
/Users/runner/hostedtoolcache/PyPy/3.10.14/x64/include/pypy3.10/pypy_decl.h:971:29: note: expanded from macro 'PyUnicode_FSDecoder'
^
```
* clang-tidy auto-fix
* Fix silly oversight.
2024-07-29 18:10:03 +00:00
|
|
|
- clang: 17
|
|
|
|
std: 20
|
|
|
|
container_suffix: "-bookworm"
|
|
|
|
- clang: 18
|
|
|
|
std: 20
|
|
|
|
container_suffix: "-bookworm"
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64"
|
2023-01-13 01:50:28 +00:00
|
|
|
container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}"
|
2020-07-24 00:30:47 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-07-24 00:30:47 +00:00
|
|
|
|
|
|
|
- name: Add wget and python3
|
2020-07-26 17:44:10 +00:00
|
|
|
run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev
|
2020-07-24 00:30:47 +00:00
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
shell: bash
|
|
|
|
run: >
|
|
|
|
cmake -S . -B build
|
|
|
|
-DPYBIND11_WERROR=ON
|
|
|
|
-DDOWNLOAD_CATCH=ON
|
2020-10-15 18:58:34 +00:00
|
|
|
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
|
2020-07-24 00:30:47 +00:00
|
|
|
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
|
|
|
|
|
2020-07-22 14:24:11 +00:00
|
|
|
- name: Build
|
|
|
|
run: cmake --build build -j 2
|
|
|
|
|
|
|
|
- name: Python tests
|
2020-07-24 00:30:47 +00:00
|
|
|
run: cmake --build build --target pytest
|
2020-07-22 14:24:11 +00:00
|
|
|
|
|
|
|
- name: C++ tests
|
2020-07-24 00:30:47 +00:00
|
|
|
run: cmake --build build --target cpptest
|
2020-07-22 14:24:11 +00:00
|
|
|
|
|
|
|
- name: Interface test
|
|
|
|
run: cmake --build build --target test_cmake_build
|
2020-07-26 17:54:11 +00:00
|
|
|
|
2020-09-12 02:06:52 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# Testing NVCC; forces sources to behave like .cu files
|
2020-09-12 02:06:52 +00:00
|
|
|
cuda:
|
|
|
|
runs-on: ubuntu-latest
|
2023-07-04 12:38:14 +00:00
|
|
|
name: "🐍 3.10 • CUDA 12.2 • Ubuntu 22.04"
|
|
|
|
container: nvidia/cuda:12.2.0-devel-ubuntu22.04
|
2020-09-12 02:06:52 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-12 02:06:52 +00:00
|
|
|
|
|
|
|
# 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
|
2022-12-15 21:19:13 +00:00
|
|
|
run: cmake -S . -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
|
2020-09-12 02:06:52 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cmake --build build -j2 --verbose
|
|
|
|
|
|
|
|
- name: Python tests
|
|
|
|
run: cmake --build build --target pytest
|
|
|
|
|
|
|
|
|
2020-12-16 02:07:41 +00:00
|
|
|
# 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:
|
2023-09-06 19:57:18 +00:00
|
|
|
# - uses: actions/checkout@v4
|
2020-12-16 02:07:41 +00:00
|
|
|
#
|
|
|
|
# - 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
|
2022-12-15 21:19:13 +00:00
|
|
|
# cmake -S . -B build -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=14 -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
|
2020-12-16 02:07:41 +00:00
|
|
|
#
|
|
|
|
# - 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
|
2020-09-12 02:06:52 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
|
2023-08-04 18:17:33 +00:00
|
|
|
# Testing on Ubuntu + NVHPC (previous PGI) compilers, which seems to require more workarounds
|
|
|
|
ubuntu-nvhpc7:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: "🐍 3 • NVHPC 23.5 • C++17 • x64"
|
2020-09-12 02:06:52 +00:00
|
|
|
|
2023-08-04 18:17:33 +00:00
|
|
|
env:
|
|
|
|
# tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
|
|
|
|
DEBIAN_FRONTEND: 'noninteractive'
|
2020-09-12 02:06:52 +00:00
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-12 02:06:52 +00:00
|
|
|
|
2023-08-04 18:17:33 +00:00
|
|
|
- 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
|
2020-09-12 02:06:52 +00:00
|
|
|
|
2023-08-04 18:17:33 +00:00
|
|
|
- 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
|
2020-09-12 02:06:52 +00:00
|
|
|
|
2023-08-04 18:17:33 +00:00
|
|
|
# On some systems, you many need further workarounds:
|
2020-09-12 02:06:52 +00:00
|
|
|
# https://github.com/pybind/pybind11/pull/2475
|
|
|
|
- name: Configure
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
source /etc/profile.d/modules.sh
|
2023-08-04 18:17:33 +00:00
|
|
|
module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.5
|
|
|
|
cmake -S . -B build -DDOWNLOAD_CATCH=ON \
|
|
|
|
-DCMAKE_CXX_STANDARD=17 \
|
2020-09-12 02:06:52 +00:00
|
|
|
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \
|
|
|
|
-DCMAKE_CXX_FLAGS="-Wc,--pending_instantiations=0" \
|
2022-10-20 12:49:52 +00:00
|
|
|
-DPYBIND11_TEST_FILTER="test_smart_ptr.cpp"
|
2020-09-12 02:06:52 +00:00
|
|
|
|
|
|
|
- name: Build
|
2023-08-04 18:17:33 +00:00
|
|
|
run: cmake --build build -j 2 --verbose
|
2020-09-12 02:06:52 +00:00
|
|
|
|
|
|
|
- name: Python tests
|
2023-08-04 18:17:33 +00:00
|
|
|
run: cmake --build build --target pytest
|
2020-09-12 02:06:52 +00:00
|
|
|
|
|
|
|
- name: C++ tests
|
2023-08-04 18:17:33 +00:00
|
|
|
run: cmake --build build --target cpptest
|
2020-09-12 02:06:52 +00:00
|
|
|
|
|
|
|
- name: Interface test
|
2023-08-04 18:17:33 +00:00
|
|
|
run: cmake --build build --target test_cmake_build
|
2020-09-12 02:06:52 +00:00
|
|
|
|
2021-01-15 20:59:47 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# Testing on GCC using the GCC docker images (only recent images supported)
|
2020-07-26 17:54:11 +00:00
|
|
|
gcc:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2020-10-15 18:58:34 +00:00
|
|
|
include:
|
2024-06-28 05:20:28 +00:00
|
|
|
- { gcc: 9, std: 20 }
|
2023-06-24 19:12:35 +00:00
|
|
|
- { gcc: 10, std: 17 }
|
2024-06-28 05:20:28 +00:00
|
|
|
- { gcc: 10, std: 20 }
|
2023-06-24 19:12:35 +00:00
|
|
|
- { gcc: 11, std: 20 }
|
|
|
|
- { gcc: 12, std: 20 }
|
2023-08-03 20:36:29 +00:00
|
|
|
- { gcc: 13, std: 20 }
|
2020-07-26 17:54:11 +00:00
|
|
|
|
2020-10-15 18:58:34 +00:00
|
|
|
name: "🐍 3 • GCC ${{ matrix.gcc }} • C++${{ matrix.std }}• x64"
|
2023-06-24 19:12:35 +00:00
|
|
|
container: "gcc:${{ matrix.gcc }}"
|
2020-07-26 17:54:11 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-07-26 17:54:11 +00:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2021-01-13 19:32:11 +00:00
|
|
|
- name: Update CMake
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2.0
|
2020-07-26 17:54:11 +00:00
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
shell: bash
|
|
|
|
run: >
|
|
|
|
cmake -S . -B build
|
|
|
|
-DPYBIND11_WERROR=ON
|
|
|
|
-DDOWNLOAD_CATCH=ON
|
2020-10-15 18:58:34 +00:00
|
|
|
-DCMAKE_CXX_STANDARD=${{ matrix.std }}
|
2020-07-26 17:54:11 +00:00
|
|
|
-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
|
|
|
|
|
2023-04-25 17:25:57 +00:00
|
|
|
- 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
|
2020-09-12 02:06:52 +00:00
|
|
|
|
2021-01-15 20:59:47 +00:00
|
|
|
# Testing on ICC using the oneAPI apt repo
|
|
|
|
icc:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
name: "🐍 3 • ICC latest • x64"
|
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-01-15 20:59:47 +00:00
|
|
|
|
|
|
|
- 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
|
2021-10-26 18:50:34 +00:00
|
|
|
python3 -m pip install -r tests/requirements.txt
|
2021-01-15 20:59:47 +00:00
|
|
|
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
- name: Configure C++11
|
2021-01-15 20:59:47 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
cmake -S . -B build-11 \
|
2021-01-15 20:59:47 +00:00
|
|
|
-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)")
|
|
|
|
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
- name: Build C++11
|
2021-01-15 20:59:47 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
cmake --build build-11 -j 2 -v
|
2021-01-15 20:59:47 +00:00
|
|
|
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
- name: Python tests C++11
|
2021-01-15 20:59:47 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
|
|
|
sudo service apport stop
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
cmake --build build-11 --target check
|
2021-01-15 20:59:47 +00:00
|
|
|
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
- name: C++ tests C++11
|
2021-01-15 20:59:47 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
cmake --build build-11 --target cpptest
|
2021-01-15 20:59:47 +00:00
|
|
|
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
- name: Interface test C++11
|
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
|
|
|
cmake --build build-11 --target test_cmake_build
|
|
|
|
|
2022-01-11 20:13:02 +00:00
|
|
|
- name: Configure C++17
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
2022-01-11 20:13:02 +00:00
|
|
|
cmake -S . -B build-17 \
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
-DPYBIND11_WERROR=ON \
|
|
|
|
-DDOWNLOAD_CATCH=ON \
|
|
|
|
-DDOWNLOAD_EIGEN=OFF \
|
2022-01-11 20:13:02 +00:00
|
|
|
-DCMAKE_CXX_STANDARD=17 \
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
-DCMAKE_CXX_COMPILER=$(which icpc) \
|
|
|
|
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
|
|
|
|
|
2022-01-11 20:13:02 +00:00
|
|
|
- name: Build C++17
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
2022-01-11 20:13:02 +00:00
|
|
|
cmake --build build-17 -j 2 -v
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
|
2022-01-11 20:13:02 +00:00
|
|
|
- name: Python tests C++17
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
|
|
|
sudo service apport stop
|
2022-01-11 20:13:02 +00:00
|
|
|
cmake --build build-17 --target check
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
|
2022-01-11 20:13:02 +00:00
|
|
|
- name: C++ tests C++17
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
2022-01-11 20:13:02 +00:00
|
|
|
cmake --build build-17 --target cpptest
|
fix: Intel ICC C++17 compatibility (#2729)
* CI: Intel icc/icpc via oneAPI
Add testing for Intel icc/icpc via the oneAPI images.
Intel oneAPI is in a late beta stage, currently shipping
oneAPI beta09 with ICC 20.2.
CI: Skip Interpreter Tests for Intel
Cannot find how to add this, neiter the package `libc6-dev` nor
`intel-oneapi-mkl-devel` help when installed to solve this:
```
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
CMake Error at /__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/__t/cmake/3.18.4/x64/cmake-3.18.4-Linux-x86_64/share/cmake-3.18/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
tests/test_embed/CMakeLists.txt:17 (find_package)
```
CI: libc6-dev from GCC for ICC
CI: Run bare metal for oneAPI
CI: Ubuntu 18.04 for oneAPI
CI: Intel +Catch -Eigen
CI: CMake from Apt (ICC tests)
CI: Replace Intel Py with GCC Py
CI: Intel w/o GCC's Eigen
CI: ICC with verbose make
[Debug] Find core dump
tests: use arg{} instead of arg() for Intel
tests: adding a few more missing {}
fix: sync with @tobiasleibner's branch
fix: try ubuntu 20-04
fix: drop exit 1
docs: Apply suggestions from code review
Co-authored-by: Tobias Leibner <tobias.leibner@googlemail.com>
Workaround for ICC enable_if issues
Another workaround for ICC's enable_if issues
fix error in previous commit
Disable one test for the Intel compiler in C++17 mode
Add back one instance of py::arg().noconvert()
Add NOLINT to fix clang-tidy check
Work around for ICC internal error in PYBIND11_EXPAND_SIDE_EFFECTS in C++17 mode
CI: Intel ICC with C++17
docs: pybind11/numpy.h does not require numpy at build time. (#2720)
This is nice enough to be mentioned explicitly in the docs.
docs: Update warning about Python 3.9.0 UB, now that 3.9.1 has been released (#2719)
Adjusting `type_caster<std::reference_wrapper<T>>` to support const/non-const propagation in `cast_op`. (#2705)
* Allow type_caster of std::reference_wrapper<T> to be the same as a native reference.
Before, both std::reference_wrapper<T> and std::reference_wrapper<const T> would
invoke cast_op<type>. This doesn't allow the type_caster<> specialization for T
to distinguish reference_wrapper types from value types.
After, the type_caster<> specialization invokes cast_op<type&>, which allows
reference_wrapper to behave in the same way as a native reference type.
* Add tests/examples for std::reference_wrapper<const T>
* Add tests which use mutable/immutable variants
This test is a chimera; it blends the pybind11 casters with a custom
pytype implementation that supports immutable and mutable calls.
In order to detect the immutable/mutable state, the cast_op needs
to propagate it, even through e.g. std::reference<const T>
Note: This is still a work in progress; some things are crashing,
which likely means that I have a refcounting bug or something else
missing.
* Add/finish tests that distinguish const& from &
Fixes the bugs in my custom python type implementation,
demonstrate test that requires const& and reference_wrapper<const T>
being treated differently from Non-const.
* Add passing a const to non-const method.
* Demonstrate non-const conversion of reference_wrapper in tests.
Apply formatting presubmit check.
* Fix build errors from presubmit checks.
* Try and fix a few more CI errors
* More CI fixes.
* More CI fixups.
* Try and get PyPy to work.
* Additional minor fixups. Getting close to CI green.
* More ci fixes?
* fix clang-tidy warnings from presubmit
* fix more clang-tidy warnings
* minor comment and consistency cleanups
* PyDECREF -> Py_DECREF
* copy/move constructors
* Resolve codereview comments
* more review comment fixes
* review comments: remove spurious &
* Make the test fail even when the static_assert is commented out.
This expands the test_freezable_type_caster a bit by:
1/ adding accessors .is_immutable and .addr to compare identity
from python.
2/ Changing the default cast_op of the type_caster<> specialization
to return a non-const value. In normal codepaths this is a reasonable
default.
3/ adding roundtrip variants to exercise the by reference, by pointer
and by reference_wrapper in all call paths. In conjunction with 2/, this
demonstrates the failure case of the existing std::reference_wrpper conversion,
which now loses const in a similar way that happens when using the default cast_op_type<>.
* apply presubmit formatting
* Revert inclusion of test_freezable_type_caster
There's some concern that this test is a bit unwieldly because of the use
of the raw <Python.h> functions. Removing for now.
* Add a test that validates const references propagation.
This test verifies that cast_op may be used to correctly detect
const reference types when used with std::reference_wrapper.
* mend
* Review comments based changes.
1. std::add_lvalue_reference<type> -> type&
2. Simplify the test a little more; we're never returning the ConstRefCaster
type so the class_ definition can be removed.
* formatted files again.
* Move const_ref_caster test to builtin_casters
* Review comments: use cast_op and adjust some comments.
* Simplify ConstRefCasted test
I like this version better as it moves the assertion that matters
back into python.
ci: drop pypy2 linux, PGI 20.7, add Python 10 dev (#2724)
* ci: drop pypy2 linux, add Python 10 dev
* ci: fix mistake
* ci: commented-out PGI 20.11, drop 20.7
fix: regression with installed pybind11 overriding local one (#2716)
* fix: regression with installed pybind11 overriding discovered one
Closes #2709
* docs: wording incorrect
style: remove redundant instance->owned = true (#2723)
which was just before set to True in instance->allocate_layout()
fix: also throw in the move-constructor added by the PYBIND11_OBJECT macro, after the argument has been moved-out (if necessary) (#2701)
Make args_are_all_* ICC workarounds unconditional
Disable test_aligned on Intel ICC
Fix test_aligned on Intel ICC
Skip test_python_alreadyset_in_destructor on Intel ICC
Fix test_aligned again
ICC CI: Downgrade pytest
pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.
* refactor: simpler Intel workaround, suggested by @laramiel
* fix: try version with impl to see if it is easier to compile
* docs: update README for ICC
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-18 00:53:07 +00:00
|
|
|
|
2022-01-11 20:13:02 +00:00
|
|
|
- name: Interface test C++17
|
2021-01-15 20:59:47 +00:00
|
|
|
run: |
|
|
|
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
2022-01-11 20:13:02 +00:00
|
|
|
cmake --build build-17 --target test_cmake_build
|
2021-01-15 20:59:47 +00:00
|
|
|
|
|
|
|
|
2024-06-22 04:55:00 +00:00
|
|
|
# Testing on CentOS (manylinux uses a centos base).
|
2020-07-26 17:54:11 +00:00
|
|
|
centos:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-06-21 18:55:49 +00:00
|
|
|
container:
|
|
|
|
- "almalinux:8"
|
|
|
|
- "almalinux:9"
|
2020-07-26 17:54:11 +00:00
|
|
|
|
2022-06-21 18:55:49 +00:00
|
|
|
name: "🐍 3 • ${{ matrix.container }} • x64"
|
|
|
|
container: "${{ matrix.container }}"
|
2020-07-26 17:54:11 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- name: Latest actions/checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-06-22 04:55:00 +00:00
|
|
|
- name: Add Python 3.8
|
|
|
|
if: matrix.container == 'almalinux:8'
|
|
|
|
run: dnf update -y && dnf install -y python38-devel gcc-c++ make git
|
2020-07-26 17:54:11 +00:00
|
|
|
|
2024-06-22 04:55:00 +00:00
|
|
|
- name: Add Python 3 (default)
|
|
|
|
if: matrix.container != 'almalinux:8'
|
2022-06-21 18:55:49 +00:00
|
|
|
run: dnf update -y && dnf install -y python3-devel gcc-c++ make git
|
|
|
|
|
2020-07-26 17:54:11 +00:00
|
|
|
- name: Update pip
|
|
|
|
run: python3 -m pip install --upgrade pip
|
|
|
|
|
|
|
|
- name: Install dependencies
|
2021-10-26 18:50:34 +00:00
|
|
|
run: |
|
|
|
|
python3 -m pip install cmake -r tests/requirements.txt
|
2020-07-26 17:54:11 +00:00
|
|
|
|
2024-03-26 22:20:11 +00:00
|
|
|
- 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'
|
|
|
|
|
2020-07-26 17:54:11 +00:00
|
|
|
- name: Configure
|
|
|
|
shell: bash
|
|
|
|
run: >
|
|
|
|
cmake -S . -B build
|
2022-02-02 16:25:28 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=MinSizeRel
|
2020-07-26 17:54:11 +00:00
|
|
|
-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
|
2020-07-26 18:15:20 +00:00
|
|
|
|
2020-09-10 15:49:26 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# This tests an "install" with the CMake tools
|
2020-07-26 18:15:20 +00:00
|
|
|
install-classic:
|
feat: remove Python 3.7 support (#5191)
* First pass updating misc files, informed by https://github.com/pybind/pybind11/pull/5177/commits
* Remove jobs using silkeh/clang and gcc docker containers that come with Python 3.7
* Add silkeh/clang:17-bookworm
* Add job using GCC 7
* Revert "Add job using GCC 7"
This reverts commit 518515a761ac37dc2cf5d0980da82d0de39edc28.
* Try running in ubuntu-18.04 container under ubuntu-latest (to get GCC 7)
* Fix `-` vs `:` mixup.
* This reverts commit b1c4304475b8ad129c12330c7ed7eb85d15ba14a.
Revert "Try running in ubuntu:18.04 container under ubuntu-latest (to get GCC 7)"
This reverts commit b203a294bb444fc6ae57a0100fa91dc91b8d3264.
* `git grep 0x03080000` cleanup.
* `git grep -I -E '3\.7'` cleanup.
Removes two changes made under pybind/pybind11#3702
* Revert "`git grep -I -E '3\.7'` cleanup."
This reverts commit bb5b9d187bffbfb61e2977d7eee46b766fa1cce9.
* Remove comments that are evidently incorrect:
```
...
-- The CXX compiler identification is Clang 15.0.7
...
- Found Python: /usr/bin/python3.9 (found suitable version "3.9.2", minimum required is "3.7") found components: Interpreter Development.Module Development.Embed
...
/__w/pybind11/pybind11/include/pybind11/gil.h:150:13: error: 'auto key' can be declared as 'auto *key' [readability-qualified-auto,-warnings-as-errors]
auto key = internals.tstate;
^~~~~
auto *
/__w/pybind11/pybind11/include/pybind11/gil.h:174:13: error: 'auto key' can be declared as 'auto *key' [readability-qualified-auto,-warnings-as-errors]
auto key = detail::get_internals().tstate;
^~~~~
auto *
```
* .github/workflows/configure.yml: Change from Python 3.7 to 3.8
* Misc cleanup pass
* Miscellaneous changes based on manual review of the `git grep` matches below:
```
git_grep_37_38.sh |& sort | uniq -c
```
With git_grep_37_38.sh:
```
set -x
git grep 0x0307
git grep 0x0308
git grep PY_MINOR_VERSION
git grep PYPY_VERSION
git grep -I -E '3\.7'
git grep -I -E '3\.8'
git grep -I -E '\(3, 7'
git grep -I -E '\(3, 8'
git grep -I -E '3[^A-Za-z0-9.]+7'
git grep -I -E '3[^A-Za-z0-9.]+8'
```
Output:
```
1 .appveyor.yml: $env:CMAKE_INCLUDE_PATH = "eigen-3.3.7;$env:CMAKE_INCLUDE_PATH"
1 .appveyor.yml: 7z x eigen-3.3.7.zip -y > $null
1 .appveyor.yml: Start-FileDownload 'https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip'
1 CMakeLists.txt: # Bug in macOS CMake < 3.7 is unable to download catch
1 CMakeLists.txt: elseif(WINDOWS AND CMAKE_VERSION VERSION_LESS 3.8)
1 CMakeLists.txt: if(OSX AND CMAKE_VERSION VERSION_LESS 3.7)
1 CMakeLists.txt: message(WARNING "CMAKE 3.7+ needed on macOS to download catch, and newer HIGHLY recommended")
1 CMakeLists.txt: message(WARNING "CMAKE 3.8+ tested on Windows, previous versions untested")
1 CMakeLists.txt: # Only tested with 3.8+ in CI.
1 docs/advanced/functions.rst:Python 3.8 introduced a new positional-only argument syntax, using ``/`` in the
1 docs/changelog.rst:* Adapt pybind11 to a C API convention change in Python 3.8. `#1950
1 docs/changelog.rst:* Allow thread termination to be avoided during shutdown for CPython 3.7+ via
1 docs/changelog.rst: considered as conversion, consistent with Python 3.8+.
1 docs/changelog.rst: CPython 3.8 and 3.9 debug builds.
1 docs/changelog.rst:* Enum now has an ``__index__`` method on Python <3.8 too.
1 docs/changelog.rst: on Python 3.8. `#1780 <https://github.com/pybind/pybind11/pull/1780>`_.
1 docs/changelog.rst:* PyPy 3.10 support was added, PyPy 3.7 support was dropped.
2 docs/changelog.rst:* Support PyPy 7.3.7 and the PyPy3.8 beta. Test python-3.11 on PRs with the
1 docs/changelog.rst:* Use ``macos-13`` (Intel) for CI jobs for now (will drop Python 3.7 soon).
1 docs/changelog.rst:* Use new Python 3.7 Thread Specific Storage (TSS) implementation if available.
1 docs/compiling.rst: cmake -DPYBIND11_PYTHON_VERSION=3.8 ..
1 docs/compiling.rst: find_package(Python 3.8 COMPONENTS Interpreter Development REQUIRED)
1 docs/limitations.rst:- PyPy3 7.3.1 and 7.3.2 have issues with several tests on 32-bit Windows.
1 docs/requirements.txt:idna==3.7 \
1 + git grep 0x0307
1 + git grep 0x0308
1 + git grep -I -E '\(3, 7'
1 + git grep -I -E '3\.7'
1 + git grep -I -E '\(3, 8'
1 + git grep -I -E '3\.8'
1 + git grep -I -E '3[^A-Za-z0-9.]+7'
1 + git grep -I -E '3[^A-Za-z0-9.]+8'
1 + git grep PY_MINOR_VERSION
1 + git grep PYPY_VERSION
2 .github/workflows/ci.yml: - '3.8'
1 .github/workflows/ci.yml: - 3.8
1 .github/workflows/ci.yml: - name: Add Python 3.8
1 .github/workflows/ci.yml: - 'pypy-3.8'
2 .github/workflows/ci.yml: python: '3.8'
1 .github/workflows/ci.yml: - python: '3.8'
1 .github/workflows/ci.yml: - python: 3.8
1 .github/workflows/ci.yml: python: 'pypy-3.8'
1 .github/workflows/configure.yml: cmake: "3.8"
1 .github/workflows/configure.yml: name: 🐍 3.8 • CMake ${{ matrix.cmake }} • ${{ matrix.runs-on }}
1 .github/workflows/configure.yml: - name: Setup Python 3.8
1 .github/workflows/configure.yml: python-version: 3.8
1 .github/workflows/pip.yml: name: 🐍 3.8 • 📦 & 📦 tests • ubuntu-latest
1 .github/workflows/pip.yml: name: 🐍 3.8 • 📦 tests • windows-latest
2 .github/workflows/pip.yml: - name: Setup 🐍 3.8
2 .github/workflows/pip.yml: python-version: 3.8
2 include/pybind11/cast.h:#if !defined(PYPY_VERSION)
2 include/pybind11/cast.h:#if defined(PYPY_VERSION)
2 include/pybind11/cast.h: // PyPy: 7.3.7's 3.8 does not implement PyLong_*'s __index__ calls.
5 include/pybind11/detail/class.h:#if !defined(PYPY_VERSION)
1 include/pybind11/detail/class.h:#if defined(PYPY_VERSION)
1 include/pybind11/detail/class.h: // This was not needed before Python 3.8 (Python issue 35810)
1 include/pybind11/detail/common.h: && !defined(PYPY_VERSION) && !defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
2 include/pybind11/detail/common.h:# error "PYTHON < 3.8 IS UNSUPPORTED. pybind11 v2.13 was the last to support Python 3.7."
1 include/pybind11/detail/common.h:#if defined(PYPY_VERSION) && !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
1 include/pybind11/detail/common.h:#if PY_VERSION_HEX < 0x03080000
1 include/pybind11/detail/common.h: = PYBIND11_TOSTRING(PY_MAJOR_VERSION) "." PYBIND11_TOSTRING(PY_MINOR_VERSION); \
1 include/pybind11/detail/internals.h: // called. PYBIND11_TLS_FREE is PyThread_tss_free on python 3.7+. On older python, it does
1 include/pybind11/detail/internals.h:#if PYBIND11_INTERNALS_VERSION <= 4 || defined(PYPY_VERSION)
1 include/pybind11/detail/internals.h:// The old Python Thread Local Storage (TLS) API is deprecated in Python 3.7 in favor of the new
1 include/pybind11/detail/type_caster_base.h:#if defined(PYPY_VERSION)
1 include/pybind11/embed.h:# define PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX (0x03080000)
1 include/pybind11/embed.h:#if defined(PYPY_VERSION)
1 include/pybind11/eval.h: // globals if not yet present. Python 3.8 made PyRun_String behave
2 include/pybind11/eval.h:#if defined(PYPY_VERSION)
2 include/pybind11/eval.h: // was missing from PyPy3.8 7.3.7.
2 include/pybind11/gil.h: /// allowed during shutdown. Check _Py_IsFinalizing() on Python 3.7+, and
1 include/pybind11/pybind11.h:#if !defined(PYPY_VERSION)
4 include/pybind11/pybind11.h:#if !defined(PYPY_VERSION) && PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 9
1 include/pybind11/pytypes.h:#endif //! defined(PYPY_VERSION)
2 include/pybind11/pytypes.h:#if !defined(PYPY_VERSION)
1 include/pybind11/pytypes.h:# if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x07030a00
1 include/pybind11/pytypes.h:#ifdef PYPY_VERSION
1 include/pybind11/stl/filesystem.h:# if !defined(PYPY_VERSION)
2 pybind11/__init__.py:if sys.version_info < (3, 8):
2 pybind11/__init__.py: msg = "pybind11 does not support Python < 3.8. v2.13 was the last release supporting Python 3.7."
1 pyproject.toml:master.py-version = "3.8"
1 pyproject.toml:python_version = "3.8"
1 README.rst:lines of code and depend on Python (3.8+, or PyPy) and the C++
2 README.rst:- Python 3.8+, and PyPy3 7.3 are supported with an implementation-agnostic
1 setup.cfg: Programming Language :: Python :: 3.8
1 setup.cfg:python_requires = >=3.8
1 setup.py:# TODO: use literals & overload (typing extensions or Python 3.8)
1 tests/CMakeLists.txt:if(NOT CMAKE_VERSION VERSION_LESS 3.8)
2 tests/constructor_stats.h:#if defined(PYPY_VERSION)
1 tests/env.py: doesn't work on CPython 3.8.0 with pytest==3.3.2 on Ubuntu 18.04 (#2922).
1 tests/requirements.txt:build~=1.0; python_version>="3.8"
1 tests/requirements.txt:numpy~=1.21.5; platform_python_implementation!="PyPy" and python_version>="3.8" and python_version<"3.10"
1 tests/requirements.txt:numpy~=1.23.0; python_version=="3.8" and platform_python_implementation=="PyPy"
1 tests/test_buffers.py: env.PYPY, reason="PyPy 7.3.7 doesn't clear this anymore", strict=False
1 tests/test_builtin_casters.py: # Before Python 3.8, `PyLong_AsLong` does not pick up on `obj.__index__`,
2 tests/test_builtin_casters.py: if (3, 8) <= sys.version_info < (3, 10) and env.CPYTHON:
4 tests/test_builtin_casters.py: # TODO: PyPy 3.8 does not behave like CPython 3.8 here yet (7.3.7)
1 tests/test_callbacks.py: assert m.test_callback3(z.double) == "func(43) = 86"
2 tests/test_call_policies.cpp:#if !defined(PYPY_VERSION)
1 tests/test_chrono.py: diff = m.test_chrono_float_diff(43.789012, 1.123456)
1 tests/test_constants_and_functions.py: assert m.f3(86) == 89
1 tests/test_eigen_matrix.py: a_copy3[8, 1] = 11
1 tests/test_eigen_matrix.py: assert np.all(cornersc == np.array([[1.0, 3], [7, 9]]))
1 tests/test_eigen_matrix.py: assert np.all(cornersr == np.array([[1.0, 3], [7, 9]]))
1 tests/test_eigen_matrix.py: mymat = chol(np.array([[1.0, 2, 4], [2, 13, 23], [4, 23, 77]]))
1 tests/test_exceptions.py: if hasattr(pytest, unraisable): # Python >= 3.8 and pytest >= 6
2 tests/test_exceptions.py:@pytest.mark.xfail(env.PYPY, reason="Failure on PyPy 3.8 (7.3.7)", strict=False)
1 tests/test_factory_constructors.py: assert [i.alive() for i in cstats] == [13, 7]
1 tests/test_kwargs_and_defaults.cpp:#ifdef PYPY_VERSION
1 tests/test_local_bindings.py: assert i1.get3() == 8
1 tests/test_methods_and_attributes.cpp:#if !defined(PYPY_VERSION)
1 tests/test_numpy_array.py: a = np.arange(3 * 7 * 2) + 1
1 tests/test_numpy_array.py: assert str(excinfo.value) == "cannot reshape array of size 42 into shape (3,7,1)"
2 tests/test_numpy_array.py: assert x.shape == (3, 7, 2)
2 tests/test_numpy_array.py: m.reshape_tuple(a, (3, 7, 1))
2 tests/test_numpy_array.py: x = m.reshape_tuple(a, (3, 7, 2))
1 tests/test_numpy_vectorize.py: assert np.isclose(m.vectorized_func3(np.array(3 + 7j)), [6 + 14j])
1 tests/test_pickling.cpp:#if !defined(PYPY_VERSION)
1 tests/test_pytypes.cpp:#if (defined(__APPLE__) && defined(__clang__)) || defined(PYPY_VERSION)
1 tests/test_smart_ptr.cpp: m.def("make_myobject3_1", []() { return new MyObject3(8); });
1 tests/test_smart_ptr.py: assert cstats.values() == ["MyObject3[9]", "MyObject3[8]", "MyObject3[9]"]
1 tests/test_stl_binders.py: assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 88])
1 tests/test_stl_binders.py: assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 88, 4])
1 tests/test_type_caster_pyobject_ptr.cpp:#if !defined(PYPY_VERSION) // It is not worth the trouble doing something special for PyPy.
1 tools/FindPythonLibsNew.cmake: set(PythonLibsNew_FIND_VERSION "3.8")
1 tools/JoinPaths.cmake:# https://docs.python.org/3.7/library/os.path.html#os.path.join
1 tools/pybind11NewTools.cmake: Python 3.8 REQUIRED COMPONENTS ${_pybind11_interp_component} ${_pybind11_dev_component}
1 tools/pybind11NewTools.cmake:# Python debug libraries expose slightly different objects before 3.8
1 tools/pybind11Tools.cmake: "3.12;3.11;3.10;3.9;3.8"
1 tools/pybind11Tools.cmake: if(NOT DEFINED PYPY_VERSION)
1 tools/pybind11Tools.cmake: message(STATUS "PYPY ${PYPY_VERSION} (Py ${PYTHON_VERSION})")
1 tools/pybind11Tools.cmake:# Python debug libraries expose slightly different objects before 3.8
1 tools/pybind11Tools.cmake: set(PYPY_VERSION
```
* Change `[tool.ruff]` `target-version` to `"py38"`, as suggested by @Skylion007
2024-07-30 16:18:35 +00:00
|
|
|
name: "🐍 3.9 • Debian • x86 • Install"
|
2020-07-26 18:15:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
feat: remove Python 3.7 support (#5191)
* First pass updating misc files, informed by https://github.com/pybind/pybind11/pull/5177/commits
* Remove jobs using silkeh/clang and gcc docker containers that come with Python 3.7
* Add silkeh/clang:17-bookworm
* Add job using GCC 7
* Revert "Add job using GCC 7"
This reverts commit 518515a761ac37dc2cf5d0980da82d0de39edc28.
* Try running in ubuntu-18.04 container under ubuntu-latest (to get GCC 7)
* Fix `-` vs `:` mixup.
* This reverts commit b1c4304475b8ad129c12330c7ed7eb85d15ba14a.
Revert "Try running in ubuntu:18.04 container under ubuntu-latest (to get GCC 7)"
This reverts commit b203a294bb444fc6ae57a0100fa91dc91b8d3264.
* `git grep 0x03080000` cleanup.
* `git grep -I -E '3\.7'` cleanup.
Removes two changes made under pybind/pybind11#3702
* Revert "`git grep -I -E '3\.7'` cleanup."
This reverts commit bb5b9d187bffbfb61e2977d7eee46b766fa1cce9.
* Remove comments that are evidently incorrect:
```
...
-- The CXX compiler identification is Clang 15.0.7
...
- Found Python: /usr/bin/python3.9 (found suitable version "3.9.2", minimum required is "3.7") found components: Interpreter Development.Module Development.Embed
...
/__w/pybind11/pybind11/include/pybind11/gil.h:150:13: error: 'auto key' can be declared as 'auto *key' [readability-qualified-auto,-warnings-as-errors]
auto key = internals.tstate;
^~~~~
auto *
/__w/pybind11/pybind11/include/pybind11/gil.h:174:13: error: 'auto key' can be declared as 'auto *key' [readability-qualified-auto,-warnings-as-errors]
auto key = detail::get_internals().tstate;
^~~~~
auto *
```
* .github/workflows/configure.yml: Change from Python 3.7 to 3.8
* Misc cleanup pass
* Miscellaneous changes based on manual review of the `git grep` matches below:
```
git_grep_37_38.sh |& sort | uniq -c
```
With git_grep_37_38.sh:
```
set -x
git grep 0x0307
git grep 0x0308
git grep PY_MINOR_VERSION
git grep PYPY_VERSION
git grep -I -E '3\.7'
git grep -I -E '3\.8'
git grep -I -E '\(3, 7'
git grep -I -E '\(3, 8'
git grep -I -E '3[^A-Za-z0-9.]+7'
git grep -I -E '3[^A-Za-z0-9.]+8'
```
Output:
```
1 .appveyor.yml: $env:CMAKE_INCLUDE_PATH = "eigen-3.3.7;$env:CMAKE_INCLUDE_PATH"
1 .appveyor.yml: 7z x eigen-3.3.7.zip -y > $null
1 .appveyor.yml: Start-FileDownload 'https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip'
1 CMakeLists.txt: # Bug in macOS CMake < 3.7 is unable to download catch
1 CMakeLists.txt: elseif(WINDOWS AND CMAKE_VERSION VERSION_LESS 3.8)
1 CMakeLists.txt: if(OSX AND CMAKE_VERSION VERSION_LESS 3.7)
1 CMakeLists.txt: message(WARNING "CMAKE 3.7+ needed on macOS to download catch, and newer HIGHLY recommended")
1 CMakeLists.txt: message(WARNING "CMAKE 3.8+ tested on Windows, previous versions untested")
1 CMakeLists.txt: # Only tested with 3.8+ in CI.
1 docs/advanced/functions.rst:Python 3.8 introduced a new positional-only argument syntax, using ``/`` in the
1 docs/changelog.rst:* Adapt pybind11 to a C API convention change in Python 3.8. `#1950
1 docs/changelog.rst:* Allow thread termination to be avoided during shutdown for CPython 3.7+ via
1 docs/changelog.rst: considered as conversion, consistent with Python 3.8+.
1 docs/changelog.rst: CPython 3.8 and 3.9 debug builds.
1 docs/changelog.rst:* Enum now has an ``__index__`` method on Python <3.8 too.
1 docs/changelog.rst: on Python 3.8. `#1780 <https://github.com/pybind/pybind11/pull/1780>`_.
1 docs/changelog.rst:* PyPy 3.10 support was added, PyPy 3.7 support was dropped.
2 docs/changelog.rst:* Support PyPy 7.3.7 and the PyPy3.8 beta. Test python-3.11 on PRs with the
1 docs/changelog.rst:* Use ``macos-13`` (Intel) for CI jobs for now (will drop Python 3.7 soon).
1 docs/changelog.rst:* Use new Python 3.7 Thread Specific Storage (TSS) implementation if available.
1 docs/compiling.rst: cmake -DPYBIND11_PYTHON_VERSION=3.8 ..
1 docs/compiling.rst: find_package(Python 3.8 COMPONENTS Interpreter Development REQUIRED)
1 docs/limitations.rst:- PyPy3 7.3.1 and 7.3.2 have issues with several tests on 32-bit Windows.
1 docs/requirements.txt:idna==3.7 \
1 + git grep 0x0307
1 + git grep 0x0308
1 + git grep -I -E '\(3, 7'
1 + git grep -I -E '3\.7'
1 + git grep -I -E '\(3, 8'
1 + git grep -I -E '3\.8'
1 + git grep -I -E '3[^A-Za-z0-9.]+7'
1 + git grep -I -E '3[^A-Za-z0-9.]+8'
1 + git grep PY_MINOR_VERSION
1 + git grep PYPY_VERSION
2 .github/workflows/ci.yml: - '3.8'
1 .github/workflows/ci.yml: - 3.8
1 .github/workflows/ci.yml: - name: Add Python 3.8
1 .github/workflows/ci.yml: - 'pypy-3.8'
2 .github/workflows/ci.yml: python: '3.8'
1 .github/workflows/ci.yml: - python: '3.8'
1 .github/workflows/ci.yml: - python: 3.8
1 .github/workflows/ci.yml: python: 'pypy-3.8'
1 .github/workflows/configure.yml: cmake: "3.8"
1 .github/workflows/configure.yml: name: 🐍 3.8 • CMake ${{ matrix.cmake }} • ${{ matrix.runs-on }}
1 .github/workflows/configure.yml: - name: Setup Python 3.8
1 .github/workflows/configure.yml: python-version: 3.8
1 .github/workflows/pip.yml: name: 🐍 3.8 • 📦 & 📦 tests • ubuntu-latest
1 .github/workflows/pip.yml: name: 🐍 3.8 • 📦 tests • windows-latest
2 .github/workflows/pip.yml: - name: Setup 🐍 3.8
2 .github/workflows/pip.yml: python-version: 3.8
2 include/pybind11/cast.h:#if !defined(PYPY_VERSION)
2 include/pybind11/cast.h:#if defined(PYPY_VERSION)
2 include/pybind11/cast.h: // PyPy: 7.3.7's 3.8 does not implement PyLong_*'s __index__ calls.
5 include/pybind11/detail/class.h:#if !defined(PYPY_VERSION)
1 include/pybind11/detail/class.h:#if defined(PYPY_VERSION)
1 include/pybind11/detail/class.h: // This was not needed before Python 3.8 (Python issue 35810)
1 include/pybind11/detail/common.h: && !defined(PYPY_VERSION) && !defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
2 include/pybind11/detail/common.h:# error "PYTHON < 3.8 IS UNSUPPORTED. pybind11 v2.13 was the last to support Python 3.7."
1 include/pybind11/detail/common.h:#if defined(PYPY_VERSION) && !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
1 include/pybind11/detail/common.h:#if PY_VERSION_HEX < 0x03080000
1 include/pybind11/detail/common.h: = PYBIND11_TOSTRING(PY_MAJOR_VERSION) "." PYBIND11_TOSTRING(PY_MINOR_VERSION); \
1 include/pybind11/detail/internals.h: // called. PYBIND11_TLS_FREE is PyThread_tss_free on python 3.7+. On older python, it does
1 include/pybind11/detail/internals.h:#if PYBIND11_INTERNALS_VERSION <= 4 || defined(PYPY_VERSION)
1 include/pybind11/detail/internals.h:// The old Python Thread Local Storage (TLS) API is deprecated in Python 3.7 in favor of the new
1 include/pybind11/detail/type_caster_base.h:#if defined(PYPY_VERSION)
1 include/pybind11/embed.h:# define PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX (0x03080000)
1 include/pybind11/embed.h:#if defined(PYPY_VERSION)
1 include/pybind11/eval.h: // globals if not yet present. Python 3.8 made PyRun_String behave
2 include/pybind11/eval.h:#if defined(PYPY_VERSION)
2 include/pybind11/eval.h: // was missing from PyPy3.8 7.3.7.
2 include/pybind11/gil.h: /// allowed during shutdown. Check _Py_IsFinalizing() on Python 3.7+, and
1 include/pybind11/pybind11.h:#if !defined(PYPY_VERSION)
4 include/pybind11/pybind11.h:#if !defined(PYPY_VERSION) && PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 9
1 include/pybind11/pytypes.h:#endif //! defined(PYPY_VERSION)
2 include/pybind11/pytypes.h:#if !defined(PYPY_VERSION)
1 include/pybind11/pytypes.h:# if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x07030a00
1 include/pybind11/pytypes.h:#ifdef PYPY_VERSION
1 include/pybind11/stl/filesystem.h:# if !defined(PYPY_VERSION)
2 pybind11/__init__.py:if sys.version_info < (3, 8):
2 pybind11/__init__.py: msg = "pybind11 does not support Python < 3.8. v2.13 was the last release supporting Python 3.7."
1 pyproject.toml:master.py-version = "3.8"
1 pyproject.toml:python_version = "3.8"
1 README.rst:lines of code and depend on Python (3.8+, or PyPy) and the C++
2 README.rst:- Python 3.8+, and PyPy3 7.3 are supported with an implementation-agnostic
1 setup.cfg: Programming Language :: Python :: 3.8
1 setup.cfg:python_requires = >=3.8
1 setup.py:# TODO: use literals & overload (typing extensions or Python 3.8)
1 tests/CMakeLists.txt:if(NOT CMAKE_VERSION VERSION_LESS 3.8)
2 tests/constructor_stats.h:#if defined(PYPY_VERSION)
1 tests/env.py: doesn't work on CPython 3.8.0 with pytest==3.3.2 on Ubuntu 18.04 (#2922).
1 tests/requirements.txt:build~=1.0; python_version>="3.8"
1 tests/requirements.txt:numpy~=1.21.5; platform_python_implementation!="PyPy" and python_version>="3.8" and python_version<"3.10"
1 tests/requirements.txt:numpy~=1.23.0; python_version=="3.8" and platform_python_implementation=="PyPy"
1 tests/test_buffers.py: env.PYPY, reason="PyPy 7.3.7 doesn't clear this anymore", strict=False
1 tests/test_builtin_casters.py: # Before Python 3.8, `PyLong_AsLong` does not pick up on `obj.__index__`,
2 tests/test_builtin_casters.py: if (3, 8) <= sys.version_info < (3, 10) and env.CPYTHON:
4 tests/test_builtin_casters.py: # TODO: PyPy 3.8 does not behave like CPython 3.8 here yet (7.3.7)
1 tests/test_callbacks.py: assert m.test_callback3(z.double) == "func(43) = 86"
2 tests/test_call_policies.cpp:#if !defined(PYPY_VERSION)
1 tests/test_chrono.py: diff = m.test_chrono_float_diff(43.789012, 1.123456)
1 tests/test_constants_and_functions.py: assert m.f3(86) == 89
1 tests/test_eigen_matrix.py: a_copy3[8, 1] = 11
1 tests/test_eigen_matrix.py: assert np.all(cornersc == np.array([[1.0, 3], [7, 9]]))
1 tests/test_eigen_matrix.py: assert np.all(cornersr == np.array([[1.0, 3], [7, 9]]))
1 tests/test_eigen_matrix.py: mymat = chol(np.array([[1.0, 2, 4], [2, 13, 23], [4, 23, 77]]))
1 tests/test_exceptions.py: if hasattr(pytest, unraisable): # Python >= 3.8 and pytest >= 6
2 tests/test_exceptions.py:@pytest.mark.xfail(env.PYPY, reason="Failure on PyPy 3.8 (7.3.7)", strict=False)
1 tests/test_factory_constructors.py: assert [i.alive() for i in cstats] == [13, 7]
1 tests/test_kwargs_and_defaults.cpp:#ifdef PYPY_VERSION
1 tests/test_local_bindings.py: assert i1.get3() == 8
1 tests/test_methods_and_attributes.cpp:#if !defined(PYPY_VERSION)
1 tests/test_numpy_array.py: a = np.arange(3 * 7 * 2) + 1
1 tests/test_numpy_array.py: assert str(excinfo.value) == "cannot reshape array of size 42 into shape (3,7,1)"
2 tests/test_numpy_array.py: assert x.shape == (3, 7, 2)
2 tests/test_numpy_array.py: m.reshape_tuple(a, (3, 7, 1))
2 tests/test_numpy_array.py: x = m.reshape_tuple(a, (3, 7, 2))
1 tests/test_numpy_vectorize.py: assert np.isclose(m.vectorized_func3(np.array(3 + 7j)), [6 + 14j])
1 tests/test_pickling.cpp:#if !defined(PYPY_VERSION)
1 tests/test_pytypes.cpp:#if (defined(__APPLE__) && defined(__clang__)) || defined(PYPY_VERSION)
1 tests/test_smart_ptr.cpp: m.def("make_myobject3_1", []() { return new MyObject3(8); });
1 tests/test_smart_ptr.py: assert cstats.values() == ["MyObject3[9]", "MyObject3[8]", "MyObject3[9]"]
1 tests/test_stl_binders.py: assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 88])
1 tests/test_stl_binders.py: assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 88, 4])
1 tests/test_type_caster_pyobject_ptr.cpp:#if !defined(PYPY_VERSION) // It is not worth the trouble doing something special for PyPy.
1 tools/FindPythonLibsNew.cmake: set(PythonLibsNew_FIND_VERSION "3.8")
1 tools/JoinPaths.cmake:# https://docs.python.org/3.7/library/os.path.html#os.path.join
1 tools/pybind11NewTools.cmake: Python 3.8 REQUIRED COMPONENTS ${_pybind11_interp_component} ${_pybind11_dev_component}
1 tools/pybind11NewTools.cmake:# Python debug libraries expose slightly different objects before 3.8
1 tools/pybind11Tools.cmake: "3.12;3.11;3.10;3.9;3.8"
1 tools/pybind11Tools.cmake: if(NOT DEFINED PYPY_VERSION)
1 tools/pybind11Tools.cmake: message(STATUS "PYPY ${PYPY_VERSION} (Py ${PYTHON_VERSION})")
1 tools/pybind11Tools.cmake:# Python debug libraries expose slightly different objects before 3.8
1 tools/pybind11Tools.cmake: set(PYPY_VERSION
```
* Change `[tool.ruff]` `target-version` to `"py38"`, as suggested by @Skylion007
2024-07-30 16:18:35 +00:00
|
|
|
container: i386/debian:bullseye
|
2020-07-26 18:15:20 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v1 # v1 is required to run inside docker
|
2020-07-26 18:15:20 +00:00
|
|
|
|
|
|
|
- name: Install requirements
|
|
|
|
run: |
|
|
|
|
apt-get update
|
2020-08-16 20:02:12 +00:00
|
|
|
apt-get install -y git make cmake g++ libeigen3-dev python3-dev python3-pip
|
2022-02-12 00:06:16 +00:00
|
|
|
pip3 install "pytest==6.*"
|
2020-07-26 18:15:20 +00:00
|
|
|
|
|
|
|
- name: Configure for install
|
2020-08-01 02:45:19 +00:00
|
|
|
run: >
|
|
|
|
cmake .
|
|
|
|
-DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0
|
|
|
|
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
|
2020-07-26 18:15:20 +00:00
|
|
|
|
|
|
|
- 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
|
2020-08-01 02:45:19 +00:00
|
|
|
run: >
|
|
|
|
cmake ../pybind11-tests
|
|
|
|
-DDOWNLOAD_CATCH=ON
|
|
|
|
-DPYBIND11_WERROR=ON
|
|
|
|
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
|
2020-07-26 18:15:20 +00:00
|
|
|
working-directory: /build-tests
|
|
|
|
|
2021-08-07 18:51:28 +00:00
|
|
|
- name: Python tests
|
2020-07-26 18:15:20 +00:00
|
|
|
run: make pytest -j 2
|
|
|
|
working-directory: /build-tests
|
2020-07-26 18:37:39 +00:00
|
|
|
|
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
# This verifies that the documentation is not horribly broken, and does a
|
2022-03-17 19:51:16 +00:00
|
|
|
# basic validation check on the SDist.
|
2020-07-26 18:37:39 +00:00
|
|
|
doxygen:
|
2020-07-26 22:17:11 +00:00
|
|
|
name: "Documentation build test"
|
2020-07-26 18:37:39 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-07-26 18:37:39 +00:00
|
|
|
|
2023-12-07 05:09:08 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2022-07-04 14:24:55 +00:00
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
2020-07-26 18:37:39 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
- name: Install Doxygen
|
2020-09-18 01:18:15 +00:00
|
|
|
run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04
|
2020-07-26 18:37:39 +00:00
|
|
|
|
|
|
|
- name: Build docs
|
2021-11-10 17:13:10 +00:00
|
|
|
run: pipx run nox -s docs
|
2020-07-26 18:37:39 +00:00
|
|
|
|
|
|
|
- name: Make SDist
|
2021-11-10 17:13:10 +00:00
|
|
|
run: pipx run nox -s build -- --sdist
|
2020-07-26 18:37:39 +00:00
|
|
|
|
2020-09-16 21:13:41 +00:00
|
|
|
- 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}'"
|
|
|
|
|
2020-07-26 18:37:39 +00:00
|
|
|
- name: Compare Dists (headers only)
|
2020-09-16 21:13:41 +00:00
|
|
|
working-directory: include
|
2020-07-26 18:37:39 +00:00
|
|
|
run: |
|
2021-11-10 17:13:10 +00:00
|
|
|
python3 -m pip install --user -U ../dist/*.tar.gz
|
2020-09-16 21:13:41 +00:00
|
|
|
installed=$(python3 -c "import pybind11; print(pybind11.get_include() + '/pybind11')")
|
|
|
|
diff -rq $installed ./pybind11
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
win32:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python:
|
2024-06-21 14:41:17 +00:00
|
|
|
- '3.8'
|
|
|
|
- '3.9'
|
|
|
|
- '3.10'
|
|
|
|
- '3.11'
|
|
|
|
- '3.12'
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
include:
|
2024-06-21 14:41:17 +00:00
|
|
|
- python: '3.12'
|
|
|
|
args: -DCMAKE_CXX_STANDARD=20
|
|
|
|
- python: '3.11'
|
|
|
|
args: -DCMAKE_CXX_STANDARD=20
|
|
|
|
- python: '3.10'
|
|
|
|
args: -DCMAKE_CXX_STANDARD=20
|
|
|
|
- python: '3.9'
|
2022-02-16 15:07:53 +00:00
|
|
|
args: -DCMAKE_CXX_STANDARD=20
|
2024-06-21 14:41:17 +00:00
|
|
|
- python: '3.8'
|
2020-10-15 18:58:34 +00:00
|
|
|
args: -DCMAKE_CXX_STANDARD=17
|
2022-09-21 15:20:07 +00:00
|
|
|
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
name: "🐍 ${{ matrix.python }} • MSVC 2019 • x86 ${{ matrix.args }}"
|
2022-02-23 22:56:41 +00:00
|
|
|
runs-on: windows-2019
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
- name: Setup Python ${{ matrix.python }}
|
2023-12-07 05:09:08 +00:00
|
|
|
uses: actions/setup-python@v5
|
2020-10-15 18:58:34 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
architecture: x86
|
|
|
|
|
|
|
|
- name: Update CMake
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2.0
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
- name: Prepare MSVC
|
2024-01-02 02:51:02 +00:00
|
|
|
uses: ilammy/msvc-dev-cmd@v1.13.0
|
2020-10-15 18:58:34 +00:00
|
|
|
with:
|
|
|
|
arch: x86
|
|
|
|
|
|
|
|
- name: Prepare env
|
2021-10-26 18:50:34 +00:00
|
|
|
run: |
|
|
|
|
python -m pip install -r tests/requirements.txt
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
# First build - C++11 mode and inplace
|
|
|
|
- name: Configure ${{ matrix.args }}
|
|
|
|
run: >
|
|
|
|
cmake -S . -B build
|
|
|
|
-G "Visual Studio 16 2019" -A Win32
|
|
|
|
-DPYBIND11_WERROR=ON
|
2021-07-11 07:40:38 +00:00
|
|
|
-DDOWNLOAD_CATCH=ON
|
2020-10-15 18:58:34 +00:00
|
|
|
-DDOWNLOAD_EIGEN=ON
|
|
|
|
${{ matrix.args }}
|
|
|
|
- name: Build C++11
|
|
|
|
run: cmake --build build -j 2
|
|
|
|
|
2021-08-07 18:51:28 +00:00
|
|
|
- name: Python tests
|
2020-10-15 18:58:34 +00:00
|
|
|
run: cmake --build build -t pytest
|
|
|
|
|
2022-03-10 18:31:16 +00:00
|
|
|
win32-debug:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python:
|
|
|
|
- 3.8
|
|
|
|
- 3.9
|
|
|
|
|
|
|
|
include:
|
|
|
|
- python: 3.9
|
|
|
|
args: -DCMAKE_CXX_STANDARD=20
|
|
|
|
- python: 3.8
|
|
|
|
args: -DCMAKE_CXX_STANDARD=17
|
|
|
|
|
|
|
|
name: "🐍 ${{ matrix.python }} • MSVC 2019 (Debug) • x86 ${{ matrix.args }}"
|
|
|
|
runs-on: windows-2019
|
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-03-10 18:31:16 +00:00
|
|
|
|
|
|
|
- name: Setup Python ${{ matrix.python }}
|
2023-12-07 05:09:08 +00:00
|
|
|
uses: actions/setup-python@v5
|
2022-03-10 18:31:16 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
architecture: x86
|
|
|
|
|
|
|
|
- name: Update CMake
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2.0
|
2022-03-10 18:31:16 +00:00
|
|
|
|
|
|
|
- name: Prepare MSVC
|
2024-01-02 02:51:02 +00:00
|
|
|
uses: ilammy/msvc-dev-cmd@v1.13.0
|
2022-03-10 18:31:16 +00:00
|
|
|
with:
|
|
|
|
arch: x86
|
|
|
|
|
|
|
|
- name: Prepare env
|
|
|
|
run: |
|
|
|
|
python -m pip install -r tests/requirements.txt
|
|
|
|
|
|
|
|
# First build - C++11 mode and inplace
|
|
|
|
- name: Configure ${{ matrix.args }}
|
|
|
|
run: >
|
|
|
|
cmake -S . -B build
|
|
|
|
-G "Visual Studio 16 2019" -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
|
|
|
|
|
2020-10-15 18:58:34 +00:00
|
|
|
|
2022-02-14 17:29:06 +00:00
|
|
|
windows-2022:
|
2020-10-15 18:58:34 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python:
|
2022-02-14 17:29:06 +00:00
|
|
|
- 3.9
|
2020-10-15 18:58:34 +00:00
|
|
|
|
2022-02-14 17:29:06 +00:00
|
|
|
name: "🐍 ${{ matrix.python }} • MSVC 2022 C++20 • x64"
|
|
|
|
runs-on: windows-2022
|
2020-10-15 18:58:34 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-10-15 18:58:34 +00:00
|
|
|
|
2022-02-14 17:29:06 +00:00
|
|
|
- name: Setup Python ${{ matrix.python }}
|
2023-12-07 05:09:08 +00:00
|
|
|
uses: actions/setup-python@v5
|
2020-10-15 18:58:34 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
|
|
|
- name: Prepare env
|
2024-03-26 22:20:11 +00:00
|
|
|
# Ensure use of NumPy 2 (via NumPy nightlies but can be changed soon)
|
2021-10-26 18:50:34 +00:00
|
|
|
run: |
|
2022-02-14 17:29:06 +00:00
|
|
|
python3 -m pip install -r tests/requirements.txt
|
2024-03-26 22:20:11 +00:00
|
|
|
python3 -m pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1'
|
2020-10-15 18:58:34 +00:00
|
|
|
|
2022-02-14 17:29:06 +00:00
|
|
|
- name: Update CMake
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2.0
|
2022-02-14 17:29:06 +00:00
|
|
|
|
|
|
|
- name: Configure C++20
|
2020-10-15 18:58:34 +00:00
|
|
|
run: >
|
|
|
|
cmake -S . -B build
|
|
|
|
-DPYBIND11_WERROR=ON
|
2021-07-11 07:40:38 +00:00
|
|
|
-DDOWNLOAD_CATCH=ON
|
2022-02-16 15:07:53 +00:00
|
|
|
-DDOWNLOAD_EIGEN=ON
|
2022-02-14 17:29:06 +00:00
|
|
|
-DCMAKE_CXX_STANDARD=20
|
2020-10-15 18:58:34 +00:00
|
|
|
|
2022-02-14 17:29:06 +00:00
|
|
|
- name: Build C++20
|
2020-10-15 18:58:34 +00:00
|
|
|
run: cmake --build build -j 2
|
|
|
|
|
2022-02-14 17:29:06 +00:00
|
|
|
- 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
|
2021-07-30 17:48:41 +00:00
|
|
|
|
2023-04-25 17:25:57 +00:00
|
|
|
- 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
|
|
|
|
|
2021-07-30 17:48:41 +00:00
|
|
|
mingw:
|
2021-08-19 18:42:55 +00:00
|
|
|
name: "🐍 3 • windows-latest • ${{ matrix.sys }}"
|
2021-07-30 17:48:41 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: msys2 {0}
|
2021-08-19 18:42:55 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- { sys: mingw64, env: x86_64 }
|
|
|
|
- { sys: mingw32, env: i686 }
|
2021-07-30 17:48:41 +00:00
|
|
|
steps:
|
2022-01-26 16:18:08 +00:00
|
|
|
- uses: msys2/setup-msys2@v2
|
2021-07-30 17:48:41 +00:00
|
|
|
with:
|
2021-08-19 18:42:55 +00:00
|
|
|
msystem: ${{matrix.sys}}
|
2021-07-30 17:48:41 +00:00
|
|
|
install: >-
|
2021-08-19 18:42:55 +00:00
|
|
|
git
|
|
|
|
mingw-w64-${{matrix.env}}-gcc
|
|
|
|
mingw-w64-${{matrix.env}}-python-pip
|
|
|
|
mingw-w64-${{matrix.env}}-python-numpy
|
|
|
|
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
|
2021-07-30 17:48:41 +00:00
|
|
|
|
2024-01-17 05:09:20 +00:00
|
|
|
- uses: msys2/setup-msys2@v2
|
|
|
|
if: matrix.sys == 'mingw64'
|
|
|
|
with:
|
|
|
|
msystem: ${{matrix.sys}}
|
|
|
|
install: >-
|
|
|
|
git
|
|
|
|
mingw-w64-${{matrix.env}}-python-scipy
|
2024-05-10 20:34:41 +00:00
|
|
|
mingw-w64-${{matrix.env}}-eigen3
|
2024-01-17 05:09:20 +00:00
|
|
|
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-07-30 17:48:41 +00:00
|
|
|
|
2021-08-19 18:42:55 +00:00
|
|
|
- name: Configure C++11
|
2021-07-30 17:48:41 +00:00
|
|
|
# LTO leads to many undefined reference like
|
|
|
|
# `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&)
|
2023-12-14 19:36:45 +00:00
|
|
|
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
|
2021-07-30 17:48:41 +00:00
|
|
|
|
2021-08-19 18:42:55 +00:00
|
|
|
- name: Build C++11
|
2021-07-30 17:48:41 +00:00
|
|
|
run: cmake --build build -j 2
|
|
|
|
|
2021-08-19 18:42:55 +00:00
|
|
|
- name: Python tests C++11
|
|
|
|
run: cmake --build build --target pytest -j 2
|
|
|
|
|
|
|
|
- name: C++11 tests
|
2022-01-26 16:18:08 +00:00
|
|
|
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 2
|
2021-08-19 18:42:55 +00:00
|
|
|
|
|
|
|
- name: Interface test C++11
|
2022-01-26 16:18:08 +00:00
|
|
|
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cmake_build
|
2021-08-19 18:42:55 +00:00
|
|
|
|
|
|
|
- name: Clean directory
|
|
|
|
run: git clean -fdx
|
|
|
|
|
|
|
|
- name: Configure C++14
|
2023-12-14 19:36:45 +00:00
|
|
|
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
|
2021-08-19 18:42:55 +00:00
|
|
|
|
|
|
|
- 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
|
2022-01-26 16:18:08 +00:00
|
|
|
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target cpptest -j 2
|
2021-08-19 18:42:55 +00:00
|
|
|
|
|
|
|
- name: Interface test C++14
|
2022-01-26 16:18:08 +00:00
|
|
|
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cmake_build
|
2021-08-19 18:42:55 +00:00
|
|
|
|
|
|
|
- name: Clean directory
|
|
|
|
run: git clean -fdx
|
|
|
|
|
|
|
|
- name: Configure C++17
|
2023-12-14 19:36:45 +00:00
|
|
|
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
|
2021-08-19 18:42:55 +00:00
|
|
|
|
|
|
|
- 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
|
2022-01-26 16:18:08 +00:00
|
|
|
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target cpptest -j 2
|
2021-08-19 18:42:55 +00:00
|
|
|
|
|
|
|
- name: Interface test C++17
|
2022-01-26 16:18:08 +00:00
|
|
|
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cmake_build
|
2022-11-10 16:33:26 +00:00
|
|
|
|
|
|
|
windows_clang:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest]
|
|
|
|
python: ['3.10']
|
|
|
|
|
|
|
|
runs-on: "${{ matrix.os }}"
|
|
|
|
|
|
|
|
name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Show env
|
|
|
|
run: env
|
|
|
|
|
|
|
|
- name: Checkout
|
2023-09-06 19:57:18 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-11-10 16:33:26 +00:00
|
|
|
|
|
|
|
- name: Set up Clang
|
|
|
|
uses: egor-tensin/setup-clang@v1
|
|
|
|
|
|
|
|
- name: Setup Python ${{ matrix.python }}
|
2023-12-07 05:09:08 +00:00
|
|
|
uses: actions/setup-python@v5
|
2022-11-10 16:33:26 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
|
|
|
- name: Update CMake
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2.0
|
2022-11-10 16:33:26 +00:00
|
|
|
|
|
|
|
- name: Install ninja-build tool
|
2024-06-17 03:59:19 +00:00
|
|
|
uses: seanmiddleditch/gha-setup-ninja@v5
|
2022-11-10 16:33:26 +00:00
|
|
|
|
|
|
|
- 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: Clean directory
|
|
|
|
run: git clean -fdx
|
2022-11-12 20:24:19 +00:00
|
|
|
|
|
|
|
macos_brew_install_llvm:
|
2024-05-06 16:11:41 +00:00
|
|
|
name: "macos-13 • brew install llvm"
|
|
|
|
runs-on: macos-13
|
2022-11-12 20:24:19 +00:00
|
|
|
|
|
|
|
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
|
2023-09-06 19:57:18 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-11-12 20:24:19 +00:00
|
|
|
|
|
|
|
- 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
|
2024-02-14 01:50:51 +00:00
|
|
|
uses: jwlawson/actions-setup-cmake@v2.0
|
2022-11-12 20:24:19 +00:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2023-04-25 17:25:57 +00:00
|
|
|
- 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
|
|
|
|
|
2022-11-12 20:24:19 +00:00
|
|
|
- name: Clean directory
|
|
|
|
run: git clean -fdx
|