Commit Graph

2393 Commits

Author SHA1 Message Date
Ralf W. Grosse-Kunstleve
a1918dd6d9 Merge branch 'master' into smart_holder 2021-07-17 10:32:03 -07:00
Ralf W. Grosse-Kunstleve
34f587dd23
Removing all warning pragmas that have not effect. (#3127) 2021-07-17 08:54:31 -07:00
Henry Schreiner
74935f8d67
chore: post-release (#3128) 2021-07-17 11:50:42 -04:00
Ralf W. Grosse-Kunstleve
02dc01b536 Merge branch 'master' into smart_holder 2021-07-16 08:14:43 -07:00
Henry Schreiner
65e95ea867
chore: bump to 2.7.0 (#3123) 2021-07-16 09:27:47 -04:00
Ralf W. Grosse-Kunstleve
5548f24b37 Merge branch 'master' into smart_holder 2021-07-15 20:43:55 -07:00
Henry Schreiner
6642f389dc
docs: update changelog (#3122) 2021-07-15 20:00:07 -04:00
Ralf W. Grosse-Kunstleve
1f04229733 Merge branch 'master' into smart_holder 2021-07-15 15:05:40 -07:00
Ralf W. Grosse-Kunstleve
4359e00b97
Introducing PYBIND11_VERSION_HEX (#3120)
* Introducing PYBIND11_VERSION_HEX (better late than never!)

* PYBIND11_VERSION_HEX consistency check in setup.py
2021-07-15 15:00:57 -07:00
Henry Schreiner
1b10292c05
chore: support PDF from nox (#3121) 2021-07-15 16:54:40 -04:00
Axel Huebl
55f6f6e9bf
Fix: RTD Docutils Build (#3119)
The docutils 0.17+ release uses more semantic HTML5 tags, which
the RTD theme does not (yet) know.

This breaks side bar, lists and other elements.
2021-07-15 15:41:36 -04:00
Henry Schreiner
2415c09459
feat(package): support pipx run (#3117) 2021-07-15 15:01:29 -04:00
Henry Schreiner
31843d455d
docs: reduce visibility of 3.9.0 warning (#3105) 2021-07-15 15:01:13 -04:00
Ralf W. Grosse-Kunstleve
6d1026763a Merge branch 'master' into smart_holder 2021-07-15 10:13:07 -07:00
Boris Staletic
5cd3750757
Enable -Wstrict-aliasing warning (#2816)
* Enable -Wstrict-aliasing warning

* Narrow down the scope of -Wstrict-aliasing

* Go home, MSVC, you're drunk

* Make sure "pragma GCC" is not executed on ICC

Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net>
2021-07-15 12:38:52 -04:00
Ralf W. Grosse-Kunstleve
88546fff7d Fixing merge conflict. 2021-07-15 06:23:06 -07:00
Aaron Gokaslan
c4b0dc7cdd
Add shellcheck style checking (#3114) 2021-07-14 16:52:13 -04:00
Henry Schreiner
cd061aeef1
style: pre-commit cleanup (#3111)
* style: disallow PyTest (should be pytest)

* style: cleanup spell checking a bit

* style: add a few items to the .gitignore
2021-07-14 16:49:13 -04:00
Ralf W. Grosse-Kunstleve
279c93654e Merge branch 'master' into smart_holder 2021-07-13 21:24:02 -07:00
Shane Loretz
7331d381af
Raise codec errors when casting to std::string (#2903)
* Raise codec errors when casting to std::string

Allow the codec's exception to be raised instead of RuntimeError when
casting from py::str to std::string.

PY2 allows ucs surrogates in UTF-8 conversion

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* Attempt to fix py2 error

* Revert all unicode literals

* Fixed

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
2021-07-13 21:21:55 -07:00
Ralf W. Grosse-Kunstleve
aca6c3ba37
* Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087)
* Manually moving `// NOLINT` comments so that clang-format does not move them to the wrong places.

* Manually reformatting comments related to `static_assert`s so that clang-format does not need two passes.

* Empty lines between #includes, to prevent clang-format from shuffling the order and thereby confusing MSVC 2015.

* git diff -U0 --no-color HEAD^ | python3 $HOME/clone/llvm-project/clang/tools/clang-format/clang-format-diff.py -p1 -style=file -i
2021-07-13 18:14:58 -07:00
Antony Lee
1be0a0a610
Add helper to build in-tree extensions. (#2831)
For single-file extensions, a convenient pattern offered by cython
is to place the source files directly in the python source tree
(`foo/__init__.py`, `foo/ext.pyx`), deriving the package names from
their filesystem location.  Adapt this pattern for pybind11, using an
`intree_extensions` helper, which should be thought of as the moral
equivalent to `cythonize`.

Differences with cythonize: I chose not to include globbing support
(`intree_extensions(glob.glob("**/*.cpp"))` seems sufficient), nor to
provide extension-customization kwargs (directly setting the attributes
on the resulting Pybind11Extension objects seems sufficient).

We could choose to have `intree_extension` (singular instead) and make
users write `[*map(intree_extension, glob.glob("**/*.cpp"))]`; no strong
opinion here.

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
2021-07-13 17:21:55 -04:00
Ralf W. Grosse-Kunstleve
42c123f59d Merge branch 'master' into smart_holder 2021-07-13 13:27:31 -07:00
jbarlow83
2b7985e548
Improve documentation of discard_as_unraisable() API (#2697)
* Improve documentation of discard_as_unraisable() API

* Update pytypes.h

Remove "the above"

* Update pytypes.h

Fix precommit error

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
2021-07-13 15:32:56 -04:00
Ralf W. Grosse-Kunstleve
6133fc7b0c Merge branch 'master' into smart_holder 2021-07-13 10:29:36 -07:00
Aaron Gokaslan
25e470c57d
fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094)
* clang-tidy: guard against more UB behavior

* Remove slicing check for now
2021-07-13 09:54:32 -04:00
Ralf W. Grosse-Kunstleve
3f55b36dbb Result of automatic reformatting (pyupgrade via new pre-commit hook). 2021-07-13 06:20:01 -07:00
Ralf W. Grosse-Kunstleve
88cc350075 Merge branch 'master' into smart_holder 2021-07-13 05:57:50 -07:00
Henry Schreiner
6a644c8f04
docs: update changelog (#3099)
* docs: update changelog

* docs: add one more and merge tidy
2021-07-13 00:08:29 -04:00
Henry Schreiner
0e2e003508 style: add pyupgrade check, 2.7+ 2021-07-12 21:46:24 -04:00
Henry Schreiner
11e12fe455 chore: move some config to pyproject.toml 2021-07-12 21:46:24 -04:00
Henry Schreiner
84fdadfbcc chore: update pre-commit hooks 2021-07-12 21:46:24 -04:00
Ralf W. Grosse-Kunstleve
678538f097 Merge branch 'master' into smart_holder 2021-07-12 16:59:58 -07:00
Ralf W. Grosse-Kunstleve
75090647ce
More precise return_value_policy::automatic documentation. (#2920)
* Adding test_return_vector_bool_raw_ptr to test_stl.py.

* First attempt to make the documentation more accurate, but not trying to be comprehensive, to not bloat the reference table with too many details.

* Fixing minor oversights.

* Applying reviewer suggestion.
2021-07-12 16:56:10 -07:00
Ralf W. Grosse-Kunstleve
e423df92dd Merge branch 'master' into smart_holder 2021-07-12 14:53:39 -07:00
Henry Schreiner
ddf0efb990
chore: add nox support (#3101)
* chore: add nox support

* chore: add more lines to CODEOWNERS
2021-07-12 17:45:40 -04:00
Ralf W. Grosse-Kunstleve
932a4cf409 Merge branch 'master' into smart_holder 2021-07-12 14:07:26 -07:00
Ralf W. Grosse-Kunstleve
9f11951b5b
Fixing spelling errors that went undetected because the pre-commit spell check was added after the CI for PR #2995 last ran. (#3103) 2021-07-12 17:00:48 -04:00
Henry Schreiner
f0a65c899c
docs(fix): spelling mistake in recent commit 2021-07-12 16:57:28 -04:00
Ralf W. Grosse-Kunstleve
7472d37a93
Adding iostream.h thread-safety documentation. (#2995)
* Adding iostream.h thread-safety documentation.

* Restoring `TestThread` code with added `std::lock_guard<std::mutex>`.

* Updating new comments to reflect new information.

* Fixing up `git rebase -X theirs` accidents.
2021-07-12 13:39:06 -07:00
Ralf W. Grosse-Kunstleve
2d468697d9
NOLINT reduction (#3096)
* Copying from prework_no_rst branch (PR #3087): test_numpy_array.cpp, test_stl.cpp

* Manual changes reducing NOLINTs.

* clang-format-diff.py

* Minor adjustment to avoid MSVC warning C4702: unreachable code
2021-07-12 13:10:28 -07:00
Henry Schreiner
7a64b8adcc
docs: fix script issues for changelog compilation (#3100)
[skip ci]
2021-07-12 14:10:46 -04:00
Ralf W. Grosse-Kunstleve
d3cfcdff9a Tracking ci.yml changes from master. 2021-07-11 00:46:36 -07:00
Ralf W. Grosse-Kunstleve
d6ca5f8cab Merge branch 'master' into smart_holder 2021-07-11 00:44:59 -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
Ralf W. Grosse-Kunstleve
14fc79f18e
WIP: restoring valgrind CI on smart_holder branch (#3090)
* * Rollback of PR #3068.
* Using latest pytest main branch for 3.9 and 3.10.
* WORKAROUND_ENABLING_ROLLBACK_OF_PR3068 in test_class_sh_trampoline_shared_from_this.py

First experiment combining two potential fixes: latest pytest, workaround.
If this succeeds the next step will be to try only latest pytest without the workaround.

Note: the workaround is known to resolve the MSAN error reported under
https://github.com/pybind/pybind11/pull/3068#issuecomment-877658470

* WORKAROUND_ENABLING_ROLLBACK_OF_PR3068 = False

* Narrowing down WORKAROUND_ENABLING_ROLLBACK_OF_PR3068 to Python 3.9
2021-07-10 17:54:23 -07:00
Ralf W. Grosse-Kunstleve
9cd8e7449b Merge branch 'master' into smart_holder 2021-07-10 16:39:02 -07:00
Jan Iwaszkiewicz
cf006af2f0
Fix typos and docs style (#3088)
* py::pickle typo

* correct dots and parentheses
2021-07-10 11:16:07 -07:00
Ralf W. Grosse-Kunstleve
3c185332b1 Merge branch 'master' into smart_holder 2021-07-09 18:25:32 -07:00
Ralf W. Grosse-Kunstleve
bac5a0c370
Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086) 2021-07-09 14:09:56 -07:00