Skip to content

Commit 4d774ec

Browse files
committed
Merge branch 'master' into sh_merge_master
2 parents c557f9a + 9a29637 commit 4d774ec

24 files changed

+452
-154
lines changed

.clang-tidy

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

3-
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,
12-
llvm-namespace-comment,
13-
misc-definitions-in-headers,
14-
misc-misplaced-const,
15-
misc-non-copyable-objects,
16-
misc-static-assert,
17-
misc-throw-by-value-catch-by-reference,
18-
misc-uniqueptr-reset-release,
19-
misc-unused-parameters,
20-
modernize-avoid-bind,
21-
modernize-loop-convert,
22-
modernize-make-shared,
23-
modernize-redundant-void-arg,
24-
modernize-replace-auto-ptr,
25-
modernize-replace-disallow-copy-and-assign-macro,
26-
modernize-replace-random-shuffle,
27-
modernize-shrink-to-fit,
28-
modernize-use-auto,
29-
modernize-use-bool-literals,
30-
modernize-use-default-member-init,
31-
modernize-use-equals-default,
32-
modernize-use-equals-delete,
33-
modernize-use-emplace,
34-
modernize-use-noexcept,
35-
modernize-use-nullptr,
36-
modernize-use-override,
37-
modernize-use-using,
38-
*performance*,
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-exception-escape,
61-
-bugprone-reserved-identifier,
62-
-bugprone-unused-raii,
63-
'
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,
6464
6565
CheckOptions:
66+
- key: modernize-use-equals-default.IgnoreMacros
67+
value: false
6668
- key: performance-for-range-copy.WarnOnAllAutoCopies
6769
value: true
6870
- key: performance-inefficient-string-concatenation.StrictMode
@@ -73,5 +75,3 @@ CheckOptions:
7375
value: true
7476

7577
HeaderFilterRegex: 'pybind11/.*h'
76-
77-
WarningsAsErrors: '*'

.github/CONTRIBUTING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,14 @@ directory inside your pybind11 git clone. Files will be modified in place,
235235
so you can use git to monitor the changes.
236236

237237
```bash
238-
docker run --rm -v $PWD:/mounted_pybind11 -it silkeh/clang:12
238+
docker run --rm -v $PWD:/mounted_pybind11 -it silkeh/clang:13
239239
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
240+
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
241+
cmake --build build -j 2
242242
```
243243

244+
You can add `--fix` to the options list if you want.
245+
244246
### Include what you use
245247

246248
To run include what you use, install (`brew install include-what-you-use` on

.github/workflows/ci.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,14 @@ jobs:
282282
std: 20
283283
- clang: 10
284284
std: 17
285+
- clang: 11
286+
std: 20
287+
- clang: 12
288+
std: 20
289+
- clang: 13
290+
std: 20
291+
- clang: 14
292+
std: 20
285293

286294
name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64"
287295
container: "silkeh/clang:${{ matrix.clang }}"
@@ -436,14 +444,14 @@ jobs:
436444
strategy:
437445
fail-fast: false
438446
matrix:
439-
gcc:
440-
- 7
441-
- latest
442-
std:
443-
- 11
444447
include:
445-
- gcc: 10
446-
std: 20
448+
- { gcc: 7, std: 11 }
449+
- { gcc: 7, std: 17 }
450+
- { gcc: 8, std: 14 }
451+
- { gcc: 8, std: 17 }
452+
- { gcc: 10, std: 17 }
453+
- { gcc: 11, std: 20 }
454+
- { gcc: 12, std: 20 }
447455

448456
name: "🐍 3 • GCC ${{ matrix.gcc }} • C++${{ matrix.std }}• x64"
449457
container: "gcc:${{ matrix.gcc }}"

.github/workflows/format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# in .github/CONTRIBUTING.md and update as needed.
3838
name: Clang-Tidy
3939
runs-on: ubuntu-latest
40-
container: silkeh/clang:12
40+
container: silkeh/clang:13
4141
steps:
4242
- uses: actions/checkout@v3
4343

@@ -47,7 +47,7 @@ jobs:
4747
- name: Configure
4848
run: >
4949
cmake -S . -B build
50-
-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy)"
50+
-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);--use-color;--warnings-as-errors=*"
5151
-DDOWNLOAD_EIGEN=ON
5252
-DDOWNLOAD_CATCH=ON
5353
-DCMAKE_CXX_STANDARD=17

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ repos:
7373

7474
# Autoremoves unused imports
7575
- repo: https://github.com/hadialqattan/pycln
76-
rev: "v2.0.1"
76+
rev: "v2.0.4"
7777
hooks:
7878
- id: pycln
7979
stages: [manual]
@@ -110,7 +110,7 @@ repos:
110110

111111
# PyLint has native support - not always usable, but works for us
112112
- repo: https://github.com/PyCQA/pylint
113-
rev: "v2.14.4"
113+
rev: "v2.14.5"
114114
hooks:
115115
- id: pylint
116116
files: ^pybind11

docs/_static/css/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.highlight .go {
2+
color: #707070;
3+
}

docs/_static/theme_overrides.css

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/changelog.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ Starting with version 1.8.0, pybind11 releases use a `semantic versioning
99
Changes will be added here periodically from the "Suggested changelog entry"
1010
block in pull request descriptions.
1111

12+
13+
1214
IN DEVELOPMENT
1315
--------------
1416

17+
Changes will be summarized here periodically.
18+
19+
Version 2.10.0 (Jul 15, 2022)
20+
-----------------------------
21+
1522
Removed support for Python 2.7, Python 3.5, and MSVC 2015. Support for MSVC
1623
2017 is limited due to availability of CI runners; we highly recommend MSVC
1724
2019 or 2022 be used. Initial support added for Python 3.11.
1825

19-
2026
New features:
2127

2228
* ``py::anyset`` & ``py::frozenset`` were added, with copying (cast) to
@@ -70,6 +76,9 @@ Changes:
7076
requiring ``NDEBUG``, allowing use with release builds if desired.
7177
`#3913 <https://github.com/pybind/pybind11/pull/3913>`_
7278

79+
* Implicit conversion of the literal ``0`` to ``pybind11::handle`` is now disabled.
80+
`#4008 <https://github.com/pybind/pybind11/pull/4008>`_
81+
7382

7483
Bug fixes:
7584

@@ -98,6 +107,14 @@ Bug fixes:
98107
* Fix cast from pytype rvalue to another pytype.
99108
`#3949 <https://github.com/pybind/pybind11/pull/3949>`_
100109

110+
* Ensure proper behavior when garbage collecting classes with dynamic attributes in Python >=3.9.
111+
`#4051 <https://github.com/pybind/pybind11/pull/4051>`_
112+
113+
* A couple long-standing ``PYBIND11_NAMESPACE``
114+
``__attribute__((visibility("hidden")))`` inconsistencies are now fixed
115+
(affects only unusual environments).
116+
`#4043 <https://github.com/pybind/pybind11/pull/4043>`_
117+
101118
* ``pybind11::detail::get_internals()`` is now resilient to in-flight Python
102119
exceptions.
103120
`#3981 <https://github.com/pybind/pybind11/pull/3981>`_
@@ -147,6 +164,9 @@ Performance and style:
147164
* Optimize c++ to python function casting by using the rvalue caster.
148165
`#3966 <https://github.com/pybind/pybind11/pull/3966>`_
149166

167+
* Optimize Eigen sparse matrix casting by removing unnecessary temporary.
168+
`#4064 <https://github.com/pybind/pybind11/pull/4064>`_
169+
150170
* Avoid potential implicit copy/assignment constructors causing double free in
151171
``strdup_gaurd``.
152172
`#3905 <https://github.com/pybind/pybind11/pull/3905>`_
@@ -182,6 +202,9 @@ Build system improvements:
182202

183203
Backend and tidying up:
184204

205+
* New theme for the documentation.
206+
`#3109 <https://github.com/pybind/pybind11/pull/3109>`_
207+
185208
* Remove idioms in code comments. Use more inclusive language.
186209
`#3809 <https://github.com/pybind/pybind11/pull/3809>`_
187210

docs/conf.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
# ones.
3636
extensions = [
3737
"breathe",
38+
"sphinx_copybutton",
3839
"sphinxcontrib.rsvgconverter",
3940
"sphinxcontrib.moderncmakedomain",
4041
]
@@ -125,23 +126,7 @@
125126
# The theme to use for HTML and HTML Help pages. See the documentation for
126127
# a list of builtin themes.
127128

128-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
129-
130-
if not on_rtd: # only import and set the theme if we're building docs locally
131-
import sphinx_rtd_theme
132-
133-
html_theme = "sphinx_rtd_theme"
134-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
135-
136-
html_context = {"css_files": ["_static/theme_overrides.css"]}
137-
else:
138-
html_context = {
139-
"css_files": [
140-
"//media.readthedocs.org/css/sphinx_rtd_theme.css",
141-
"//media.readthedocs.org/css/readthedocs-doc-embed.css",
142-
"_static/theme_overrides.css",
143-
]
144-
}
129+
html_theme = "furo"
145130

146131
# Theme options are theme-specific and customize the look and feel of a theme
147132
# further. For a list of options available for each theme, see the
@@ -172,6 +157,10 @@
172157
# so a file named "default.css" will overwrite the builtin "default.css".
173158
html_static_path = ["_static"]
174159

160+
html_css_files = [
161+
"css/custom.css",
162+
]
163+
175164
# Add any extra paths that contain custom files (such as robots.txt or
176165
# .htaccess) here, relative to this directory. These files are copied
177166
# directly to the root of the documentation.

docs/pybind11-logo.png

2.46 KB
Loading

0 commit comments

Comments
 (0)