diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 73273365c..d8d1eed8c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,10 +7,5 @@ updates: interval: "daily" ignore: # Official actions have moving tags like v1 - # that are used, so they don't need updates here - - dependency-name: "actions/checkout" - - dependency-name: "actions/setup-python" - - dependency-name: "actions/cache" - - dependency-name: "actions/upload-artifact" - - dependency-name: "actions/download-artifact" - - dependency-name: "actions/labeler" + - dependency-name: "actions/*" + update-types: ["version-update:semver-minor", "version-update:semver-patch"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e018fb7f..aeceaee2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,10 +62,10 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }} @@ -83,7 +83,7 @@ jobs: - name: Cache wheels if: runner.os == 'macOS' - uses: actions/cache@v2 + uses: actions/cache@v3 with: # 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 @@ -192,7 +192,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python ${{ matrix.python-version }} (deadsnakes) uses: deadsnakes/action@v2.1.1 @@ -205,7 +205,7 @@ jobs: - name: Valgrind cache if: matrix.valgrind - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache-valgrind with: path: valgrind @@ -285,7 +285,7 @@ jobs: container: "silkeh/clang:${{ matrix.clang }}" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Add wget and python3 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 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND - name: Install 🐍 3 @@ -343,7 +343,7 @@ jobs: # container: centos:8 # # steps: -# - uses: actions/checkout@v2 +# - uses: actions/checkout@v3 # # - 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 @@ -386,7 +386,7 @@ jobs: container: centos:7 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - 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 @@ -447,7 +447,7 @@ jobs: container: "gcc:${{ matrix.gcc }}" steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Add Python 3 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" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Add apt repo run: | @@ -592,7 +592,7 @@ jobs: container: "quay.io/centos/centos:${{ matrix.centos }}" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Add Python 3 run: yum update -y && yum install -y python3-devel gcc-c++ make git @@ -635,7 +635,7 @@ jobs: container: i386/debian:buster steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Install requirements run: | @@ -678,9 +678,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v3 - name: Install Doxygen 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 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }} architecture: x86 @@ -778,10 +778,10 @@ jobs: runs-on: windows-2019 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }} architecture: x86 @@ -826,10 +826,10 @@ jobs: runs-on: windows-2022 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }} @@ -889,7 +889,7 @@ jobs: mingw-w64-${{matrix.env}}-boost mingw-w64-${{matrix.env}}-catch - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure C++11 # LTO leads to many undefined reference like diff --git a/.github/workflows/configure.yml b/.github/workflows/configure.yml index 55be5bd34..aa2485ac0 100644 --- a/.github/workflows/configure.yml +++ b/.github/workflows/configure.yml @@ -37,10 +37,10 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python 3.7 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: 3.7 architecture: ${{ matrix.arch }} diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 46140fe0c..5eb228a70 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -20,8 +20,8 @@ jobs: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 - name: Add matchers run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json" - uses: pre-commit/action@v2.0.3 @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest container: silkeh/clang:12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install requirements run: apt-get update && apt-get install -y python3-dev python3-pytest diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 7a5443d14..1d9a35604 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -24,10 +24,10 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup 🐍 3.6 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: 3.6 @@ -46,10 +46,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup 🐍 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: 3.8 @@ -69,13 +69,13 @@ jobs: run: twine check dist/* - name: Save standard package - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: standard path: dist/pybind11-* - name: Save global package - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: global path: dist/pybind11_global-* @@ -90,10 +90,10 @@ jobs: needs: [packaging] steps: - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v3 # Downloads all to directories matching the artifact names - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 - name: Publish standard package uses: pypa/gh-action-pypi-publish@v1.5.0 diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 138c9ad29..174dc2496 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -19,10 +19,10 @@ jobs: if: "contains(github.event.pull_request.labels.*.name, 'python dev')" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python 3.11 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: "3.11-dev" diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 586c785ae..eab60300d 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -796,8 +796,9 @@ private: for (auto field : attr("fields").attr("items")()) { auto spec = field.cast(); auto name = spec[0].cast(); - auto format = spec[1].cast()[0].cast(); - auto offset = spec[1].cast()[1].cast(); + auto spec_fo = spec[1].cast(); + auto format = spec_fo[0].cast(); + auto offset = spec_fo[1].cast(); if ((len(name) == 0u) && format.kind() == 'V') { continue; } diff --git a/setup.cfg b/setup.cfg index 11b4fde8f..4fd1e7a6f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,4 +46,4 @@ max-line-length = 120 show_source = True exclude = .git, __pycache__, build, dist, docs, tools, venv extend-ignore = E203, E722, B950 -select = C,E,F,N,W,B,B9 +extend-select = B9 diff --git a/tests/test_stl.py b/tests/test_stl.py index 3dc55230a..975860b85 100644 --- a/tests/test_stl.py +++ b/tests/test_stl.py @@ -14,6 +14,7 @@ def test_vector(doc): assert m.cast_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.load_vector) == "load_vector(arg0: List[int]) -> bool" @@ -36,6 +37,7 @@ def test_array(doc): lst = m.cast_array() assert lst == [1, 2] assert m.load_array(lst) + assert m.load_array(tuple(lst)) assert doc(m.cast_array) == "cast_array() -> List[int[2]]" assert doc(m.load_array) == "load_array(arg0: List[int[2]]) -> bool" @@ -46,6 +48,7 @@ def test_valarray(doc): lst = m.cast_valarray() assert lst == [1, 4, 9] assert m.load_valarray(lst) + assert m.load_valarray(tuple(lst)) assert doc(m.cast_valarray) == "cast_valarray() -> List[int]" assert doc(m.load_valarray) == "load_valarray(arg0: List[int]) -> bool"