mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-23 13:45:10 +00:00
Merge branch 'pybind:master' into master
This commit is contained in:
commit
f0d606847a
9
.github/dependabot.yml
vendored
9
.github/dependabot.yml
vendored
@ -7,10 +7,5 @@ updates:
|
|||||||
interval: "daily"
|
interval: "daily"
|
||||||
ignore:
|
ignore:
|
||||||
# Official actions have moving tags like v1
|
# Official actions have moving tags like v1
|
||||||
# that are used, so they don't need updates here
|
- dependency-name: "actions/*"
|
||||||
- dependency-name: "actions/checkout"
|
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
|
||||||
- dependency-name: "actions/setup-python"
|
|
||||||
- dependency-name: "actions/cache"
|
|
||||||
- dependency-name: "actions/upload-artifact"
|
|
||||||
- dependency-name: "actions/download-artifact"
|
|
||||||
- dependency-name: "actions/labeler"
|
|
||||||
|
44
.github/workflows/ci.yml
vendored
44
.github/workflows/ci.yml
vendored
@ -62,10 +62,10 @@ jobs:
|
|||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python }}
|
- name: Setup Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache wheels
|
- name: Cache wheels
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
# This path is specific to macOS - we really only need it for PyPy NumPy wheels
|
# This path is specific to macOS - we really only need it for PyPy NumPy wheels
|
||||||
# See https://github.com/actions/cache/blob/master/examples.md#python---pip
|
# See https://github.com/actions/cache/blob/master/examples.md#python---pip
|
||||||
@ -192,7 +192,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python-version }} (deadsnakes)
|
- name: Setup Python ${{ matrix.python-version }} (deadsnakes)
|
||||||
uses: deadsnakes/action@v2.1.1
|
uses: deadsnakes/action@v2.1.1
|
||||||
@ -205,7 +205,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Valgrind cache
|
- name: Valgrind cache
|
||||||
if: matrix.valgrind
|
if: matrix.valgrind
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
id: cache-valgrind
|
id: cache-valgrind
|
||||||
with:
|
with:
|
||||||
path: valgrind
|
path: valgrind
|
||||||
@ -285,7 +285,7 @@ jobs:
|
|||||||
container: "silkeh/clang:${{ matrix.clang }}"
|
container: "silkeh/clang:${{ matrix.clang }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add wget and python3
|
- name: Add wget and python3
|
||||||
run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev
|
run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev
|
||||||
@ -319,7 +319,7 @@ jobs:
|
|||||||
container: nvidia/cuda:11.0-devel-ubuntu20.04
|
container: nvidia/cuda:11.0-devel-ubuntu20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
# tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
|
# tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
|
||||||
- name: Install 🐍 3
|
- name: Install 🐍 3
|
||||||
@ -343,7 +343,7 @@ jobs:
|
|||||||
# container: centos:8
|
# container: centos:8
|
||||||
#
|
#
|
||||||
# steps:
|
# steps:
|
||||||
# - uses: actions/checkout@v2
|
# - uses: actions/checkout@v3
|
||||||
#
|
#
|
||||||
# - name: Add Python 3 and a few requirements
|
# - 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
|
# run: yum update -y && yum install -y git python3-devel python3-numpy python3-pytest make environment-modules
|
||||||
@ -386,7 +386,7 @@ jobs:
|
|||||||
container: centos:7
|
container: centos:7
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add Python 3 and a few requirements
|
- name: Add Python 3 and a few requirements
|
||||||
run: yum update -y && yum install -y epel-release && yum install -y git python3-devel make environment-modules cmake3
|
run: yum update -y && yum install -y epel-release && yum install -y git python3-devel make environment-modules cmake3
|
||||||
@ -447,7 +447,7 @@ jobs:
|
|||||||
container: "gcc:${{ matrix.gcc }}"
|
container: "gcc:${{ matrix.gcc }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add Python 3
|
- name: Add Python 3
|
||||||
run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev
|
run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev
|
||||||
@ -489,7 +489,7 @@ jobs:
|
|||||||
name: "🐍 3 • ICC latest • x64"
|
name: "🐍 3 • ICC latest • x64"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add apt repo
|
- name: Add apt repo
|
||||||
run: |
|
run: |
|
||||||
@ -592,7 +592,7 @@ jobs:
|
|||||||
container: "quay.io/centos/centos:${{ matrix.centos }}"
|
container: "quay.io/centos/centos:${{ matrix.centos }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add Python 3
|
- name: Add Python 3
|
||||||
run: yum update -y && yum install -y python3-devel gcc-c++ make git
|
run: yum update -y && yum install -y python3-devel gcc-c++ make git
|
||||||
@ -635,7 +635,7 @@ jobs:
|
|||||||
container: i386/debian:buster
|
container: i386/debian:buster
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install requirements
|
- name: Install requirements
|
||||||
run: |
|
run: |
|
||||||
@ -678,9 +678,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v3
|
||||||
|
|
||||||
- name: Install Doxygen
|
- name: Install Doxygen
|
||||||
run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04
|
run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04
|
||||||
@ -725,10 +725,10 @@ jobs:
|
|||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python }}
|
- name: Setup Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
architecture: x86
|
architecture: x86
|
||||||
@ -778,10 +778,10 @@ jobs:
|
|||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python }}
|
- name: Setup Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
architecture: x86
|
architecture: x86
|
||||||
@ -826,10 +826,10 @@ jobs:
|
|||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Python ${{ matrix.python }}
|
- name: Setup Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
@ -889,7 +889,7 @@ jobs:
|
|||||||
mingw-w64-${{matrix.env}}-boost
|
mingw-w64-${{matrix.env}}-boost
|
||||||
mingw-w64-${{matrix.env}}-catch
|
mingw-w64-${{matrix.env}}-catch
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Configure C++11
|
- name: Configure C++11
|
||||||
# LTO leads to many undefined reference like
|
# LTO leads to many undefined reference like
|
||||||
|
4
.github/workflows/configure.yml
vendored
4
.github/workflows/configure.yml
vendored
@ -37,10 +37,10 @@ jobs:
|
|||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Python 3.7
|
- name: Setup Python 3.7
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.7
|
||||||
architecture: ${{ matrix.arch }}
|
architecture: ${{ matrix.arch }}
|
||||||
|
6
.github/workflows/format.yml
vendored
6
.github/workflows/format.yml
vendored
@ -20,8 +20,8 @@ jobs:
|
|||||||
name: Format
|
name: Format
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v3
|
||||||
- name: Add matchers
|
- name: Add matchers
|
||||||
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
|
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
|
||||||
- uses: pre-commit/action@v2.0.3
|
- uses: pre-commit/action@v2.0.3
|
||||||
@ -36,7 +36,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: silkeh/clang:12
|
container: silkeh/clang:12
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install requirements
|
- name: Install requirements
|
||||||
run: apt-get update && apt-get install -y python3-dev python3-pytest
|
run: apt-get update && apt-get install -y python3-dev python3-pytest
|
||||||
|
16
.github/workflows/pip.yml
vendored
16
.github/workflows/pip.yml
vendored
@ -24,10 +24,10 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup 🐍 3.6
|
- name: Setup 🐍 3.6
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: 3.6
|
python-version: 3.6
|
||||||
|
|
||||||
@ -46,10 +46,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup 🐍 3.8
|
- name: Setup 🐍 3.8
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
|
|
||||||
@ -69,13 +69,13 @@ jobs:
|
|||||||
run: twine check dist/*
|
run: twine check dist/*
|
||||||
|
|
||||||
- name: Save standard package
|
- name: Save standard package
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: standard
|
name: standard
|
||||||
path: dist/pybind11-*
|
path: dist/pybind11-*
|
||||||
|
|
||||||
- name: Save global package
|
- name: Save global package
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: global
|
name: global
|
||||||
path: dist/pybind11_global-*
|
path: dist/pybind11_global-*
|
||||||
@ -90,10 +90,10 @@ jobs:
|
|||||||
needs: [packaging]
|
needs: [packaging]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v3
|
||||||
|
|
||||||
# Downloads all to directories matching the artifact names
|
# Downloads all to directories matching the artifact names
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v3
|
||||||
|
|
||||||
- name: Publish standard package
|
- name: Publish standard package
|
||||||
uses: pypa/gh-action-pypi-publish@v1.5.0
|
uses: pypa/gh-action-pypi-publish@v1.5.0
|
||||||
|
4
.github/workflows/upstream.yml
vendored
4
.github/workflows/upstream.yml
vendored
@ -19,10 +19,10 @@ jobs:
|
|||||||
if: "contains(github.event.pull_request.labels.*.name, 'python dev')"
|
if: "contains(github.event.pull_request.labels.*.name, 'python dev')"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Python 3.11
|
- name: Setup Python 3.11
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: "3.11-dev"
|
python-version: "3.11-dev"
|
||||||
|
|
||||||
|
@ -796,8 +796,9 @@ private:
|
|||||||
for (auto field : attr("fields").attr("items")()) {
|
for (auto field : attr("fields").attr("items")()) {
|
||||||
auto spec = field.cast<tuple>();
|
auto spec = field.cast<tuple>();
|
||||||
auto name = spec[0].cast<pybind11::str>();
|
auto name = spec[0].cast<pybind11::str>();
|
||||||
auto format = spec[1].cast<tuple>()[0].cast<dtype>();
|
auto spec_fo = spec[1].cast<tuple>();
|
||||||
auto offset = spec[1].cast<tuple>()[1].cast<pybind11::int_>();
|
auto format = spec_fo[0].cast<dtype>();
|
||||||
|
auto offset = spec_fo[1].cast<pybind11::int_>();
|
||||||
if ((len(name) == 0u) && format.kind() == 'V') {
|
if ((len(name) == 0u) && format.kind() == 'V') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -46,4 +46,4 @@ max-line-length = 120
|
|||||||
show_source = True
|
show_source = True
|
||||||
exclude = .git, __pycache__, build, dist, docs, tools, venv
|
exclude = .git, __pycache__, build, dist, docs, tools, venv
|
||||||
extend-ignore = E203, E722, B950
|
extend-ignore = E203, E722, B950
|
||||||
select = C,E,F,N,W,B,B9
|
extend-select = B9
|
||||||
|
@ -14,6 +14,7 @@ def test_vector(doc):
|
|||||||
|
|
||||||
assert m.cast_bool_vector() == [True, False]
|
assert m.cast_bool_vector() == [True, False]
|
||||||
assert m.load_bool_vector([True, False])
|
assert m.load_bool_vector([True, False])
|
||||||
|
assert m.load_bool_vector(tuple([True, False]))
|
||||||
|
|
||||||
assert doc(m.cast_vector) == "cast_vector() -> List[int]"
|
assert doc(m.cast_vector) == "cast_vector() -> List[int]"
|
||||||
assert doc(m.load_vector) == "load_vector(arg0: List[int]) -> bool"
|
assert doc(m.load_vector) == "load_vector(arg0: List[int]) -> bool"
|
||||||
@ -36,6 +37,7 @@ def test_array(doc):
|
|||||||
lst = m.cast_array()
|
lst = m.cast_array()
|
||||||
assert lst == [1, 2]
|
assert lst == [1, 2]
|
||||||
assert m.load_array(lst)
|
assert m.load_array(lst)
|
||||||
|
assert m.load_array(tuple(lst))
|
||||||
|
|
||||||
assert doc(m.cast_array) == "cast_array() -> List[int[2]]"
|
assert doc(m.cast_array) == "cast_array() -> List[int[2]]"
|
||||||
assert doc(m.load_array) == "load_array(arg0: List[int[2]]) -> bool"
|
assert doc(m.load_array) == "load_array(arg0: List[int[2]]) -> bool"
|
||||||
@ -46,6 +48,7 @@ def test_valarray(doc):
|
|||||||
lst = m.cast_valarray()
|
lst = m.cast_valarray()
|
||||||
assert lst == [1, 4, 9]
|
assert lst == [1, 4, 9]
|
||||||
assert m.load_valarray(lst)
|
assert m.load_valarray(lst)
|
||||||
|
assert m.load_valarray(tuple(lst))
|
||||||
|
|
||||||
assert doc(m.cast_valarray) == "cast_valarray() -> List[int]"
|
assert doc(m.cast_valarray) == "cast_valarray() -> List[int]"
|
||||||
assert doc(m.load_valarray) == "load_valarray(arg0: List[int]) -> bool"
|
assert doc(m.load_valarray) == "load_valarray(arg0: List[int]) -> bool"
|
||||||
|
Loading…
Reference in New Issue
Block a user