Skip to content

Commit 11d6086

Browse files
committed
git subrepo clone (merge) --branch=stable https://github.com/pybind/pybind11 thirdparty/pybind11
subrepo: subdir: "thirdparty/pybind11" merged: "be97c5a9" upstream: origin: "https://github.com/pybind/pybind11" branch: "stable" commit: "be97c5a9" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb" See #230. Closes #230.
1 parent 54794e9 commit 11d6086

File tree

248 files changed

+63237
-0
lines changed

Some content is hidden

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

248 files changed

+63237
-0
lines changed

thirdparty/pybind11/.appveyor.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: 1.0.{build}
2+
image:
3+
- Visual Studio 2017
4+
test: off
5+
skip_branch_with_pr: true
6+
build:
7+
parallel: true
8+
platform:
9+
- x86
10+
environment:
11+
matrix:
12+
- PYTHON: 36
13+
CONFIG: Debug
14+
install:
15+
- ps: |
16+
$env:CMAKE_GENERATOR = "Visual Studio 15 2017"
17+
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
18+
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
19+
python -W ignore -m pip install --upgrade pip wheel
20+
python -W ignore -m pip install pytest numpy --no-warn-script-location pytest-timeout
21+
- ps: |
22+
Start-FileDownload 'https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip'
23+
7z x eigen-3.3.7.zip -y > $null
24+
$env:CMAKE_INCLUDE_PATH = "eigen-3.3.7;$env:CMAKE_INCLUDE_PATH"
25+
build_script:
26+
- cmake -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
27+
-DCMAKE_CXX_STANDARD=14
28+
-DPYBIND11_WERROR=ON
29+
-DDOWNLOAD_CATCH=ON
30+
-DCMAKE_SUPPRESS_REGENERATION=1
31+
.
32+
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
33+
- cmake --build . --config %CONFIG% --target pytest -- /m /v:m /logger:%MSBuildLogger%
34+
- cmake --build . --config %CONFIG% --target cpptest -- /m /v:m /logger:%MSBuildLogger%
35+
on_failure: if exist "tests\test_cmake_build" type tests\test_cmake_build\*.log*

thirdparty/pybind11/.clang-format

Lines changed: 38 additions & 0 deletions
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+
...

thirdparty/pybind11/.clang-tidy

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
FormatStyle: file
2+
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,
64+
65+
CheckOptions:
66+
- key: modernize-use-equals-default.IgnoreMacros
67+
value: false
68+
- key: performance-for-range-copy.WarnOnAllAutoCopies
69+
value: true
70+
- key: performance-inefficient-string-concatenation.StrictMode
71+
value: true
72+
- key: performance-unnecessary-value-param.AllowedTypes
73+
value: 'exception_ptr$;'
74+
- key: readability-implicit-bool-conversion.AllowPointerConditions
75+
value: true
76+
77+
HeaderFilterRegex: 'pybind11/.*h'
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
parse:
2+
additional_commands:
3+
pybind11_add_module:
4+
flags:
5+
- THIN_LTO
6+
- MODULE
7+
- SHARED
8+
- NO_EXTRAS
9+
- EXCLUDE_FROM_ALL
10+
- SYSTEM
11+
12+
format:
13+
line_width: 99
14+
tab_size: 2
15+
16+
# If an argument group contains more than this many sub-groups
17+
# (parg or kwarg groups) then force it to a vertical layout.
18+
max_subgroups_hwrap: 2
19+
20+
# If a positional argument group contains more than this many
21+
# arguments, then force it to a vertical layout.
22+
max_pargs_hwrap: 6
23+
24+
# If a cmdline positional group consumes more than this many
25+
# lines without nesting, then invalidate the layout (and nest)
26+
max_rows_cmdline: 2
27+
separate_ctrl_name_with_space: false
28+
separate_fn_name_with_space: false
29+
dangle_parens: false
30+
31+
# If the trailing parenthesis must be 'dangled' on its on
32+
# 'line, then align it to this reference: `prefix`: the start'
33+
# 'of the statement, `prefix-indent`: the start of the'
34+
# 'statement, plus one indentation level, `child`: align to'
35+
# the column of the arguments
36+
dangle_align: prefix
37+
# If the statement spelling length (including space and
38+
# parenthesis) is smaller than this amount, then force reject
39+
# nested layouts.
40+
min_prefix_chars: 4
41+
42+
# If the statement spelling length (including space and
43+
# parenthesis) is larger than the tab width by more than this
44+
# amount, then force reject un-nested layouts.
45+
max_prefix_chars: 10
46+
47+
# If a candidate layout is wrapped horizontally but it exceeds
48+
# this many lines, then reject the layout.
49+
max_lines_hwrap: 2
50+
51+
line_ending: unix
52+
53+
# Format command names consistently as 'lower' or 'upper' case
54+
command_case: canonical
55+
56+
# Format keywords consistently as 'lower' or 'upper' case
57+
# unchanged is valid too
58+
keyword_case: 'upper'
59+
60+
# A list of command names which should always be wrapped
61+
always_wrap: []
62+
63+
# If true, the argument lists which are known to be sortable
64+
# will be sorted lexicographically
65+
enable_sort: true
66+
67+
# If true, the parsers may infer whether or not an argument
68+
# list is sortable (without annotation).
69+
autosort: false
70+
71+
# Causes a few issues - can be solved later, possibly.
72+
markup:
73+
enable_markup: false
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
template <op_id id, op_type ot, typename L = undefined_t, typename R = undefined_t>
2+
template <typename ThisT>
3+
auto &this_ = static_cast<ThisT &>(*this);
4+
if (load_impl<ThisT>(temp, false)) {
5+
ssize_t nd = 0;
6+
auto trivial = broadcast(buffers, nd, shape);
7+
auto ndim = (size_t) nd;
8+
int nd;
9+
ssize_t ndim() const { return detail::array_proxy(m_ptr)->nd; }
10+
using op = op_impl<id, ot, Base, L_type, R_type>;
11+
template <op_id id, op_type ot, typename L, typename R>
12+
template <detail::op_id id, detail::op_type ot, typename L, typename R, typename... Extra>
13+
class_ &def(const detail::op_<id, ot, L, R> &op, const Extra &...extra) {
14+
class_ &def_cast(const detail::op_<id, ot, L, R> &op, const Extra &...extra) {
15+
@pytest.mark.parametrize("access", ["ro", "rw", "static_ro", "static_rw"])
16+
struct IntStruct {
17+
explicit IntStruct(int v) : value(v){};
18+
~IntStruct() { value = -value; }
19+
IntStruct(const IntStruct &) = default;
20+
IntStruct &operator=(const IntStruct &) = default;
21+
py::class_<IntStruct>(m, "IntStruct").def(py::init([](const int i) { return IntStruct(i); }));
22+
py::implicitly_convertible<int, IntStruct>();
23+
m.def("test", [](int expected, const IntStruct &in) {
24+
[](int expected, const IntStruct &in) {

thirdparty/pybind11/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/*.svg binary
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

0 commit comments

Comments
 (0)