Skip to content

Commit 3665725

Browse files
committed
3rdparty: Bump vendored pybind11 version
Signed-off-by: gatecat <[email protected]>
1 parent 2f06397 commit 3665725

File tree

208 files changed

+19396
-9605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+19396
-9605
lines changed

libtrellis/3rdparty/pybind11/.appveyor.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 1.0.{build}
22
image:
3-
- Visual Studio 2015
3+
- Visual Studio 2017
44
test: off
55
skip_branch_with_pr: true
66
build:
@@ -11,15 +11,13 @@ environment:
1111
matrix:
1212
- PYTHON: 36
1313
CONFIG: Debug
14-
- PYTHON: 27
15-
CONFIG: Debug
1614
install:
1715
- ps: |
18-
$env:CMAKE_GENERATOR = "Visual Studio 14 2015"
16+
$env:CMAKE_GENERATOR = "Visual Studio 15 2017"
1917
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
2018
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
2119
python -W ignore -m pip install --upgrade pip wheel
22-
python -W ignore -m pip install pytest numpy --no-warn-script-location
20+
python -W ignore -m pip install pytest numpy --no-warn-script-location pytest-timeout
2321
- ps: |
2422
Start-FileDownload 'https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip'
2523
7z x eigen-3.3.7.zip -y > $null
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# See all possible options and defaults with:
3+
# clang-format --style=llvm --dump-config
4+
BasedOnStyle: LLVM
5+
AccessModifierOffset: -4
6+
AllowShortLambdasOnASingleLine: true
7+
AlwaysBreakTemplateDeclarations: Yes
8+
BinPackArguments: false
9+
BinPackParameters: false
10+
BreakBeforeBinaryOperators: All
11+
BreakConstructorInitializers: BeforeColon
12+
ColumnLimit: 99
13+
CommentPragmas: 'NOLINT:.*|^ IWYU pragma:'
14+
IncludeBlocks: Regroup
15+
IndentCaseLabels: true
16+
IndentPPDirectives: AfterHash
17+
IndentWidth: 4
18+
Language: Cpp
19+
SpaceAfterCStyleCast: true
20+
Standard: Cpp11
21+
StatementMacros: ['PyObject_HEAD']
22+
TabWidth: 4
23+
IncludeCategories:
24+
- Regex: '<pybind11/.*'
25+
Priority: -1
26+
- Regex: 'pybind11.h"$'
27+
Priority: 1
28+
- Regex: '^".*/?detail/'
29+
Priority: 1
30+
SortPriority: 2
31+
- Regex: '^"'
32+
Priority: 1
33+
SortPriority: 3
34+
- Regex: '<[[:alnum:]._]+>'
35+
Priority: 4
36+
- Regex: '.*'
37+
Priority: 5
38+
...
+63-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,72 @@
11
FormatStyle: file
22

33
Checks: '
4+
*bugprone*,
5+
clang-analyzer-optin.performance.Padding,
6+
clang-analyzer-optin.cplusplus.VirtualCall,
7+
cppcoreguidelines-init-variables,
8+
cppcoreguidelines-prefer-member-initializer,
9+
cppcoreguidelines-pro-type-static-cast-downcast,
10+
cppcoreguidelines-slicing,
11+
google-explicit-constructor,
412
llvm-namespace-comment,
5-
modernize-use-override,
6-
readability-container-size-empty,
7-
modernize-use-using,
8-
modernize-use-equals-default,
13+
misc-misplaced-const,
14+
misc-non-copyable-objects,
15+
misc-static-assert,
16+
misc-throw-by-value-catch-by-reference,
17+
misc-uniqueptr-reset-release,
18+
misc-unused-parameters,
19+
modernize-avoid-bind,
20+
modernize-make-shared,
21+
modernize-redundant-void-arg,
22+
modernize-replace-auto-ptr,
23+
modernize-replace-disallow-copy-and-assign-macro,
24+
modernize-replace-random-shuffle,
25+
modernize-shrink-to-fit,
926
modernize-use-auto,
27+
modernize-use-bool-literals,
28+
modernize-use-equals-default,
29+
modernize-use-equals-delete,
30+
modernize-use-default-member-init,
31+
modernize-use-noexcept,
1032
modernize-use-emplace,
33+
modernize-use-override,
34+
modernize-use-using,
35+
*performance*,
36+
readability-avoid-const-params-in-decls,
37+
readability-braces-around-statements,
38+
readability-const-return-type,
39+
readability-container-size-empty,
40+
readability-delete-null-pointer,
41+
readability-else-after-return,
42+
readability-implicit-bool-conversion,
43+
readability-inconsistent-declaration-parameter-name,
44+
readability-make-member-function-const,
45+
readability-misplaced-array-index,
46+
readability-non-const-parameter,
47+
readability-qualified-auto,
48+
readability-redundant-function-ptr-dereference,
49+
readability-redundant-smartptr-get,
50+
readability-redundant-string-cstr,
51+
readability-simplify-subscript-expr,
52+
readability-static-accessed-through-instance,
53+
readability-static-definition-in-anonymous-namespace,
54+
readability-string-compare,
55+
readability-suspicious-call-argument,
56+
readability-uniqueptr-delete-release,
57+
-bugprone-exception-escape,
58+
-bugprone-reserved-identifier,
59+
-bugprone-unused-raii,
1160
'
1261

62+
CheckOptions:
63+
- key: performance-for-range-copy.WarnOnAllAutoCopies
64+
value: true
65+
- key: performance-unnecessary-value-param.AllowedTypes
66+
value: 'exception_ptr$;'
67+
- key: readability-implicit-bool-conversion.AllowPointerConditions
68+
value: true
69+
1370
HeaderFilterRegex: 'pybind11/.*h'
71+
72+
WarningsAsErrors: '*'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/*.svg binary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.cmake @henryiii
2+
CMakeLists.txt @henryiii
3+
*.yml @henryiii
4+
*.yaml @henryiii
5+
/tools/ @henryiii
6+
/pybind11/ @henryiii
7+
noxfile.py @henryiii
8+
.clang-format @henryiii
9+
.clang-tidy @henryiii

libtrellis/3rdparty/pybind11/.github/CONTRIBUTING.md

+84-17
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,33 @@ derivative works thereof, in binary and source code form.
5353

5454
## Development of pybind11
5555

56+
### Quick setup
57+
58+
To setup a quick development environment, use [`nox`](https://nox.thea.codes).
59+
This will allow you to do some common tasks with minimal setup effort, but will
60+
take more time to run and be less flexible than a full development environment.
61+
If you use [`pipx run nox`](https://pipx.pypa.io), you don't even need to
62+
install `nox`. Examples:
63+
64+
```bash
65+
# List all available sessions
66+
nox -l
67+
68+
# Run linters
69+
nox -s lint
70+
71+
# Run tests on Python 3.9
72+
nox -s tests-3.9
73+
74+
# Build and preview docs
75+
nox -s docs -- serve
76+
77+
# Build SDists and wheels
78+
nox -s build
79+
```
80+
81+
### Full setup
82+
5683
To setup an ideal development environment, run the following commands on a
5784
system with CMake 3.14+:
5885

@@ -66,19 +93,18 @@ cmake --build build -j4
6693

6794
Tips:
6895

69-
* You can use `virtualenv` (from PyPI) instead of `venv` (which is Python 3
70-
only).
96+
* You can use `virtualenv` (faster, from PyPI) instead of `venv`.
7197
* You can select any name for your environment folder; if it contains "env" it
7298
will be ignored by git.
73-
* If you dont have CMake 3.14+, just add cmake to the pip install command.
99+
* If you don't have CMake 3.14+, just add "cmake" to the pip install command.
74100
* You can use `-DPYBIND11_FINDPYTHON=ON` to use FindPython on CMake 3.12+
75101
* In classic mode, you may need to set `-DPYTHON_EXECUTABLE=/path/to/python`.
76102
FindPython uses `-DPython_ROOT_DIR=/path/to` or
77103
`-DPython_EXECUTABLE=/path/to/python`.
78104

79105
### Configuration options
80106

81-
In CMake, configuration options are given with “-D”. Options are stored in the
107+
In CMake, configuration options are given with "-D". Options are stored in the
82108
build directory, in the `CMakeCache.txt` file, so they are remembered for each
83109
build directory. Two selections are special - the generator, given with `-G`,
84110
and the compiler, which is selected based on environment variables `CXX` and
@@ -88,12 +114,12 @@ after the initial run.
88114
The valid options are:
89115

90116
* `-DCMAKE_BUILD_TYPE`: Release, Debug, MinSizeRel, RelWithDebInfo
91-
* `-DPYBIND11_FINDPYTHON=ON`: Use CMake 3.12+s FindPython instead of the
117+
* `-DPYBIND11_FINDPYTHON=ON`: Use CMake 3.12+'s FindPython instead of the
92118
classic, deprecated, custom FindPythonLibs
93119
* `-DPYBIND11_NOPYTHON=ON`: Disable all Python searching (disables tests)
94120
* `-DBUILD_TESTING=ON`: Enable the tests
95121
* `-DDOWNLOAD_CATCH=ON`: Download catch to build the C++ tests
96-
* `-DOWNLOAD_EIGEN=ON`: Download Eigen for the NumPy tests
122+
* `-DDOWNLOAD_EIGEN=ON`: Download Eigen for the NumPy tests
97123
* `-DPYBIND11_INSTALL=ON/OFF`: Enable the install target (on by default for the
98124
master project)
99125
* `-DUSE_PYTHON_INSTALL_DIR=ON`: Try to install into the python dir
@@ -126,13 +152,26 @@ cmake --build build --target check
126152
`--target` can be spelled `-t` in CMake 3.15+. You can also run individual
127153
tests with these targets:
128154

129-
* `pytest`: Python tests only
155+
* `pytest`: Python tests only, using the
156+
[pytest](https://docs.pytest.org/en/stable/) framework
130157
* `cpptest`: C++ tests only
131158
* `test_cmake_build`: Install / subdirectory tests
132159

133160
If you want to build just a subset of tests, use
134-
`-DPYBIND11_TEST_OVERRIDE="test_callbacks.cpp;test_pickling.cpp"`. If this is
135-
empty, all tests will be built.
161+
`-DPYBIND11_TEST_OVERRIDE="test_callbacks;test_pickling"`. If this is
162+
empty, all tests will be built. Tests are specified without an extension if they need both a .py and
163+
.cpp file.
164+
165+
You may also pass flags to the `pytest` target by editing `tests/pytest.ini` or
166+
by using the `PYTEST_ADDOPTS` environment variable
167+
(see [`pytest` docs](https://docs.pytest.org/en/2.7.3/customize.html#adding-default-options)). As an example:
168+
169+
```bash
170+
env PYTEST_ADDOPTS="--capture=no --exitfirst" \
171+
cmake --build build --target pytest
172+
# Or using abbreviated flags
173+
env PYTEST_ADDOPTS="-s -x" cmake --build build --target pytest
174+
```
136175

137176
### Formatting
138177

@@ -164,16 +203,42 @@ name, pre-commit):
164203
pre-commit install
165204
```
166205

206+
### Clang-Format
207+
208+
As of v2.6.2, pybind11 ships with a [`clang-format`][clang-format]
209+
configuration file at the top level of the repo (the filename is
210+
`.clang-format`). Currently, formatting is NOT applied automatically, but
211+
manually using `clang-format` for newly developed files is highly encouraged.
212+
To check if a file needs formatting:
213+
214+
```bash
215+
clang-format -style=file --dry-run some.cpp
216+
```
217+
218+
The output will show things to be fixed, if any. To actually format the file:
219+
220+
```bash
221+
clang-format -style=file -i some.cpp
222+
```
223+
224+
Note that the `-style-file` option searches the parent directories for the
225+
`.clang-format` file, i.e. the commands above can be run in any subdirectory
226+
of the pybind11 repo.
227+
167228
### Clang-Tidy
168229

169-
To run Clang tidy, the following recipe should work. Files will be modified in
170-
place, so you can use git to monitor the changes.
230+
[`clang-tidy`][clang-tidy] performs deeper static code analyses and is
231+
more complex to run, compared to `clang-format`, but support for `clang-tidy`
232+
is built into the pybind11 CMake configuration. To run `clang-tidy`, the
233+
following recipe should work. Run the `docker` command from the top-level
234+
directory inside your pybind11 git clone. Files will be modified in place,
235+
so you can use git to monitor the changes.
171236

172237
```bash
173-
docker run --rm -v $PWD:/pybind11 -it silkeh/clang:10
174-
apt-get update && apt-get install python3-dev python3-pytest
175-
cmake -S pybind11/ -B build -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);-fix"
176-
cmake --build build
238+
docker run --rm -v $PWD:/mounted_pybind11 -it silkeh/clang:12
239+
apt-get update && apt-get install -y python3-dev python3-pytest
240+
cmake -S /mounted_pybind11/ -B build -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);-fix" -DDOWNLOAD_EIGEN=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=17
241+
cmake --build build -j 2 -- --keep-going
177242
```
178243

179244
### Include what you use
@@ -186,12 +251,12 @@ cmake -S . -B build-iwyu -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=$(which include-what-y
186251
cmake --build build
187252
```
188253

189-
The report is sent to stderr; you can pip it into a file if you wish.
254+
The report is sent to stderr; you can pipe it into a file if you wish.
190255

191256
### Build recipes
192257

193258
This builds with the Intel compiler (assuming it is in your path, along with a
194-
recent CMake and Python 3):
259+
recent CMake and Python):
195260

196261
```bash
197262
python3 -m venv venv
@@ -313,6 +378,8 @@ if you really want to.
313378

314379

315380
[pre-commit]: https://pre-commit.com
381+
[clang-format]: https://clang.llvm.org/docs/ClangFormat.html
382+
[clang-tidy]: https://clang.llvm.org/extra/clang-tidy/
316383
[pybind11.readthedocs.org]: http://pybind11.readthedocs.org/en/latest
317384
[issue tracker]: https://github.com/pybind/pybind11/issues
318385
[gitter]: https://gitter.im/pybind/Lobby
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Bug Report
2+
description: File an issue about a bug
3+
title: "[BUG]: "
4+
labels: [triage]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Maintainers will only make a best effort to triage PRs. Please do your best to make the issue as easy to act on as possible, and only open if clearly a problem with pybind11 (ask first if unsure).
10+
- type: checkboxes
11+
id: steps
12+
attributes:
13+
label: Required prerequisites
14+
description: Make sure you've completed the following steps before submitting your issue -- thank you!
15+
options:
16+
- label: Make sure you've read the [documentation](https://pybind11.readthedocs.io). Your issue may be addressed there.
17+
required: true
18+
- label: Search the [issue tracker](https://github.com/pybind/pybind11/issues) and [Discussions](https:/pybind/pybind11/discussions) to verify that this hasn't already been reported. +1 or comment there if it has.
19+
required: true
20+
- label: Consider asking first in the [Gitter chat room](https://gitter.im/pybind/Lobby) or in a [Discussion](https:/pybind/pybind11/discussions/new).
21+
required: false
22+
23+
- type: textarea
24+
id: description
25+
attributes:
26+
label: Problem description
27+
placeholder: >-
28+
Provide a short description, state the expected behavior and what
29+
actually happens. Include relevant information like what version of
30+
pybind11 you are using, what system you are on, and any useful commands
31+
/ output.
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
id: code
37+
attributes:
38+
label: Reproducible example code
39+
placeholder: >-
40+
The code should be minimal, have no external dependencies, isolate the
41+
function(s) that cause breakage. Submit matched and complete C++ and
42+
Python snippets that can be easily compiled and run to diagnose the
43+
issue. If possible, make a PR with a new, failing test to give us a
44+
starting point to work on!
45+
render: text
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/pybind/pybind11/discussions/new
5+
about: Please ask and answer questions here, or propose new ideas.
36
- name: Gitter room
47
url: https://gitter.im/pybind/Lobby
58
about: A room for discussing pybind11 with an active community

libtrellis/3rdparty/pybind11/.github/dependabot.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ updates:
66
schedule:
77
interval: "daily"
88
ignore:
9-
# Offical actions have moving tags like v1
9+
# Official actions have moving tags like v1
1010
# that are used, so they don't need updates here
11-
- dependency-name: "actions/*"
11+
- dependency-name: "actions/checkout"
12+
- dependency-name: "actions/setup-python"
13+
- dependency-name: "actions/cache"
14+
- dependency-name: "actions/upload-artifact"
15+
- dependency-name: "actions/download-artifact"
16+
- dependency-name: "actions/labeler"

0 commit comments

Comments
 (0)