Commit Graph

114 Commits

Author SHA1 Message Date
Ralf W. Grosse-Kunstleve
44156477a3
Adding MSVC 2022 C++20 GitHub Action (#3732)
* Trying another way of adding windows-2022 C++20

* ci: try merging 2019 & 2022

* Revert "ci: try merging 2019 & 2022"

This reverts commit b158a1b79f.

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-02-14 09:29:06 -08:00
Henry Schreiner
522c59ceb2
chore: drop Python 3.5 (#3719)
* chore: drop Python 3.5 support

* chore: more fstrings with flynt's help

* ci: drop Python 3.5

* chore: bump dependency versions

* docs: touch up py::args

* tests: remove deprecation warning

* Ban smartquotes

* Very minor tweaks (by-product of reviewing PR #3719).

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2022-02-11 19:06:16 -05:00
Ralf W. Grosse-Kunstleve
6493f496e3
Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688)
* `#error BYE_BYE_GOLDEN_SNAKE`

* Removing everything related to 2.7 from ci.yml

* Commenting-out Centos7

* Removing `PYTHON: 27` from .appveyor.yml

* "PY2" removal, mainly from tests. C++ code is not touched.

* Systematic removal of `u` prefix from `u"..."` and `u'...'` literals. Collateral cleanup of a couple minor other things.

* Cleaning up around case-insensitive hits for `[^a-z]py.*2` in tests/.

* Removing obsolete Python 2 mention in compiling.rst

* Proper `#error` for Python 2.

* Using PY_VERSION_HEX to guard `#error "PYTHON 2 IS NO LONGER SUPPORTED.`

* chore: bump pre-commit

* style: run pre-commit for pyupgrade 3+

* tests: use sys.version_info, not PY

* chore: more Python 2 removal

* Uncommenting Centos7 block (PR #3691 showed that it is working again).

* Update pre-commit hooks

* Fix pre-commit hook

* refactor: remove Python 2 from CMake

* refactor: remove Python 2 from setup code

* refactor: simplify, better static typing

* feat: fail with nice messages

* refactor: drop Python 2 C++ code

* docs: cleanup for Python 3

* revert: intree

revert: intree

* docs: minor touchup to py2 statement

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
2022-02-10 18:28:08 -08:00
Michał Górny
96b943be1d
tests: update catch to 2.13.5 to fix glibc 2.34 failures (#3679)
* Download catch for MinGw

* Fix rest of MinGW

* fix: update catch to 2.13.5 to fix glibc 2.34 failures

Update the downloaded Catch version to 2.13.5, in order to fix build
failure on glibc 2.34:

```
In file included from /usr/include/signal.h:328,
                 from /tmp/pybind11/.nox/tests-3-9/tmp/tests/catch/catch.hpp:8030,
                 from /tmp/pybind11/tests/test_embed/catch.cpp:13:
/tmp/pybind11/.nox/tests-3-9/tmp/tests/catch/catch.hpp:10818:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10818 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /usr/include/python3.9/Python.h:36,
                 from /tmp/pybind11/include/pybind11/detail/common.h:215,
                 from /tmp/pybind11/include/pybind11/pytypes.h:12,
                 from /tmp/pybind11/include/pybind11/cast.h:13,
                 from /tmp/pybind11/include/pybind11/attr.h:13,
                 from /tmp/pybind11/include/pybind11/pybind11.h:13,
                 from /tmp/pybind11/include/pybind11/embed.h:12,
                 from /tmp/pybind11/tests/test_embed/catch.cpp:4:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from /tmp/pybind11/tests/test_embed/catch.cpp:13:
/tmp/pybind11/.nox/tests-3-9/tmp/tests/catch/catch.hpp:10877:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10877 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~
```

The newest Catch version cannot be used yet because of regression:
https://github.com/catchorg/Catch2/pull/2364

* fix: add option for _ check, only define on pybind11

* Revert "fix: add option for _ check, only define on pybind11"

This reverts commit 86817db488.

* fix: only undef _ for catch cpp creation.

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-02-05 23:53:02 -05:00
Henry Schreiner
21e10945a0
ci: move centos 8 to stream (#3675) 2022-02-02 11:25:28 -05:00
Liam Keegan
bcb6d63ce9
fix msys ci python issue (#3651)
* msys ci: un-pin setup-msys2 action version

* msys ci: explicitly set PYTHONHOME and PYTHONPATH for c++ and interface tests (to workaround https://github.com/msys2/setup-msys2/issues/167)
2022-01-26 08:18:08 -08:00
dependabot[bot]
3a1eddab54
chore(deps): bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#3625)
Bumps [jwlawson/actions-setup-cmake](https://github.com/jwlawson/actions-setup-cmake) from 1.11 to 1.12.
- [Release notes](https://github.com/jwlawson/actions-setup-cmake/releases)
- [Commits](https://github.com/jwlawson/actions-setup-cmake/compare/v1.11...v1.12)

---
updated-dependencies:
- dependency-name: jwlawson/actions-setup-cmake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-16 21:47:58 -05:00
Ralf W. Grosse-Kunstleve
f588810871
Replacing ICC C++14 with C++17 (#3570)
* Replacing ICC C++14 with C++17

* ICPC: -diag-disable:conversion

Try to suppress the `-Werror-all` promotion in `#include <variant>`

* Trying `-DPYBIND11_WERROR=OFF`

* Trying `-Wno-conversion` (todo: make specific to C++17 if it works)

* Inserting -Wno-conversion only for C++17

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2022-01-11 12:13:02 -08:00
dependabot[bot]
fb9a222daa
chore(deps): bump pypa/gh-action-pypi-publish from 1.4.2 to 1.5.0 (#3606)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.4.2 to 1.5.0.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.4.2...v1.5.0)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 10:29:30 -05:00
Henry Schreiner
39fbc7992b
fix: avoiding usage of _ if already defined (#3423)
* fix: avoid usage of _

* ci: test _ defined

* docs: include change in docs

* fix: add a test and comment

* refactor: const_str -> const_name
2021-12-21 14:24:21 -05:00
Ralf W. Grosse-Kunstleve
b3d9c3543d
vi: replacing currently broken ICC Latest C++17 with C++14. (#3551)
* Trivial change.

* Trying ICC Latest C++14 instead of C++17.

* Trying ICC Latest C++20 instead of C++17.

* Settling on ICC Latest C++14 for now.

* Undoing trivial change.

* ci: try using SETUPTOOLS_USE_DISTUTILS=stdlib

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2021-12-21 14:23:49 -05:00
Boris Rasin
a224d0cca5
fix: vs2022 compilation, issue #3477 (#3497)
* fix: vs2022 compilation, issue #3477

* silence warning for python 2.7

* disable warning around mbstowcs call

* move disable warning code closer to call site

* turn on vs2022 ci test

* ci: don't run helpers on Windows 2022 & Python 3.5

* limit workaround for stdlib shipped with vs2022 or later

* fix for: limit workaround for stdlib shipped with vs2022 or later

* fix 2 for: limit workaround for stdlib shipped with vs2022 or later

* comment

* ci: add a Windows 2019 run

* ci: add Python 2.7 check too

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2021-12-03 11:10:36 -08:00
Henry Schreiner
72282f75a1
ci: support development releases of Python (#3419)
* ci: support development releases of Python

* fix: better PyPy support

* fix: patch over a few more pypy issues

* Try to patch

* Properly follow pep667

* Fix typo

* Whoops, 667 not in yet

* For testing

* More testing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to backport

* Try to simplify fix

* Nail down the fix

* Try pypy workaround

* Typo

* one last typo

* Replacing 0x03110000 with 0x030B0000

* Add TODO. Drop PyPy

* Fix typo

* Revert catch upgrade

* fix: minor cleanup, try pypy again

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2021-11-17 09:44:19 -05:00
Henry Schreiner
aebd21b53c
docs: rework CI a bit, more modern skipping (#3424)
* docs: rework CI a bit, more modern skipping

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-10 12:13:10 -05:00
Henry Schreiner
e7e2c79f3f
fix: improve support for Python 3.11-dev (#3368)
* ci: support Python 3.11-dev

Also update 3.10 to final, better PyPy usage

* fix: use PyFrame_GetCode on Python 3.9+

* ci: some bitiness of pypy not supported on win

* chore: update CMake support to 3.22rc1 to quiet warning

* fix: use dev version of py to fix Py 3.11

* tests: print proper Eigen version

* ci: include pypy2, not sure why

* ci: avoid running on Python 3.11 for now

* ci: fix runs

* ci: simpler PyPy usage, drop unmaintained scipy + pypy index

* ci: only binary numpy, wait on pypy 3.8

* refactor: address review
2021-10-26 14:50:34 -04:00
Henry Schreiner
9379b399d9
fix: MSVC 2017 C++17 on Python 3 regression (#3407)
* fix: MSVC 2017 C++17 on Python 3 regression

* ci: add 3.7 job on CI
2021-10-25 16:01:19 -04:00
Henry Schreiner
931f66440f
ci: cancel in-progress on repeated pushes (#3370) 2021-10-17 21:40:10 -04:00
Jerome Robert
56b49c2be2
ci: fix mingw checks by pinning (#3375)
* Workaround for https://github.com/msys2/setup-msys2/issues/167
* Adapted from 05036cb24d
2021-10-17 21:38:41 -04:00
dependabot[bot]
ed09664f06
chore(deps): bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#3338)
Bumps [ilammy/msvc-dev-cmd](https://github.com/ilammy/msvc-dev-cmd) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/ilammy/msvc-dev-cmd/releases)
- [Commits](https://github.com/ilammy/msvc-dev-cmd/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: ilammy/msvc-dev-cmd
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 08:27:52 -04:00
Henry Schreiner
3747dc2c4f
Revert "All -DDOWNLOAD_EIGEN=OFF (to work around gitlab eigen outage)." (#3326)
This reverts commit 9f146a5622.
2021-10-04 16:38:15 -04:00
Henry Schreiner
20aae3e61a ci: disable Eigen due to Cert issue on CentOS 2021-10-04 15:20:10 -04:00
Ralf W. Grosse-Kunstleve
9f146a5622 All -DDOWNLOAD_EIGEN=OFF (to work around gitlab eigen outage). 2021-10-04 10:06:12 -07:00
dependabot[bot]
1dc9a23cae
chore(deps): bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#3294)
Bumps [jwlawson/actions-setup-cmake](https://github.com/jwlawson/actions-setup-cmake) from 1.10 to 1.11.
- [Release notes](https://github.com/jwlawson/actions-setup-cmake/releases)
- [Commits](https://github.com/jwlawson/actions-setup-cmake/compare/v1.10...v1.11)

---
updated-dependencies:
- dependency-name: jwlawson/actions-setup-cmake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-22 22:38:04 -04:00
Jeremy Maitin-Shepard
14976c853b
Eliminate duplicate TLS keys for loader_life_support stack (#3275)
* Eliminate duplicate TLS keys for loader_life_support stack

This revises the existing fix for
https://github.com/pybind/pybind11/issues/2765 in
https://github.com/pybind/pybind11/pull/3237 to reduce the amount of
TLS storage used.

The shared TLS key is stored in two different ways, depending on
`PYBIND11_INTERNALS_VERSION`.  If `PYBIND11_INTERNALS_VERSION ==
4` (as is currently set), the TLS key is stored in the
`internal::shared_data` map to avoid breaking ABI compatibility.  If
`PYBIND11_INTERNALS_VERSION > 4`, the TLS key is stored directly in
the `internals` struct.

* Fix test_pytypes.py::test_issue2361 failure on PyPy3.7

* Add github actions tests for unstable ABI
2021-09-20 04:57:38 -07:00
Liam Keegan
4f29b8a45b
ci: extend msys2 mingw CI (#3207)
* extend msys2 CI

- add 32-bit job
- add c++11/17 c++/interface tests copied from standard ci
- add numpy/scipy

* account for padding of PartialStruct in numpy dtypes test with mingw32

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* msys2 ci: add c++14 tests

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-08-19 14:42:55 -04:00
dependabot[bot]
d6841f60cc
chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196)
Bumps [jwlawson/actions-setup-cmake](https://github.com/jwlawson/actions-setup-cmake) from 1.9 to 1.10.
- [Release notes](https://github.com/jwlawson/actions-setup-cmake/releases)
- [Commits](https://github.com/jwlawson/actions-setup-cmake/compare/v1.9...v1.10)

---
updated-dependencies:
- dependency-name: jwlawson/actions-setup-cmake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 12:27:54 -04:00
Ralf W. Grosse-Kunstleve
7d3b05715b
Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193)
* Rollback of PR #3030 (Working around Centos 8 failure).

* Adding `-DCMAKE_BUILD_TYPE=Release`

* Improving existing workaround (undoing the originally intended rollback).

* Fixing minor documentation bug.
2021-08-12 13:21:49 -07:00
Ralf W. Grosse-Kunstleve
61ee923bb1
Consistent step name "Python tests". (#3180) 2021-08-07 11:51:28 -07:00
Jerome Robert
9e8a741baa
fix: Mingw64 corrected and add a CI job to test it (#3132)
* mingw64 platform string is like mingw_xxx not "mingw"

See https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-python/0099-Change-the-get_platform-method-in-sysconfig-and-dist.patch

* Mingw: Do not dllexport exceptions

This is a fix for errors like:

D:/a/pybind11/pybind11/include/pybind11/detail/common.h:735:23: error: 'dllexport' implies default visibility, but 'class pybind11::builtin_exception' has already been declared with a different visibility
  735 | class PYBIND11_EXPORT builtin_exception : public std::runtime_error {
      |                       ^~~~~~~~~~~~~~~~~

* GHA: Test Mingw64 build

* fix: avoid thin binaries on mingw

* fix: drop lto on MinGW

* Mingw64: disable PYBIND11_DEPRECATED

It trigger many warnings for unknown reasons

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-07-30 13:48:41 -04:00
Henry Schreiner
c14b193308
chore: increase CMake upper limit (#3124) 2021-07-28 18:04:14 -07:00
Ralf W. Grosse-Kunstleve
0f4761b44a
Rollback of DOWNLOAD_CATCH=OFF change merged via PR #3059. (#3092) 2021-07-11 00:40:38 -07:00
luzpaz
8bee61b645
docs: fix various typos (#3075)
Found via `codespell -q 3 -L nd,ot,thist`
2021-07-04 19:58:35 -04:00
Cris Luengo
93e69191c1
fix: enable py::implicitly_convertible<py::none, ...> for py::class_-wrapped types (#3059)
* Allow casting from None to a custom object, closes #2778

* ci.yml patch from the smart_holder branch for full CI coverage.
2021-06-25 17:56:17 -07:00
Ralf W. Grosse-Kunstleve
484b0f0433
Updating and slightly enhancing instructions for running clang-tidy. (#3055)
* Updating and slightly enhancing instructions for running clang-tidy.

* Making documented commands identical to workflow commands. Adding comment in workflow file pointing to documentation.
2021-06-22 15:12:58 -07:00
Aaron Gokaslan
dac74ebdf5
fix(clang-tidy): performance fixes applied in tests and CI (#3051)
* Initial fixes

* Whoops

* Finish clang-tidy manual fixes

* Add two missing fixes

* Revert

* Update clang-tidy

* Try to fix unreachable code error

* Move nolint comment

* Apply missing fix

* Don't override clang-tidy config

* Does this fix clang-tidy?

* Make all clang-tidy errors visible

* Add comments about NOLINTs and remove a few

* Fix typo
2021-06-22 12:11:54 -04:00
dependabot[bot]
9b3b357706
chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) 2021-06-19 18:39:54 -04:00
Ralf W. Grosse-Kunstleve
19d99a87fe
Working around Centos 8 failure. (#3030)
* Experiment using -DCMAKE_BUILD_TYPE=Debug for Centos 8.

* Moving comment because the current placement seems to mess up the cmake command.

* Using `echo > VAR_XXX` and `$(cat VAR_XXX)` trick to emulate using variables (https://github.com/actions/starter-workflows/issues/68#issuecomment-524937002).
2021-06-18 01:35:36 -07:00
dependabot[bot]
14023c9cda
chore(deps): bump ilammy/msvc-dev-cmd from 1.8.0 to 1.8.1 (#3021) 2021-05-27 06:10:28 +00:00
dependabot[bot]
f61855b9d8
chore(deps): bump ilammy/msvc-dev-cmd from 1 to 1.8.0 (#3001) 2021-05-13 23:21:13 -04:00
dependabot[bot]
bc7cf6ef17
chore(deps): bump jwlawson/actions-setup-cmake from 1.8 to 1.9 (#3000) 2021-05-13 23:19:51 -04:00
Henry Schreiner
54430436fe
ci: install Boost for boost checks (#2968) 2021-04-22 00:03:07 -04:00
dependabot[bot]
bca4b36ba7
chore(deps): bump pre-commit/action from v2.0.2 to v2.0.3 (#2964)
Bumps [pre-commit/action](https://github.com/pre-commit/action) from v2.0.2 to v2.0.3.
- [Release notes](https://github.com/pre-commit/action/releases)
- [Commits](https://github.com/pre-commit/action/compare/v2.0.2...9b88afc9cd57fd75b655d5c71bd38146d07135fe)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 15:00:00 -04:00
dependabot[bot]
16c23fef31
chore(deps): bump pre-commit/action from v2.0.0 to v2.0.2 (#2935) 2021-04-05 22:53:59 -04:00
dependabot[bot]
59f8d7f1bf
chore(deps): bump jwlawson/actions-setup-cmake from v1.7 to v1.8 (#2865) 2021-02-17 18:48:37 +00:00
dependabot[bot]
c236239356
chore(deps): bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2 (#2851)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from v1.4.1 to v1.4.2.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.4.1...27b31702a0e7fc50959f5ad993c78deac1bdfc29)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-09 17:00:16 -05:00
Kumar Aditya
948d09d6df
test: Test against Python 3.10 (#2848) 2021-02-08 15:35:30 -05:00
dependabot[bot]
42e7380705
chore(deps): bump jwlawson/actions-setup-cmake from v1.6 to v1.7 (#2818)
Bumps [jwlawson/actions-setup-cmake](https://github.com/jwlawson/actions-setup-cmake) from v1.6 to v1.7.
- [Release notes](https://github.com/jwlawson/actions-setup-cmake/releases)
- [Commits](https://github.com/jwlawson/actions-setup-cmake/compare/v1.6...821902fd0e0da89b13fd3161d358e96bf7550883)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-25 15:11:18 -05:00
Henry Schreiner
87f5aff4a7
ci: update to setup-cmake v1.6 (#2805) 2021-01-19 18:24:46 -05:00
Michael Kuron
48534089f7
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-17 19:53:07 -05:00
Axel Huebl
0b3df7f964
ci: Intel icc/icpc via oneAPI (#2573)
* 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

* style: clang tidy fix

* style: fix missing NOLINT

* ICC: Update Compiler Name

Changed upstream with the last oneAPI release.

* ICC CI: Downgrade pytest

pytest 6 does not capture the `discard_as_unraisable` stderr and
just writes a warning with its content instead.

* Use new test pinning requirements.txt

* tests: add notes about intel, cleanup

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-15 15:59:47 -05:00