diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f2b688a91..d00ee6d27e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1205,3 +1205,134 @@ jobs: - name: Clean directory run: git clean -fdx + + # Clang with MSVC/Windows SDK toolchain + python.org CPython (Windows ARM) + windows_arm_clang_msvc: + if: github.event.pull_request.draft == false + + strategy: + fail-fast: false + matrix: + os: [windows-11-arm] + python: ['3.13'] + + runs-on: "${{ matrix.os }}" + timeout-minutes: 90 + + name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-msvc" + + steps: + - name: Show env + run: env + + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Python ${{ matrix.python }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python }} + architecture: arm64 + + - name: Run pip installs + run: | + python -m pip install --upgrade pip + python -m pip install -r tests/requirements.txt + + - name: Configure CMake + run: > + cmake -G Ninja -S . -B . + -DPYBIND11_WERROR=OFF + -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + -DCMAKE_CXX_COMPILER=clang++ + -DCMAKE_CXX_STANDARD=20 + -DPython_ROOT_DIR="$env:Python_ROOT_DIR" + + - name: Build + run: cmake --build . -j 2 + + - name: Python tests + run: cmake --build . --target pytest -j 2 + + - name: C++ tests + run: cmake --build . --target cpptest -j 2 + + - name: Interface test + run: cmake --build . --target test_cmake_build -j 2 + + - name: Visibility test + run: cmake --build . --target test_cross_module_rtti -j 2 + + # Clang in MSYS2/MinGW-w64 CLANGARM64 toolchain + MSYS2 Python (Windows ARM) + windows_arm_clang_msys2: + if: github.event.pull_request.draft == false + + strategy: + fail-fast: false + matrix: + os: [windows-11-arm] + + runs-on: "${{ matrix.os }}" + timeout-minutes: 90 + + name: "${{ matrix.os }} • clang-msys2" + + defaults: + run: + shell: msys2 {0} + + steps: + - uses: actions/checkout@v6 + with: + submodules: true + + - uses: msys2/setup-msys2@v2 + with: + msystem: CLANGARM64 + update: true + install: | + mingw-w64-clang-aarch64-cmake + mingw-w64-clang-aarch64-clang + mingw-w64-clang-aarch64-ninja + mingw-w64-clang-aarch64-python-pip + mingw-w64-clang-aarch64-python-pytest + mingw-w64-clang-aarch64-python-numpy + + - name: Debug info + run: | + clang++ --version + cmake --version + ninja --version + python --version + + - name: Run pip installs + run: | + python -m pip install --upgrade pip + python -m pip install -r tests/requirements.txt + + - name: Configure CMake + run: >- + cmake -S . -B build + -DPYBIND11_WERROR=OFF + -DDOWNLOAD_CATCH=ON + -DDOWNLOAD_EIGEN=ON + -DCMAKE_CXX_COMPILER=clang++ + -DCMAKE_CXX_STANDARD=20 + -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)") + + - name: Build + run: cmake --build build -j 2 + + - name: Python tests + run: cmake --build build --target pytest -j 2 + + - name: C++ tests + run: PYTHONHOME=/clangarm64 PYTHONPATH=/clangarm64 cmake --build build --target cpptest -j 2 + + - name: Interface test + run: cmake --build build --target test_cmake_build -j 2 + + - name: Visibility test + run: cmake --build build --target test_cross_module_rtti -j 2 diff --git a/tests/requirements.txt b/tests/requirements.txt index 6e3a260b19..41fc9f1439 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -7,8 +7,9 @@ numpy~=2.2.0; python_version=="3.10" and platform_python_implementation=="PyPy" numpy~=1.26.0; platform_python_implementation=="GraalVM" and sys_platform=="linux" numpy~=1.21.5; platform_python_implementation=="CPython" and python_version>="3.8" and python_version<"3.10" numpy~=1.22.2; platform_python_implementation=="CPython" and python_version=="3.10" -numpy~=1.26.0; platform_python_implementation=="CPython" and python_version>="3.11" and python_version<"3.13" -numpy~=2.2.0; platform_python_implementation=="CPython" and python_version=="3.13" +numpy~=1.26.0; platform_python_implementation=="CPython" and python_version>="3.11" and python_version<"3.13" and platform_machine!="ARM64" +numpy~=2.3.0; platform_python_implementation=="CPython" and python_version>="3.11" and platform_machine=="ARM64" +numpy~=2.2.0; platform_python_implementation=="CPython" and python_version=="3.13" and platform_machine!="ARM64" pytest>=6 pytest-timeout scipy~=1.5.4; platform_python_implementation=="CPython" and python_version<"3.10" diff --git a/tests/test_unnamed_namespace_a.py b/tests/test_unnamed_namespace_a.py index fabf1312af..514a81272e 100644 --- a/tests/test_unnamed_namespace_a.py +++ b/tests/test_unnamed_namespace_a.py @@ -5,7 +5,10 @@ from pybind11_tests import unnamed_namespace_a as m from pybind11_tests import unnamed_namespace_b as mb -XFAIL_CONDITION = "not m.defined_WIN32_or__WIN32 and (m.defined___clang__ or m.defined__LIBCPP_VERSION)" +XFAIL_CONDITION = ( + "m.defined__LIBCPP_VERSION or " + "(not m.defined_WIN32_or__WIN32 and m.defined___clang__)" +) XFAIL_REASON = "Known issues: https://github.com/pybind/pybind11/pull/4319"