Skip to content

Commit 62e790d

Browse files
committed
Squashed 'pybind11/' changes from 441e777..d3c999c
d3c999c fix: rename `pybind11::module` to `pybind11::module_` (#2489) e37921d refactor: drop mkdoc and update changelog (#2491) fd61f50 feat: setup.py redesign and helpers (#2433) 41aa926 refactor: replace .get_type with type::handle_of (#2492) a4cee36 Add vcpkg installation instructions (#1936) dabbbf3 fix: use OVERRIDE instead of OVERLOAD (#2490) 16f199f Change base parameter type in register_exception and exception constructor from PyObject* to handle (#2467) e7bafc8 style: clang-tidy: default checks and fix bug in iostream deconstruction 4d78640 style: clang-tidy: modernize-use-emplace ce88e94 style: clang-tidy: modernize-use-auto b491b46 style: clang-tidy: modernize-use-equals-default b342c37 style: clang-tidy: modernize-use-using 96e6a8d style: clang-tidy: readability-container-size-empty 5dfbe6f style: clang-tidy: modernize-use-override 8dc31c7 style: clang-tidy: llvm-namespace-comment d65e34d Resolve empty statement warning when using PYBIND11_OVERLOAD_PURE_NAME and PYBIND11_OVERLOAD_PURE (#2325) 9df1383 Stop py::array_t arguments from accepting arrays that do not match the C- or F-contiguity flags (#2484) f12ec00 feat: py::type::of<T>() and py::type::of(h) (#2364) 32bb907 Avoid C-style casts for pointers in docs (#2487) cc982ac fix: allow assignment of time points of resolutions other than that of a system clock (#2481) 38370a8 fix: support NVIDIA-PGI HPC SDK (#2475) fe9ee86 Add check if `str(handle)` correctly converted the object, and throw py::error_already_set if not (bis) (#2477) b47efd3 Use defined for some preprocessor variables that might be undefined (#2476) 621906b fix: support nvcc and test (#2461) fbc7563 Add py::object casting example to embedding docs (#2466) 37f845a ci: disallow some common capitalization mistakes (#2472) 064a03a main CMakeLists.txt file: be less noisy 36c666f pybind11_add_module(): OPT_SIZE target 3bd0d7a Add note about specifying custom base class for Exceptions. (#2465) ce1a07e fix: use classic extension handling unless otherwise requested (#2462) 0dbda6e feat: py::pos_only (#2459) 44fa79c pytypes: Add Gotchas section about default-constructed wrapper types and py::none() (#2362) 72b06b8 ci: Eigen moved 4c36fb7 [DOC] avoid C++ types in docstrings (#2441) 3a89bff ci: harden chrono test, mark another macos 4.9 dev failure (#2448) fb0a3a0 Fix broken README link (#2449) 3c061f2 Fixing `pybind11::bytes()` ambiguous conversion issue. 6a19278 Fix bug roundtripping datetime.time objects after midnight in eastern hemisphere timezones (#2417) (#2438) 1abc4a9 fix: doc typo, drop second use of 'without' (#2439) 9b8cb02 fix: respect PYTHON_VERSION if set in classic mode (#2414) 03b3d59 tests: fix CI by including <algorithm> to stop MSVC from complaining about std::count_if in tests/test_sequences_and_iterators.cpp (#2435) a2bb297 Throw exception on returning a unique_ptr or shared_ptr nullptr (or any other holder type) from py::init, rather than crashing (#2430) 5b59b7b ci: gha annotations (#2427) 43f390a Add note that VS2017 requires /permissive- to build in C++17 mode (#2431) b3d8fec Adapt code example in advanced/classes.rst to new handling of forgetting to call the superclass __init__ (#2429) 4493751 Fix new-style __init__ usage in numpy docs (#2426) b886369 Improve documentation of Python and C++ exceptions (#2408) c58f7b7 fix: reduce target collision in add_submodule mode (#2423) 56df3c4 fix: a couple more places where pybind11 is missing 11 (#2421) d4d7ef5 Update pybind11Tools.cmake (#2419) f31df73 docs: move CONTRIBUTING (#2402) 2fa1843 docs: pin versions for readthedocs a6887b6 docs: update changelog and versionadded 110e6c1 ci: reduce flakiness a little (#2418) 24dffe4 fix: PYBIND11_MASTER_PROJECT always ON (#2412) 04fdc44 tests: avoid putting build products into source directory (#2353) 1729aae feat: new FindPython support (#2370) 69821d9 Disable testing when using BUILD_TESTING (#1682) cf0a645 fix: throwing repr caused a segfault (#2389) 7dd2bdb docs: fix typo (#2405) 6404099 docs: contrib/issue templates (#2377) 4d9024e tests: cleanup and ci hardening (#2397) 3618bea Add and document py::error_already_set::discard_as_unraisable() a876aac tests: loosen test, not valid on some systems (#2399) cd85699 Using recently added `pytest.PY2` instead of `str is bytes`. (#2396) 5a3ff72 ci: Remove "Setup Boost (macOS)" step (#2395) ebdd0d3 tests: Consolidate version (2 vs. 3) and platform (CPython vs. PyPy) checks (#2376) cba4a98 ci: include Boost (#2393) fb042d6 Fix warning C26817 on copying in `for (auto vh : value_and_holder(...))` (#2382) 2e2de8c fix: add missing signature (#2363) 830adda Modified Vector STL bind initialization from a buffer type with optimization for simple arrays (#2298) 1534e17 ci: include Python 3.9 RC1 (#2387) f7abac6 fix: boost's include dir was listed first (#2384) 1732046 Adding tests specifically to exercise pybind11::str::raw_str. (#2366) 6f3470f Add robotpy-build to list of tools (#2359) 0af7fe6 fix: typo in pybind11_add_module (#2374) 227170d fix: better handling of PYBIND11_CPP_STANDARD c664d55 ci: better output / more config ed6de12 format: include .in files da803eb fix: duplicate target names removed df11597 chore: cleanup 3e448c0 Enable py::ellipsis on Python 2 (#2360) 1caf1d0 fix: check list validity and add missing file (#2352) 4d90f1a Add error_scope to py::class_::dealloc() to protect destructor calls (#2342) b804724 fix: uninstall cleanup (#2346) 6f6e939 feat: add uninstall target for CMake (#2265) 94db5c5 format: apply cmake-format e2a9689 format: add cmake-format to pre-commit 1651c32 update: address review points f64d5aa fix: typo for warning on C++17, support Win + 2.7 1b92cd1 fix: address review points from @YannickJadoul 6ec1775 feat: drop CMake 3.6 and below, modernize CMake 1491c94 ci: cmake Configure test (#2327) 8e40e38 cast pointer to std::tuple and std::pair (#2334) c51b3f4 ci: change caching a632486 ci: Windows 2016 test 88b3e5c ci: nicer naming scheme ff39ad3 ci: include scipy for tests 249a13b ci: move docs check to GHA e450ea0 ci: add docker build to GHA 2fbbd51 ci: add gcc 2ee1bcd ci: add GHA badge 1b880df ci: download EIGEN 9521bc5 ci: drop parts from Travis 7806905 ci: trim down Appveyor 7b067cc Set __hash__ to None for types that defines __eq__, but not __hash__ (#2291) aab7013 ci: cache, build wheels on macOS PyPy3 5927c58 chore: update Catch 4470671 fix: too many braces on clang 3.6 1f53c37 fix: C++17 mode on Clang may error e428a7f ci: fix clang warnings 6a80171 ci: Add clang builds & C++17 7e0a4fb Fix for #2168 (#2299) 2819ce6 Avoid attr("__repr__") in initialize_generic (#2317) 6f3e5e3 ci: keep travis from running twice 5c936d4 refactor: issue fixed upstream 8b0ccf7 style: adding pre-commit check-style.sh b16347e ci: enable GHA testing 73dc978 style: avoid adding virtual environment directories a59c6de test: allow MSVC/Xcode to run the embed test 49007b7 test: fix warning/error on Python 2 in 14/17 mode 3d20b73 test: pass through C++ std for cmake test ef057f1 test: support pypy2 7.3 134a2ec Add `.git` suffix to URL because only GitHub itself works without it. (#2319) git-subtree-dir: pybind11 git-subtree-split: d3c999c774d15602eabe4141c2b29788d72dfcf3
1 parent 0c6fe6d commit 62e790d

File tree

145 files changed

+6247
-2413
lines changed

Some content is hidden

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

145 files changed

+6247
-2413
lines changed

.appveyor.yml

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,37 @@
11
version: 1.0.{build}
22
image:
3-
- Visual Studio 2017
43
- Visual Studio 2015
54
test: off
65
skip_branch_with_pr: true
76
build:
87
parallel: true
98
platform:
10-
- x64
119
- x86
1210
environment:
1311
matrix:
1412
- PYTHON: 36
15-
CPP: 14
1613
CONFIG: Debug
1714
- PYTHON: 27
18-
CPP: 14
1915
CONFIG: Debug
20-
- CONDA: 36
21-
CPP: latest
22-
CONFIG: Release
23-
matrix:
24-
exclude:
25-
- image: Visual Studio 2015
26-
platform: x86
27-
- image: Visual Studio 2015
28-
CPP: latest
29-
- image: Visual Studio 2017
30-
CPP: latest
31-
platform: x86
3216
install:
3317
- ps: |
34-
if ($env:PLATFORM -eq "x64") { $env:CMAKE_ARCH = "x64" }
35-
if ($env:APPVEYOR_JOB_NAME -like "*Visual Studio 2017*") {
36-
$env:CMAKE_GENERATOR = "Visual Studio 15 2017"
37-
$env:CMAKE_INCLUDE_PATH = "C:\Libraries\boost_1_64_0"
38-
$env:CXXFLAGS = "-permissive-"
39-
} else {
40-
$env:CMAKE_GENERATOR = "Visual Studio 14 2015"
41-
}
42-
if ($env:PYTHON) {
43-
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
44-
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
45-
python -W ignore -m pip install --upgrade pip wheel
46-
python -W ignore -m pip install pytest numpy --no-warn-script-location
47-
} elseif ($env:CONDA) {
48-
if ($env:CONDA -eq "27") { $env:CONDA = "" }
49-
if ($env:PLATFORM -eq "x64") { $env:CONDA = "$env:CONDA-x64" }
50-
$env:PATH = "C:\Miniconda$env:CONDA\;C:\Miniconda$env:CONDA\Scripts\;$env:PATH"
51-
$env:PYTHONHOME = "C:\Miniconda$env:CONDA"
52-
conda --version
53-
conda install -y -q pytest numpy scipy
54-
}
18+
$env:CMAKE_GENERATOR = "Visual Studio 14 2015"
19+
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
20+
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
21+
python -W ignore -m pip install --upgrade pip wheel
22+
python -W ignore -m pip install pytest numpy --no-warn-script-location
5523
- ps: |
56-
Start-FileDownload 'http://bitbucket.org/eigen/eigen/get/3.3.3.zip'
57-
7z x 3.3.3.zip -y > $null
58-
$env:CMAKE_INCLUDE_PATH = "eigen-eigen-67e894c6cd8f;$env:CMAKE_INCLUDE_PATH"
24+
Start-FileDownload 'https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip'
25+
7z x eigen-3.3.7.zip -y > $null
26+
$env:CMAKE_INCLUDE_PATH = "eigen-3.3.7;$env:CMAKE_INCLUDE_PATH"
5927
build_script:
6028
- cmake -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
61-
-DPYBIND11_CPP_STANDARD=/std:c++%CPP%
29+
-DCMAKE_CXX_STANDARD=14
6230
-DPYBIND11_WERROR=ON
6331
-DDOWNLOAD_CATCH=ON
6432
-DCMAKE_SUPPRESS_REGENERATION=1
6533
.
6634
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
6735
- cmake --build . --config %CONFIG% --target pytest -- /m /v:m /logger:%MSBuildLogger%
6836
- cmake --build . --config %CONFIG% --target cpptest -- /m /v:m /logger:%MSBuildLogger%
69-
- if "%CPP%"=="latest" (cmake --build . --config %CONFIG% --target test_cmake_build -- /m /v:m /logger:%MSBuildLogger%)
7037
on_failure: if exist "tests\test_cmake_build" type tests\test_cmake_build\*.log*

.clang-tidy

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FormatStyle: file
2+
3+
Checks: '
4+
llvm-namespace-comment,
5+
modernize-use-override,
6+
readability-container-size-empty,
7+
modernize-use-using,
8+
modernize-use-equals-default,
9+
modernize-use-auto,
10+
modernize-use-emplace,
11+
'
12+
13+
HeaderFilterRegex: 'pybind11/.*h'

.cmake-format.yaml

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

0 commit comments

Comments
 (0)