Skip to content

Commit

Permalink
Merge branch 'master' into python_multiple_inheritance_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Sep 12, 2023
2 parents 33805e2 + 8c7b8dd commit adb5bad
Show file tree
Hide file tree
Showing 25 changed files with 181 additions and 69 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }} (deadsnakes)
uses: deadsnakes/[email protected]
Expand Down Expand Up @@ -310,7 +310,7 @@ jobs:
container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Add wget and python3
run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev
Expand Down Expand Up @@ -344,7 +344,7 @@ jobs:
container: nvidia/cuda:12.2.0-devel-ubuntu22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
- name: Install 🐍 3
Expand All @@ -368,7 +368,7 @@ jobs:
# container: centos:8
#
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
#
# - name: Add Python 3 and a few requirements
# run: yum update -y && yum install -y git python3-devel python3-numpy python3-pytest make environment-modules
Expand Down Expand Up @@ -413,7 +413,7 @@ jobs:
# tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
DEBIAN_FRONTEND: 'noninteractive'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Add NVHPC Repo
run: |
Expand Down Expand Up @@ -475,7 +475,7 @@ jobs:
container: "gcc:${{ matrix.gcc }}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Add Python 3
run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev
Expand Down Expand Up @@ -535,7 +535,7 @@ jobs:
name: "🐍 3 • ICC latest • x64"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Add apt repo
run: |
Expand Down Expand Up @@ -639,7 +639,13 @@ jobs:
container: "${{ matrix.container }}"

steps:
- uses: actions/checkout@v3
- name: Latest actions/checkout
uses: actions/checkout@v4
if: matrix.container != 'centos:7'

- name: Pin actions/checkout as required for centos:7
uses: actions/checkout@v3
if: matrix.container == 'centos:7'

- name: Add Python 3 (RHEL 7)
if: matrix.container == 'centos:7'
Expand Down Expand Up @@ -687,7 +693,7 @@ jobs:
container: i386/debian:buster

steps:
- uses: actions/checkout@v1 # Required to run inside docker
- uses: actions/checkout@v1 # v1 is required to run inside docker

- name: Install requirements
run: |
Expand Down Expand Up @@ -730,7 +736,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -782,7 +788,7 @@ jobs:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand Down Expand Up @@ -835,7 +841,7 @@ jobs:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand Down Expand Up @@ -883,7 +889,7 @@ jobs:
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand Down Expand Up @@ -961,7 +967,7 @@ jobs:
mingw-w64-${{matrix.env}}-boost
mingw-w64-${{matrix.env}}-catch
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure C++11
# LTO leads to many undefined reference like
Expand Down Expand Up @@ -1032,7 +1038,7 @@ jobs:
run: env

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Clang
uses: egor-tensin/setup-clang@v1
Expand Down Expand Up @@ -1101,7 +1107,7 @@ jobs:
run: env

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Show Clang++ version before brew install llvm
run: clang++ --version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python 3.7
uses: actions/setup-python@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
Expand All @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
container: silkeh/clang:15-bullseye
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install requirements
run: apt-get update && apt-get install -y git python3-dev python3-pytest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup 🐍 3.6
uses: actions/setup-python@v4
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup 🐍 3.8
uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
if: "contains(github.event.pull_request.labels.*.name, 'python dev')"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python 3.12
uses: actions/setup-python@v4
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ repos:

# Ruff, the Python auto-correcting linter written in Rust
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.281
rev: v0.0.287
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]

# Check static types with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.4.1"
rev: "v1.5.1"
hooks:
- id: mypy
args: []
Expand Down Expand Up @@ -84,15 +84,15 @@ repos:

# Also code format the docs
- repo: https://github.com/asottile/blacken-docs
rev: "1.15.0"
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies:
- black==23.3.0 # keep in sync with black hook

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.1"
rev: "v1.5.4"
hooks:
- id: remove-tabs

Expand Down Expand Up @@ -147,7 +147,7 @@ repos:

# PyLint has native support - not always usable, but works for us
- repo: https://github.com/PyCQA/pylint
rev: "v3.0.0a6"
rev: "v3.0.0a7"
hooks:
- id: pylint
files: ^pybind11
2 changes: 1 addition & 1 deletion docs/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def generate_dummy_code_boost(nclasses=10):

for codegen in [generate_dummy_code_pybind11, generate_dummy_code_boost]:
print("{")
for i in range(0, 10):
for i in range(10):
nclasses = 2**i
with open("test.cpp", "w") as f:
f.write(codegen(nclasses))
Expand Down
18 changes: 17 additions & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ class tuple_caster {
}

static constexpr auto name
= const_name("Tuple[") + concat(make_caster<Ts>::name...) + const_name("]");
= const_name("tuple[") + concat(make_caster<Ts>::name...) + const_name("]");

template <typename T>
using cast_op_type = type;
Expand Down Expand Up @@ -882,6 +882,10 @@ struct handle_type_name<bytes> {
static constexpr auto name = const_name(PYBIND11_BYTES_NAME);
};
template <>
struct handle_type_name<buffer> {
static constexpr auto name = const_name("Buffer");
};
template <>
struct handle_type_name<int_> {
static constexpr auto name = const_name("int");
};
Expand All @@ -898,10 +902,22 @@ struct handle_type_name<float_> {
static constexpr auto name = const_name("float");
};
template <>
struct handle_type_name<function> {
static constexpr auto name = const_name("Callable");
};
template <>
struct handle_type_name<handle> {
static constexpr auto name = handle_type_name<object>::name;
};
template <>
struct handle_type_name<none> {
static constexpr auto name = const_name("None");
};
template <>
struct handle_type_name<sequence> {
static constexpr auto name = const_name("Sequence");
};
template <>
struct handle_type_name<args> {
static constexpr auto name = const_name("*args");
};
Expand Down
6 changes: 5 additions & 1 deletion include/pybind11/detail/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
/// further ABI-incompatible changes may be made before the ABI is officially
/// changed to the new version.
#ifndef PYBIND11_INTERNALS_VERSION
# if PY_VERSION_HEX >= 0x030C0000
# if PY_VERSION_HEX >= 0x030C0000 || defined(_MSC_VER)
// Version bump for Python 3.12+, before first 3.12 beta release.
// Version bump for MSVC piggy-backed on PR #4779. See comments there.
# define PYBIND11_INTERNALS_VERSION 5
# else
# define PYBIND11_INTERNALS_VERSION 4
Expand Down Expand Up @@ -291,9 +292,12 @@ struct type_info {
#endif

/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.
/// On MSVC, changes in _MSC_VER may indicate ABI incompatibility (#2898).
#ifndef PYBIND11_BUILD_ABI
# if defined(__GXX_ABI_VERSION)
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION)
# elif defined(_MSC_VER)
# define PYBIND11_BUILD_ABI "_mscver" PYBIND11_TOSTRING(_MSC_VER)
# else
# define PYBIND11_BUILD_ABI ""
# endif
Expand Down
Loading

0 comments on commit adb5bad

Please sign in to comment.