diff --git a/.github/workflows/ci_sh_def.yml b/.github/workflows/ci_sh_def.yml index ad016a2b5..6a8eed004 100644 --- a/.github/workflows/ci_sh_def.yml +++ b/.github/workflows/ci_sh_def.yml @@ -22,6 +22,13 @@ on: - smart_holder - v* +concurrency: + group: test-${{ github.ref }} + cancel-in-progress: true + +env: + PIP_ONLY_BINARY: numpy + jobs: # This is the "main" test suite, which tests a large number of different # versions of default compilers and Python versions in GitHub Actions. @@ -31,13 +38,14 @@ jobs: matrix: runs-on: [ubuntu-latest, windows-latest, macos-latest] python: - - 2.7 - - 3.5 - - 3.6 - - 3.9 - - 3.10-dev - - pypy2 - - pypy3 + - '2.7' + - '3.5' + - '3.6' + - '3.9' + - '3.10' + # - '3.11-dev' + - 'pypy-3.7-v7.3.5' + # - 'pypy-3.8' # Items in here will either be added to the build matrix (if not # present), or add new keys to an existing matrix element if all the @@ -55,18 +63,8 @@ jobs: python: 3.6 args: > -DPYBIND11_FINDPYTHON=ON - - # These items will be removed from the build matrix, keys must match. - exclude: - # Currently 32bit only, and we build 64bit - - runs-on: windows-latest - python: pypy2 - - runs-on: windows-latest - python: pypy3 - - # TODO: PyPy2 7.3.3 segfaults, while 7.3.2 was fine. - - runs-on: ubuntu-latest - python: pypy2 + - runs-on: macos-latest + python: pypy-2.7 name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}" runs-on: ${{ matrix.runs-on }} @@ -102,7 +100,8 @@ jobs: key: ${{ runner.os }}-pip-${{ matrix.python }}-x64-${{ hashFiles('tests/requirements.txt') }} - name: Prepare env - run: python -m pip install -r tests/requirements.txt --prefer-binary + run: | + python -m pip install -r tests/requirements.txt - name: Setup annotations on Linux if: runner.os == 'Linux' @@ -127,7 +126,7 @@ jobs: - name: C++11 tests # TODO: Figure out how to load the DLL on Python 3.8+ - if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10-dev'))" + if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10' || matrix.python == '3.11-dev' || matrix.python == 'pypy-3.8'))" run: cmake --build . --target cpptest -j 2 - name: Interface test C++11 @@ -156,7 +155,7 @@ jobs: - name: C++ tests # TODO: Figure out how to load the DLL on Python 3.8+ - if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10-dev'))" + if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10' || matrix.python == '3.11-dev' || matrix.python == 'pypy-3.8'))" run: cmake --build build2 --target cpptest # Third build - C++17 mode with unstable ABI @@ -208,11 +207,12 @@ jobs: fail-fast: false matrix: include: - - python-version: 3.9 + # TODO: Fails on 3.10, investigate + - python-version: "3.9" python-debug: true valgrind: true - - python-version: 3.10-dev - python-debug: false + # - python-version: "3.11-dev" + # python-debug: false name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64" runs-on: ubuntu-latest @@ -256,7 +256,8 @@ jobs: sudo apt-get install libc6-dbg # Needed by Valgrind - name: Prepare env - run: python -m pip install -r tests/requirements.txt --prefer-binary + run: | + python -m pip install -r tests/requirements.txt - name: Configure run: > @@ -537,7 +538,7 @@ jobs: - name: Install dependencies run: | set +e; source /opt/intel/oneapi/setvars.sh; set -e - python3 -m pip install -r tests/requirements.txt --prefer-binary + python3 -m pip install -r tests/requirements.txt - name: Configure C++11 run: | @@ -630,7 +631,8 @@ jobs: run: python3 -m pip install --upgrade pip - name: Install dependencies - run: python3 -m pip install cmake -r tests/requirements.txt --prefer-binary + run: | + python3 -m pip install cmake -r tests/requirements.txt - name: VAR_BUILD_TYPE 7 if: matrix.centos == 7 @@ -759,8 +761,7 @@ jobs: - 3.7 - 3.8 - 3.9 - - pypy3 - # TODO: fix hang on pypy2 + - pypy-3.6 include: - python: 3.9 @@ -789,7 +790,8 @@ jobs: arch: x86 - name: Prepare env - run: python -m pip install -r tests/requirements.txt --prefer-binary + run: | + python -m pip install -r tests/requirements.txt # First build - C++11 mode and inplace - name: Configure ${{ matrix.args }} @@ -836,7 +838,8 @@ jobs: toolset: 14.0 - name: Prepare env - run: python -m pip install -r tests/requirements.txt --prefer-binary + run: | + python -m pip install -r tests/requirements.txt # First build - C++11 mode and inplace - name: Configure @@ -867,13 +870,16 @@ jobs: - 3.7 std: - 14 - args: [ -DCMAKE_CXX_FLAGS="/GR /EHsc /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT" ] include: - python: 2.7 std: 17 args: > -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT" + - python: 3.7 + std: 17 + args: > + -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT" steps: - uses: actions/checkout@v2 @@ -887,7 +893,8 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.11 - name: Prepare env - run: python -m pip install -r tests/requirements.txt --prefer-binary + run: | + python -m pip install -r tests/requirements.txt # First build - C++11 mode and inplace - name: Configure @@ -919,7 +926,8 @@ jobs: - { sys: mingw64, env: x86_64 } - { sys: mingw32, env: i686 } steps: - - uses: msys2/setup-msys2@v2 + # Force version because of https://github.com/msys2/setup-msys2/issues/167 + - uses: msys2/setup-msys2@v2.4.2 with: msystem: ${{matrix.sys}} install: >- diff --git a/.github/workflows/ci_sh_def.yml.patch b/.github/workflows/ci_sh_def.yml.patch index 4bdb2fc21..4eecc4e1e 100644 --- a/.github/workflows/ci_sh_def.yml.patch +++ b/.github/workflows/ci_sh_def.yml.patch @@ -1,5 +1,5 @@ ---- ci.yml 2021-10-11 13:18:34.061740320 -0700 -+++ ci_sh_def.yml 2021-10-11 13:20:02.319713610 -0700 +--- ci.yml 2021-10-26 12:10:34.834324858 -0700 ++++ ci_sh_def.yml 2021-10-26 12:12:26.000136653 -0700 @@ -1,4 +1,16 @@ -name: CI-SH-AVL +# PLEASE KEEP THIS GROUP OF FILES IN SYNC AT ALL TIMES: @@ -18,7 +18,7 @@ on: workflow_dispatch: -@@ -104,6 +116,7 @@ +@@ -103,6 +115,7 @@ -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_STANDARD=11 @@ -26,7 +26,7 @@ ${{ matrix.args }} - name: Build C++11 -@@ -131,6 +144,7 @@ +@@ -130,6 +143,7 @@ -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_STANDARD=17 @@ -34,7 +34,7 @@ ${{ matrix.args }} ${{ matrix.args2 }} -@@ -153,6 +167,7 @@ +@@ -152,6 +166,7 @@ -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_STANDARD=17 @@ -42,7 +42,7 @@ -DPYBIND11_INTERNALS_VERSION=10000000 "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp" ${{ matrix.args }} -@@ -251,6 +266,7 @@ +@@ -252,6 +267,7 @@ -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_STANDARD=17 @@ -50,7 +50,7 @@ - name: Build run: cmake --build build -j 2 -@@ -305,6 +321,7 @@ +@@ -306,6 +322,7 @@ -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} @@ -58,7 +58,7 @@ -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - name: Build -@@ -334,7 +351,8 @@ +@@ -335,7 +352,8 @@ run: apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake git python3-dev python3-pytest python3-numpy - name: Configure @@ -68,7 +68,7 @@ - name: Build run: cmake --build build -j2 --verbose -@@ -414,7 +432,7 @@ +@@ -415,7 +433,7 @@ cmake3 -S . -B build -DDOWNLOAD_CATCH=ON \ -DCMAKE_CXX_STANDARD=11 \ -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \ @@ -77,7 +77,7 @@ -DPYBIND11_TEST_FILTER="test_smart_ptr.cpp;test_virtual_functions.cpp" # Building before installing Pip should produce a warning but not an error -@@ -473,6 +491,7 @@ +@@ -474,6 +492,7 @@ -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} @@ -85,7 +85,7 @@ -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - name: Build -@@ -528,6 +547,7 @@ +@@ -529,6 +548,7 @@ -DDOWNLOAD_CATCH=ON \ -DDOWNLOAD_EIGEN=OFF \ -DCMAKE_CXX_STANDARD=11 \ @@ -93,7 +93,7 @@ -DCMAKE_CXX_COMPILER=$(which icpc) \ -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") -@@ -560,6 +580,7 @@ +@@ -561,6 +581,7 @@ -DDOWNLOAD_CATCH=ON \ -DDOWNLOAD_EIGEN=OFF \ -DCMAKE_CXX_STANDARD=17 \ @@ -101,7 +101,7 @@ -DCMAKE_CXX_COMPILER=$(which icpc) \ -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") -@@ -631,6 +652,7 @@ +@@ -633,6 +654,7 @@ -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DCMAKE_CXX_STANDARD=11 @@ -109,7 +109,7 @@ -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - name: Build -@@ -681,6 +703,7 @@ +@@ -683,6 +705,7 @@ cmake ../pybind11-tests -DDOWNLOAD_CATCH=ON -DPYBIND11_WERROR=ON @@ -117,7 +117,7 @@ -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") working-directory: /build-tests -@@ -776,6 +799,7 @@ +@@ -778,6 +801,7 @@ -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON @@ -125,7 +125,7 @@ ${{ matrix.args }} - name: Build C++11 run: cmake --build build -j 2 -@@ -822,6 +846,7 @@ +@@ -825,6 +849,7 @@ -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON @@ -133,22 +133,21 @@ - name: Build C++14 run: cmake --build build -j 2 -@@ -842,12 +867,13 @@ - - 3.7 - std: - - 14 -+ args: [ -DCMAKE_CXX_FLAGS="/GR /EHsc /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT" ] - - include: +@@ -850,11 +875,11 @@ - python: 2.7 std: 17 args: > - -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR" ++ -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT" + - python: 3.7 + std: 17 + args: > +- -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR" + -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR /DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT" steps: - uses: actions/checkout@v2 -@@ -914,7 +940,7 @@ +@@ -923,7 +948,7 @@ - name: Configure C++11 # LTO leads to many undefined reference like # `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&) @@ -157,7 +156,7 @@ - name: Build C++11 run: cmake --build build -j 2 -@@ -932,7 +958,7 @@ +@@ -941,7 +966,7 @@ run: git clean -fdx - name: Configure C++14 @@ -166,7 +165,7 @@ - name: Build C++14 run: cmake --build build2 -j 2 -@@ -950,7 +976,7 @@ +@@ -959,7 +984,7 @@ run: git clean -fdx - name: Configure C++17