Skip to content

Commit 167a170

Browse files
author
Dilawar Singh
authored
Merge pull request #126 from dilawar/master
Fixes to CI pipeline and support for python 3.11
2 parents 1e02e13 + 5e4046d commit 167a170

File tree

186 files changed

+11479
-8115
lines changed

Some content is hidden

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

186 files changed

+11479
-8115
lines changed

scripts/update_pybind11.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22
git subtree pull --prefix source/pybind11 \
3-
https://github.com/pybind/pybind11 v2.9.1 --squash
3+
https://github.com/pybind/pybind11 v2.10.0 --squash

source/pybind11/.appveyor.yml

Lines changed: 2 additions & 4 deletions
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,11 +11,9 @@ 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

source/pybind11/.clang-format

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,36 @@
33
# clang-format --style=llvm --dump-config
44
BasedOnStyle: LLVM
55
AccessModifierOffset: -4
6+
AllowShortLambdasOnASingleLine: true
67
AlwaysBreakTemplateDeclarations: Yes
78
BinPackArguments: false
89
BinPackParameters: false
910
BreakBeforeBinaryOperators: All
1011
BreakConstructorInitializers: BeforeColon
1112
ColumnLimit: 99
13+
CommentPragmas: 'NOLINT:.*|^ IWYU pragma:'
14+
IncludeBlocks: Regroup
1215
IndentCaseLabels: true
1316
IndentPPDirectives: AfterHash
1417
IndentWidth: 4
1518
Language: Cpp
1619
SpaceAfterCStyleCast: true
1720
Standard: Cpp11
21+
StatementMacros: ['PyObject_HEAD']
1822
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
1938
...

source/pybind11/.clang-tidy

Lines changed: 63 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,75 @@
11
FormatStyle: file
22

3-
Checks: '
4-
*bugprone*,
5-
cppcoreguidelines-init-variables,
6-
cppcoreguidelines-slicing,
7-
clang-analyzer-optin.cplusplus.VirtualCall,
8-
google-explicit-constructor,
9-
llvm-namespace-comment,
10-
misc-misplaced-const,
11-
misc-non-copyable-objects,
12-
misc-static-assert,
13-
misc-throw-by-value-catch-by-reference,
14-
misc-uniqueptr-reset-release,
15-
misc-unused-parameters,
16-
modernize-avoid-bind,
17-
modernize-make-shared,
18-
modernize-redundant-void-arg,
19-
modernize-replace-auto-ptr,
20-
modernize-replace-disallow-copy-and-assign-macro,
21-
modernize-replace-random-shuffle,
22-
modernize-shrink-to-fit,
23-
modernize-use-auto,
24-
modernize-use-bool-literals,
25-
modernize-use-equals-default,
26-
modernize-use-equals-delete,
27-
modernize-use-default-member-init,
28-
modernize-use-noexcept,
29-
modernize-use-emplace,
30-
modernize-use-override,
31-
modernize-use-using,
32-
*performance*,
33-
readability-avoid-const-params-in-decls,
34-
readability-const-return-type,
35-
readability-container-size-empty,
36-
readability-delete-null-pointer,
37-
readability-else-after-return,
38-
readability-implicit-bool-conversion,
39-
readability-make-member-function-const,
40-
readability-misplaced-array-index,
41-
readability-non-const-parameter,
42-
readability-redundant-function-ptr-dereference,
43-
readability-redundant-smartptr-get,
44-
readability-redundant-string-cstr,
45-
readability-simplify-subscript-expr,
46-
readability-static-accessed-through-instance,
47-
readability-static-definition-in-anonymous-namespace,
48-
readability-string-compare,
49-
readability-suspicious-call-argument,
50-
readability-uniqueptr-delete-release,
51-
-bugprone-exception-escape,
52-
-bugprone-reserved-identifier,
53-
-bugprone-unused-raii,
54-
'
3+
Checks: |
4+
*bugprone*,
5+
*performance*,
6+
clang-analyzer-optin.cplusplus.VirtualCall,
7+
clang-analyzer-optin.performance.Padding,
8+
cppcoreguidelines-init-variables,
9+
cppcoreguidelines-prefer-member-initializer,
10+
cppcoreguidelines-pro-type-static-cast-downcast,
11+
cppcoreguidelines-slicing,
12+
google-explicit-constructor,
13+
llvm-namespace-comment,
14+
misc-definitions-in-headers,
15+
misc-misplaced-const,
16+
misc-non-copyable-objects,
17+
misc-static-assert,
18+
misc-throw-by-value-catch-by-reference,
19+
misc-uniqueptr-reset-release,
20+
misc-unused-parameters,
21+
modernize-avoid-bind,
22+
modernize-loop-convert,
23+
modernize-make-shared,
24+
modernize-redundant-void-arg,
25+
modernize-replace-auto-ptr,
26+
modernize-replace-disallow-copy-and-assign-macro,
27+
modernize-replace-random-shuffle,
28+
modernize-shrink-to-fit,
29+
modernize-use-auto,
30+
modernize-use-bool-literals,
31+
modernize-use-default-member-init,
32+
modernize-use-emplace,
33+
modernize-use-equals-default,
34+
modernize-use-equals-delete,
35+
modernize-use-noexcept,
36+
modernize-use-nullptr,
37+
modernize-use-override,
38+
modernize-use-using,
39+
readability-avoid-const-params-in-decls,
40+
readability-braces-around-statements,
41+
readability-const-return-type,
42+
readability-container-size-empty,
43+
readability-delete-null-pointer,
44+
readability-else-after-return,
45+
readability-implicit-bool-conversion,
46+
readability-inconsistent-declaration-parameter-name,
47+
readability-make-member-function-const,
48+
readability-misplaced-array-index,
49+
readability-non-const-parameter,
50+
readability-qualified-auto,
51+
readability-redundant-function-ptr-dereference,
52+
readability-redundant-smartptr-get,
53+
readability-redundant-string-cstr,
54+
readability-simplify-subscript-expr,
55+
readability-static-accessed-through-instance,
56+
readability-static-definition-in-anonymous-namespace,
57+
readability-string-compare,
58+
readability-suspicious-call-argument,
59+
readability-uniqueptr-delete-release,
60+
-bugprone-easily-swappable-parameters,
61+
-bugprone-exception-escape,
62+
-bugprone-reserved-identifier,
63+
-bugprone-unused-raii,
5564
5665
CheckOptions:
5766
- key: performance-for-range-copy.WarnOnAllAutoCopies
5867
value: true
68+
- key: performance-inefficient-string-concatenation.StrictMode
69+
value: true
5970
- key: performance-unnecessary-value-param.AllowedTypes
6071
value: 'exception_ptr$;'
6172
- key: readability-implicit-bool-conversion.AllowPointerConditions
6273
value: true
6374

6475
HeaderFilterRegex: 'pybind11/.*h'
65-
66-
WarningsAsErrors: '*'

source/pybind11/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/*.svg binary

source/pybind11/.github/CONTRIBUTING.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,18 @@ cmake --build build -j4
9393

9494
Tips:
9595

96-
* You can use `virtualenv` (from PyPI) instead of `venv` (which is Python 3
97-
only).
96+
* You can use `virtualenv` (faster, from PyPI) instead of `venv`.
9897
* You can select any name for your environment folder; if it contains "env" it
9998
will be ignored by git.
100-
* 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.
101100
* You can use `-DPYBIND11_FINDPYTHON=ON` to use FindPython on CMake 3.12+
102101
* In classic mode, you may need to set `-DPYTHON_EXECUTABLE=/path/to/python`.
103102
FindPython uses `-DPython_ROOT_DIR=/path/to` or
104103
`-DPython_EXECUTABLE=/path/to/python`.
105104

106105
### Configuration options
107106

108-
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
109108
build directory, in the `CMakeCache.txt` file, so they are remembered for each
110109
build directory. Two selections are special - the generator, given with `-G`,
111110
and the compiler, which is selected based on environment variables `CXX` and
@@ -115,7 +114,7 @@ after the initial run.
115114
The valid options are:
116115

117116
* `-DCMAKE_BUILD_TYPE`: Release, Debug, MinSizeRel, RelWithDebInfo
118-
* `-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
119118
classic, deprecated, custom FindPythonLibs
120119
* `-DPYBIND11_NOPYTHON=ON`: Disable all Python searching (disables tests)
121120
* `-DBUILD_TESTING=ON`: Enable the tests
@@ -247,12 +246,14 @@ directory inside your pybind11 git clone. Files will be modified in place,
247246
so you can use git to monitor the changes.
248247

249248
```bash
250-
docker run --rm -v $PWD:/mounted_pybind11 -it silkeh/clang:12
249+
docker run --rm -v $PWD:/mounted_pybind11 -it silkeh/clang:13
251250
apt-get update && apt-get install -y python3-dev python3-pytest
252-
cmake -S /mounted_pybind11/ -B build -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);-fix" -DDOWNLOAD_EIGEN=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=17
253-
cmake --build build -j 2 -- --keep-going
251+
cmake -S /mounted_pybind11/ -B build -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);--use-color" -DDOWNLOAD_EIGEN=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=17
252+
cmake --build build -j 2
254253
```
255254

255+
You can add `--fix` to the options list if you want.
256+
256257
### Include what you use
257258

258259
To run include what you use, install (`brew install include-what-you-use` on
@@ -268,7 +269,7 @@ The report is sent to stderr; you can pipe it into a file if you wish.
268269
### Build recipes
269270

270271
This builds with the Intel compiler (assuming it is in your path, along with a
271-
recent CMake and Python 3):
272+
recent CMake and Python):
272273

273274
```bash
274275
python3 -m venv venv

source/pybind11/.github/dependabot.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,3 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8-
ignore:
9-
# Official actions have moving tags like v1
10-
# that are used, so they don't need updates here
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"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"severity": "warning",
5+
"pattern": [
6+
{
7+
"regexp": "^([^:]+):(\\d+):(\\d+): ([A-DF-Z]\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"code": 4,
12+
"message": 5
13+
}
14+
],
15+
"owner": "pylint-warning"
16+
},
17+
{
18+
"severity": "error",
19+
"pattern": [
20+
{
21+
"regexp": "^([^:]+):(\\d+):(\\d+): (E\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
22+
"file": 1,
23+
"line": 2,
24+
"column": 3,
25+
"code": 4,
26+
"message": 5
27+
}
28+
],
29+
"owner": "pylint-error"
30+
}
31+
]
32+
}

0 commit comments

Comments
 (0)