Commit Graph

3422 Commits

Author SHA1 Message Date
Ralf W. Grosse-Kunstleve
aa4fe8e4ff Merge branch 'master' into sh_merge_master 2022-01-26 19:08:58 -08:00
Dustin Spicuzza
fd8265e28d
Fix smart_holder multiple inheritance tests (#3635)
The original pybind11 holder supported multiple inheritance by recursively creating
type casters until it finds one for the source type, then converting each
value in turn to the next type via typeinfo->implicit_cast

The smart_holder only stored the last implicit_cast, which was incorrect.

This commit changes it to create a list of implicit_cast functions that are
appended to during the recursive type caster creation, and when the time comes
to cast to the destination type, it calls all of them in the correct order.
2022-01-26 19:02:49 -08:00
Dustin Spicuzza
ec81e8e778
Propagate py::multiple_inheritance to all children (#3650)
* Add tests demonstrating smart_holder issues with multiple inheritance

* Propagate C++ multiple inheritance markers to all children

- Makes py::multiple_inheritance only needed in base classes hidden from pybind11
2022-01-26 17:03:52 -08:00
Ralf W. Grosse-Kunstleve
b2f0b091c9 Tracking ci.yml changes from master. 2022-01-26 09:59:04 -08:00
Ralf W. Grosse-Kunstleve
ece3c55e88 Merge branch 'master' into smart_holder 2022-01-26 09:58:21 -08: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
yangliz5
dedda228f4
Fix a typo in class.rst (#3648)
Fix a typo in class.rst
2022-01-25 22:32:33 -08:00
Ralf W. Grosse-Kunstleve
f84d291e3f Tracking ci.yml changes from master. 2022-01-25 16:48:54 -08:00
Ralf W. Grosse-Kunstleve
7b1dbb8352 Merge branch 'master' into smart_holder 2022-01-25 16:47:53 -08:00
Xiaofei Wang
93a376a40a
[smart_holder] Add missing test case to CMakeLists.txt (#3645)
* Add missing test case to CMakeLists.txt

* Fix warnings

* Fix Clangtidy
2022-01-25 16:43:11 -08:00
Xiaofei Wang
da058a2904
[Smart holder] Support void pointer capsules (#3633)
* Make smart holder type casters support void pointer capsules.

* Fix warnings

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

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

* Fix checks

* Fix check failures under CentOS

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

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

* Remove unused regex module

* Resolve comments

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

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

* Resolve comments

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

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

* Fix clangtidy

* Resolve comments

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-25 13:29:54 -08:00
Nimrod
9ec1128c7a
Fix typo in doc (#3628) 2022-01-18 23:22:42 -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
152bb100f2 Merge branch 'master' into sh_merge_master 2022-01-16 07:07:12 -08:00
Sergei Izmailov
5194855900
Render py::bool_ and py::float_ without _ in docstrings (#3622)
* Render `py::bool_` as `bool` in docstrings

* Render `py::float_` as `float` in docstrings
2022-01-16 07:05:46 -08:00
Ralf W. Grosse-Kunstleve
c8d36b3c99 Merge branch 'master' into sh_merge_master 2022-01-14 23:17:11 -08:00
Ralf W. Grosse-Kunstleve
7e7c558530 Fixing obvious minor typo (missing D in -DOWNLOAD_EIGEN=ON).
Typo introduced with PR #2377.

Adopting fix from @AWhetter PR #2621 (to keep unrelated changes cleanly separated).
2022-01-14 16:16:52 -08:00
Aaron Gokaslan
d2ec836712
Add support for nested C++11 exceptions (#3608)
* Add support for nested C++11 exceptions

* Remove wrong include

* Fix if directive

* Fix missing skipif

* Simplify code and try to work around MSVC bug

* Clarify comment

* Further simplify code

* Remove the last extra throw statement

* Qualify auto

* Fix typo

* Add missing return for consistency

* Fix clang-tidy complaint

* Fix python2 stub

* Make clang-tidy happy

* Fix compile error

* Fix python2 function signature

* Extract C++20 utility and backport

* Cleanup code a bit more

* Improve test case

* Consolidate code and fix signature

* Fix typo
2022-01-14 14:22:47 -05:00
Ralf W. Grosse-Kunstleve
d6c174cff4 Tracking ci.yml changes from master. 2022-01-11 17:52:49 -08:00
Ralf W. Grosse-Kunstleve
aa209cc90f Adding back test_class_sh, test_classh additions, building on PR #3590. 2022-01-11 17:48:59 -08:00
Ralf W. Grosse-Kunstleve
ea0c1e77c8 Merge branch 'master' into sh_merge_master 2022-01-11 17:48:37 -08:00
Ralf W. Grosse-Kunstleve
ea4cc147a2 Temporarily backing out all test_class_sh, test_classh additions. 2022-01-11 17:48:05 -08:00
Aaron Gokaslan
f8d4aa47b6
Add clang-tidy readability checks for sus args (#3611) 2022-01-11 17:34:16 -08:00
Ivor Wanders
21911e126f
A way to register additional test targets and support .py only tests. (#3590)
* A way to register additional test targets.

* Support specifying tests with extension.

* Ensure TEST_OVERRIDE is backwards compatible.

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

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

* Ensure regex is non greedy.

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-11 17:31:19 -08:00
Aaron Gokaslan
d434b5f31e
(chore): Remove deprecated c-headers (#3610)
* Remove deprecated c-headers

* Update calls to old cfunctions

* Add missing one

* Add another missing one
2022-01-11 17:57:59 -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
Aaron Gokaslan
ef070f7750
Add additional info to TypeError when C++->Python casting fails (#3605)
* Add additional info to TypeInfo when C++->Python casting fails

* Fix typo

* Address reviewer comments
2022-01-10 21:18:00 -05:00
pre-commit-ci[bot]
b66328b043
[pre-commit.ci] pre-commit autoupdate (#3609)
updates:
- [github.com/pre-commit/mirrors-mypy: v0.930 → v0.931](https://github.com/pre-commit/mirrors-mypy/compare/v0.930...v0.931)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-10 21:13:24 -05: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
Ralf W. Grosse-Kunstleve
73197b392a Merge branch 'master' into smart_holder 2022-01-03 15:56:25 -08:00
pre-commit-ci[bot]
2cd32e5d54
[pre-commit.ci] pre-commit autoupdate (#3589)
updates:
- [github.com/asottile/pyupgrade: v2.29.1 → v2.31.0](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.31.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-03 15:55:21 -08:00
Dustin Spicuzza
9e43db614f
fix: names of types held by smart holder should be the actual type (#3588)
Required for pybind11-stubgen to work properly
2022-01-03 15:46:13 -08:00
Ralf W. Grosse-Kunstleve
5bbb8f996b Using new const_name instead of _ (related to PR #3423). 2021-12-29 13:28:32 -08:00
Ralf W. Grosse-Kunstleve
6e44740b5e Tracking ci.yml changes from master. 2021-12-29 13:27:29 -08:00
Ralf W. Grosse-Kunstleve
388c03b18c Merge branch 'master' into sh_merge_master_clean 2021-12-29 13:24:20 -08:00
Ralf W. Grosse-Kunstleve
1bbaeb3462
Adding dedicated test_const_name. (#3578)
* Adding dedicated test_const_name.

Also exercises pybind11::detail::_ backward compatibility.

See also: PR #3423

* Backing out tests involving int_to_str (requires C++17 or higher).

* Suppressing clang-tidy errors.

* Disabling test_const_name for MSVC 2015 due to bizarre failures.

* Stacking @pytest.mark.parametrize (thanks to @skylion007 for pointing out).
2021-12-29 12:54:25 -08:00
Henry Schreiner
9b4f71d12d
docs: remove duplication in changelog for 2.9.0 2021-12-28 12:19:17 -05:00
Henry Schreiner
9371614764 Merge branch 'master' into stable 2021-12-28 11:47:54 -05:00
Henry Schreiner
45f792efdd
chore: prepare for 2.9 2021-12-28 10:47:21 -05:00
pre-commit-ci[bot]
89769e6e6d
[pre-commit.ci] pre-commit autoupdate (#3574)
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.1.0)
- [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](https://github.com/pre-commit/mirrors-mypy/compare/v0.920...v0.930)
- [github.com/shellcheck-py/shellcheck-py: v0.8.0.2 → v0.8.0.3](https://github.com/shellcheck-py/shellcheck-py/compare/v0.8.0.2...v0.8.0.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-27 18:28:30 -05:00
Henry Schreiner
cb302305a3
fix: restore full range of _ functions (#3571) 2021-12-23 14:50:10 -05:00
Henry Schreiner
d4b9f3471f
docs: update changelog (#3556)
* docs: update changelog

* Update changelog.rst

* [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-12-21 16:28:23 -05:00
Henry Schreiner
e50f841de0
fix: do not use LTS on mips64 and ppc64le (#3557) 2021-12-21 15:42:34 -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
pre-commit-ci[bot]
d0406c747e
[pre-commit.ci] pre-commit autoupdate (#3563)
updates:
- [github.com/pre-commit/mirrors-mypy: v0.910-1 → v0.920](https://github.com/pre-commit/mirrors-mypy/compare/v0.910-1...v0.920)
- [github.com/shellcheck-py/shellcheck-py: v0.8.0.1 → v0.8.0.2](https://github.com/shellcheck-py/shellcheck-py/compare/v0.8.0.1...v0.8.0.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-20 23:11:48 -05:00
Bobby Impollonia
7516811315
fix(setup_helpers): ensure ThreadPool is closed (#3548)
* Ensure ThreadPool is closed in setup_helpers

The ParallelCompile setup helper using a ThreadPool to enable its
parallelism. It does not properly close the pool when it is done with
it.
This can lead to a "Exception ignored in: <function Pool.__del__..."
message with traceback being printed at shutdown.
Use pool.terminate() instead of context manager for Python 2.7
compatibility

* Add note to remove code that supports Python 2

Co-authored-by: Bobby Impollonia <bobby@k13capital.com>
2021-12-13 12:45:33 -05:00
pre-commit-ci[bot]
59aa99860c
[pre-commit.ci] pre-commit autoupdate (#3533)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 21.11b1 → 21.12b0](https://github.com/psf/black/compare/21.11b1...21.12b0)

* Keep blacken-docs in sync

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
2021-12-06 17:12:03 -05:00
Ralf W. Grosse-Kunstleve
2675884d91 Tracking ci.yml changes from master. 2021-12-03 11:12:53 -08:00
Ralf W. Grosse-Kunstleve
1418c65d77 Merge branch 'master' into sh_merge_master 2021-12-03 11:12:00 -08:00