Skip to content

Commit 71e95ae

Browse files
committed
Merge branch 'master' of https://github.com/pybind/pybind11 into feature-make_namespace
2 parents e9dc8d7 + 4c7e509 commit 71e95ae

File tree

135 files changed

+4945
-2728
lines changed

Some content is hidden

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

135 files changed

+4945
-2728
lines changed

.clang-format

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# clang-format --style=llvm --dump-config
44
BasedOnStyle: LLVM
55
AccessModifierOffset: -4
6-
AlignConsecutiveAssignments: true
76
AlwaysBreakTemplateDeclarations: Yes
87
BinPackArguments: false
98
BinPackParameters: false
@@ -15,7 +14,6 @@ IndentPPDirectives: AfterHash
1514
IndentWidth: 4
1615
Language: Cpp
1716
SpaceAfterCStyleCast: true
18-
# SpaceInEmptyBlock: true # too new
1917
Standard: Cpp11
2018
TabWidth: 4
2119
...

.clang-tidy

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,62 @@
11
FormatStyle: file
22

33
Checks: '
4+
*bugprone*,
5+
cppcoreguidelines-init-variables,
6+
clang-analyzer-optin.cplusplus.VirtualCall,
47
llvm-namespace-comment,
5-
modernize-use-override,
6-
readability-container-size-empty,
7-
modernize-use-using,
8-
modernize-use-equals-default,
8+
misc-misplaced-const,
9+
misc-non-copyable-objects,
10+
misc-static-assert,
11+
misc-throw-by-value-catch-by-reference,
12+
misc-uniqueptr-reset-release,
13+
misc-unused-parameters,
14+
modernize-avoid-bind,
15+
modernize-make-shared,
16+
modernize-redundant-void-arg,
17+
modernize-replace-auto-ptr,
18+
modernize-replace-disallow-copy-and-assign-macro,
19+
modernize-replace-random-shuffle,
20+
modernize-shrink-to-fit,
921
modernize-use-auto,
22+
modernize-use-bool-literals,
23+
modernize-use-equals-default,
24+
modernize-use-equals-delete,
25+
modernize-use-default-member-init,
26+
modernize-use-noexcept,
1027
modernize-use-emplace,
28+
modernize-use-override,
29+
modernize-use-using,
30+
*performance*,
31+
readability-avoid-const-params-in-decls,
32+
readability-container-size-empty,
33+
readability-else-after-return,
34+
readability-delete-null-pointer,
35+
readability-implicit-bool-conversion,
36+
readability-make-member-function-const,
37+
readability-misplaced-array-index,
38+
readability-non-const-parameter,
39+
readability-redundant-function-ptr-dereference,
40+
readability-redundant-smartptr-get,
41+
readability-redundant-string-cstr,
42+
readability-simplify-subscript-expr,
43+
readability-static-accessed-through-instance,
44+
readability-static-definition-in-anonymous-namespace,
45+
readability-string-compare,
46+
readability-uniqueptr-delete-release,
47+
-bugprone-exception-escape,
48+
-bugprone-reserved-identifier,
49+
-bugprone-unused-raii,
1150
'
1251

52+
CheckOptions:
53+
- key: performance-for-range-copy.WarnOnAllAutoCopies
54+
value: true
55+
- key: performance-unnecessary-value-param.AllowedTypes
56+
value: 'exception_ptr$;'
57+
- key: readability-implicit-bool-conversion.AllowPointerConditions
58+
value: true
59+
1360
HeaderFilterRegex: 'pybind11/.*h'
61+
62+
WarningsAsErrors: '*'

.github/CODEOWNERS

Lines changed: 9 additions & 0 deletions
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

.github/CONTRIBUTING.md

Lines changed: 34 additions & 6 deletions
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
72+
nox -s tests
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

@@ -203,14 +230,15 @@ of the pybind11 repo.
203230
[`clang-tidy`][clang-tidy] performs deeper static code analyses and is
204231
more complex to run, compared to `clang-format`, but support for `clang-tidy`
205232
is built into the pybind11 CMake configuration. To run `clang-tidy`, the
206-
following recipe should work. Files will be modified in place, so you can
207-
use git to monitor the changes.
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.
208236

209237
```bash
210-
docker run --rm -v $PWD:/pybind11 -it silkeh/clang:10
211-
apt-get update && apt-get install python3-dev python3-pytest
212-
cmake -S pybind11/ -B build -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);-fix"
213-
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
214242
```
215243

216244
### Include what you use

.github/ISSUE_TEMPLATE/bug-report.md

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

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 45 additions & 0 deletions
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

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
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

.github/ISSUE_TEMPLATE/feature-request.md

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

.github/ISSUE_TEMPLATE/question.md

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

0 commit comments

Comments
 (0)