Skip to content

Merging branch 'master' into branch 'smart_holder'. #3197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f4f4632
[pre-commit.ci] pre-commit autoupdate (#3167)
pre-commit-ci[bot] Aug 3, 2021
c0756cc
fix: func_handle for rule of two (#3169)
Skylion007 Aug 3, 2021
a2b78a8
chore: changelog update (#3163)
henryiii Aug 3, 2021
5f34c42
chore: bump to version 2.7.1
henryiii Aug 3, 2021
82adacb
fix: include hex version in bump
henryiii Aug 3, 2021
c30f57d
chore: start development for 2.8.0
henryiii Aug 3, 2021
5f4d725
fix: version number hex
henryiii Aug 3, 2021
1fafd1b
fix: apply simpler expression with fewer workarounds
henryiii Aug 6, 2021
089328f
Revert "fix: apply simpler expression with fewer workarounds"
henryiii Aug 6, 2021
3893f37
maint(clang-tidy): Bugprone enable checks (#3166)
Skylion007 Aug 6, 2021
af70073
Removing GCC -Wunused-but-set-parameter from pragma block at the top …
rwgk Aug 6, 2021
6ac8efe
test_eval: Show example of working closure (#2743)
EricCousineau-TRI Aug 6, 2021
61ee923
Consistent step name "Python tests". (#3180)
rwgk Aug 7, 2021
ff590c1
maint(perf): Optimize Numpy constructor to remove copies by value. (#…
Skylion007 Aug 9, 2021
4c7e509
PYBIND11_NOINLINE-related cleanup. (#3179)
rwgk Aug 9, 2021
0be2ea0
[pre-commit.ci] pre-commit autoupdate (#3185)
pre-commit-ci[bot] Aug 9, 2021
7d3b057
Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3…
rwgk Aug 12, 2021
d6841f6
chore(deps): bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#3196)
dependabot[bot] Aug 13, 2021
9df2f1f
maint(precommit): Apply isort (#3195)
Skylion007 Aug 13, 2021
1bcd94c
Removing last remnants of pragma block at the top of pybind11.h (#3186)
rwgk Aug 14, 2021
8865d28
Automatic part of merging branch 'master' into sh_merge_master.
rwgk Aug 14, 2021
191769c
Automatic isort fixes.
rwgk Aug 14, 2021
68d1aa8
Tracking ci.yml changes from master.
rwgk Aug 14, 2021
e3e1d29
Removing obsolete detail/pragma_warning_block.h
rwgk Aug 14, 2021
617cb65
[Bugfix] Fix errant const methods (#3194)
Skylion007 Aug 14, 2021
e41fb99
clang-tidy fixes (mostly manual) related to PR #3166
rwgk Aug 14, 2021
a0a30c4
Merge branch 'master' into sh_merge_master
rwgk Aug 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FormatStyle: file

Checks: '
*bugprone*,
cppcoreguidelines-init-variables,
clang-analyzer-optin.cplusplus.VirtualCall,
llvm-namespace-comment,
Expand Down Expand Up @@ -43,6 +44,9 @@ readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release,
-bugprone-exception-escape,
-bugprone-reserved-identifier,
-bugprone-unused-raii,
'

CheckOptions:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
run: brew install boost

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Cache wheels
if: runner.os == 'macOS'
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
debug: ${{ matrix.python-debug }}

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Valgrind cache
if: matrix.valgrind
Expand Down Expand Up @@ -446,7 +446,7 @@ jobs:
run: python3 -m pip install --upgrade pip

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Configure
shell: bash
Expand Down Expand Up @@ -595,13 +595,13 @@ jobs:

- name: VAR_BUILD_TYPE 7
if: matrix.centos == 7
run: echo Release > VAR_BUILD_TYPE
run: echo MinSizeRel > VAR_BUILD_TYPE

# Using Debug to avoid segfault that appeared around 2021-06-04,
# Using Release to avoid segfault that appeared around 2021-06-04,
# apparently when the gcc version changed from 8.3 to 8.4.
- name: VAR_BUILD_TYPE 8
if: matrix.centos == 8
run: echo Debug > VAR_BUILD_TYPE
run: echo Release > VAR_BUILD_TYPE

- name: Configure
shell: bash
Expand Down Expand Up @@ -665,7 +665,7 @@ jobs:
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
working-directory: /build-tests

- name: Run tests
- name: Python tests
run: make pytest -j 2
working-directory: /build-tests

Expand Down Expand Up @@ -739,7 +739,7 @@ jobs:
architecture: x86

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Prepare MSVC
uses: ilammy/[email protected]
Expand All @@ -761,7 +761,7 @@ jobs:
- name: Build C++11
run: cmake --build build -j 2

- name: Run tests
- name: Python tests
run: cmake --build build -t pytest

win32-msvc2015:
Expand All @@ -785,7 +785,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Prepare MSVC
uses: ilammy/[email protected]
Expand Down Expand Up @@ -839,7 +839,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Prepare env
run: python -m pip install -r tests/requirements.txt --prefer-binary
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci_sh_def.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
run: brew install boost

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Cache wheels
if: runner.os == 'macOS'
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
debug: ${{ matrix.python-debug }}

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Valgrind cache
if: matrix.valgrind
Expand Down Expand Up @@ -463,7 +463,7 @@ jobs:
run: python3 -m pip install --upgrade pip

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Configure
shell: bash
Expand Down Expand Up @@ -615,13 +615,13 @@ jobs:

- name: VAR_BUILD_TYPE 7
if: matrix.centos == 7
run: echo Release > VAR_BUILD_TYPE
run: echo MinSizeRel > VAR_BUILD_TYPE

# Using Debug to avoid segfault that appeared around 2021-06-04,
# Using Release to avoid segfault that appeared around 2021-06-04,
# apparently when the gcc version changed from 8.3 to 8.4.
- name: VAR_BUILD_TYPE 8
if: matrix.centos == 8
run: echo Debug > VAR_BUILD_TYPE
run: echo Release > VAR_BUILD_TYPE

- name: Configure
shell: bash
Expand Down Expand Up @@ -687,7 +687,7 @@ jobs:
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
working-directory: /build-tests

- name: Run tests
- name: Python tests
run: make pytest -j 2
working-directory: /build-tests

Expand Down Expand Up @@ -761,7 +761,7 @@ jobs:
architecture: x86

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Prepare MSVC
uses: ilammy/[email protected]
Expand All @@ -784,7 +784,7 @@ jobs:
- name: Build C++11
run: cmake --build build -j 2

- name: Run tests
- name: Python tests
run: cmake --build build -t pytest

win32-msvc2015:
Expand All @@ -808,7 +808,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Prepare MSVC
uses: ilammy/[email protected]
Expand Down Expand Up @@ -864,7 +864,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10

- name: Prepare env
run: python -m pip install -r tests/requirements.txt --prefer-binary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_sh_def.yml.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- ci.yml 2021-07-30 11:29:33.606510028 -0700
+++ ci_sh_def.yml 2021-07-30 12:20:02.822962583 -0700
--- ci.yml 2021-08-14 07:51:13.991347947 -0700
+++ ci_sh_def.yml 2021-08-14 08:36:43.163463393 -0700
@@ -1,4 +1,16 @@
-name: CI-SH-AVL
+# PLEASE KEEP THIS GROUP OF FILES IN SYNC AT ALL TIMES:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
# An action for adding a specific version of CMake:
# https://github.com/jwlawson/actions-setup-cmake
- name: Setup CMake ${{ matrix.cmake }}
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.10
with:
cmake-version: ${{ matrix.cmake }}

Expand Down
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ repos:
exclude: ^noxfile.py$

- repo: https://github.com/asottile/pyupgrade
rev: v2.23.0
rev: v2.23.3
hooks:
- id: pyupgrade

- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort

# Black, the code formatter, natively supports pre-commit
- repo: https://github.com/psf/black
rev: 21.7b0
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ set(PYBIND11_HEADERS
include/pybind11/detail/dynamic_raw_ptr_cast_if_possible.h
include/pybind11/detail/init.h
include/pybind11/detail/internals.h
include/pybind11/detail/pragma_warning_block.h
include/pybind11/detail/smart_holder_poc.h
include/pybind11/detail/smart_holder_sfinae_hooks_only.h
include/pybind11/detail/smart_holder_type_casters.h
Expand Down
4 changes: 2 additions & 2 deletions docs/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
import random
import datetime as dt
import os
import random
import time
import datetime as dt

nfns = 4 # Functions per class
nargs = 4 # Arguments per function
Expand Down
49 changes: 47 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,54 @@ Changelog
Starting with version 1.8.0, pybind11 releases use a `semantic versioning
<http://semver.org>`_ policy.

Next version (WIP)
------------------
v2.8.0 (WIP)
------------

* Allow exception translators to be optionally registered local to a module
instead of applying globally across all pybind11 modules. Use
``register_local_exception_translator(ExceptionTranslator&& translator)``
instead of ``register_exception_translator(ExceptionTranslator&&
translator)`` to keep your exception remapping code local to the module.
`#2650 <https://github.com/pybind/pybind11/pull/2650>`_

v2.7.1 (Aug 3, 2021)
---------------------

Minor missing functionality added:

* Allow Python builtins to be used as callbacks in CPython.
`#1413 <https://github.com/pybind/pybind11/pull/1413>`_

Bug fixes:

* Fix regression in CMake Python package config: improper use of absolute path.
`#3144 <https://github.com/pybind/pybind11/pull/3144>`_

* Fix Mingw64 and add to the CI testing matrix.
`#3132 <https://github.com/pybind/pybind11/pull/3132>`_

* Specified UTF8-encoding in setup.py calls of open().
`#3137 <https://github.com/pybind/pybind11/pull/3137>`_

* Add clang-tidy-readability rules to make boolean casts explicit improving
code readability. Also enabled other misc and readability clang-tidy checks.
`#3148 <https://github.com/pybind/pybind11/pull/3148>`_

* Move object in ``.pop()`` for list.
`#3116 <https://github.com/pybind/pybind11/pull/3116>`_

Backend and tidying up:

* Removed and fixed warning suppressions.
`#3127 <https://github.com/pybind/pybind11/pull/3127>`_
`#3129 <https://github.com/pybind/pybind11/pull/3129>`_
`#3135 <https://github.com/pybind/pybind11/pull/3135>`_
`#3141 <https://github.com/pybind/pybind11/pull/3141>`_
`#3142 <https://github.com/pybind/pybind11/pull/3142>`_
`#3150 <https://github.com/pybind/pybind11/pull/3150>`_
`#3152 <https://github.com/pybind/pybind11/pull/3152>`_
`#3160 <https://github.com/pybind/pybind11/pull/3160>`_
`#3161 <https://github.com/pybind/pybind11/pull/3161>`_


v2.7.0 (Jul 16, 2021)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import re
import shlex
import subprocess
import sys
from pathlib import Path
import re

DIR = Path(__file__).parent.resolve()

Expand Down
25 changes: 16 additions & 9 deletions include/pybind11/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ enum op_id : int;
enum op_type : int;
struct undefined_t;
template <op_id id, op_type ot, typename L = undefined_t, typename R = undefined_t> struct op_;
inline void keep_alive_impl(size_t Nurse, size_t Patient, function_call &call, handle ret);
void keep_alive_impl(size_t Nurse, size_t Patient, function_call &call, handle ret);

/// Internal data structure which holds metadata about a keyword argument
struct argument_record {
Expand Down Expand Up @@ -517,23 +517,30 @@ template <size_t Nurse, size_t Patient> struct process_attribute<keep_alive<Nurs
template <typename... Args> struct process_attributes {
static void init(const Args&... args, function_record *r) {
PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(r);
int unused[] = { 0, (process_attribute<typename std::decay<Args>::type>::init(args, r), 0) ... };
ignore_unused(unused);
PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(r);
using expander = int[];
(void) expander{
0, ((void) process_attribute<typename std::decay<Args>::type>::init(args, r), 0)...};
}
static void init(const Args&... args, type_record *r) {
PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(r);
int unused[] = { 0, (process_attribute<typename std::decay<Args>::type>::init(args, r), 0) ... };
ignore_unused(unused);
PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(r);
using expander = int[];
(void) expander{0,
(process_attribute<typename std::decay<Args>::type>::init(args, r), 0)...};
}
static void precall(function_call &call) {
PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(call);
int unused[] = { 0, (process_attribute<typename std::decay<Args>::type>::precall(call), 0) ... };
ignore_unused(unused);
using expander = int[];
(void) expander{0,
(process_attribute<typename std::decay<Args>::type>::precall(call), 0)...};
}
static void postcall(function_call &call, handle fn_ret) {
PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(call, fn_ret);
int unused[] = { 0, (process_attribute<typename std::decay<Args>::type>::postcall(call, fn_ret), 0) ... };
ignore_unused(unused);
PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(fn_ret);
using expander = int[];
(void) expander{
0, (process_attribute<typename std::decay<Args>::type>::postcall(call, fn_ret), 0)...};
}
};

Expand Down
Loading