From 1c50f70ca40be075f1249822edeb995fd36e6dd3 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 28 Oct 2024 21:56:12 -0400 Subject: [PATCH] Setup MSVC for cibuildwheel --- .github/workflows/python-wheels.yaml | 33 +++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-wheels.yaml b/.github/workflows/python-wheels.yaml index b18b11211..dfa244a98 100644 --- a/.github/workflows/python-wheels.yaml +++ b/.github/workflows/python-wheels.yaml @@ -95,12 +95,13 @@ jobs: strategy: matrix: config: - - {os: "ubuntu-20.04", label: "pyodide", platform: "pyodide"} - - {os: "ubuntu-20.04", label: "linux", platform: "auto"} - - {os: "windows-2019", label: "windows", platform: "auto"} - - {os: "macOS-13", label: "macOS", platform: "auto"} - - {os: "macOS-14", label: "macOS-arm64", platform: "auto"} - - {os: ["self-hosted", "arm"], label: "linux-arm64", platform: "auto"} + - {os: "ubuntu-20.04", label: "pyodide", platform: "pyodide", arch: "auto"} + - {os: "ubuntu-20.04", label: "linux", platform: "auto", arch: "auto"} + - {os: "windows-2019", label: "windows-x86", platform: "auto", arch: "x86"} + - {os: "windows-2019", label: "windows-amd64", platform: "auto", arch: "AMD64"} + - {os: "macOS-13", label: "macOS", platform: "auto", arch: "auto"} + - {os: "macOS-14", label: "macOS-arm64", platform: "auto", arch: "auto"} + - {os: ["self-hosted", "arm"], label: "linux-arm64", platform: "auto", arch: "auto"} steps: - uses: actions/checkout@v4 @@ -109,9 +110,28 @@ jobs: fetch-tags: true - uses: actions/setup-python@v5 + if: matrix.config.arch != 'x86' with: python-version: "3.12" + - name: Setup MSVC (64-bit) + if: matrix.config.arch == 'AMD64' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + + - uses: actions/setup-python@v5 + if: matrix.config.arch == 'x86' + with: + python-version: "3.12" + architecture: x86 + + - name: Setup MSVC (32-bit) + if: matrix.config.arch == 'x86' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x86 + - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.21.1 @@ -127,6 +147,7 @@ jobs: CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: pytest {package}/tests -vv CIBW_PLATFORM: ${{ matrix.config.platform }} + CIBW_ARCHS: ${{ matrix.config.arch }} - uses: actions/upload-artifact@v4 with: