diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 60a6219..ae409f4 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -22,37 +22,19 @@ jobs: with: python-version: "3.11" - - name: Install dependencies (macOS) - if: runner.os == 'macOS' - run: | - brew install uv - - name: Cache vcpkg if: runner.os == 'Windows' uses: actions/cache@v4 with: path: C:\\vcpkg\\installed - key: vcpkg-openblas-${{ runner.os }} + key: vcpkg-openblas-${{ runner.os }}-${{ hashFiles('pyproject.toml') }} + restore-keys: | + vcpkg-openblas-${{ runner.os }}- - name: Install cibuildwheel run: python -m pip install --upgrade pip cibuildwheel - name: Build wheels - env: - CIBW_ENVIRONMENT_MACOS: EASYSBA_USE_ACCELERATE=1 EASYSBA_LAPACK_LIBS= - CIBW_BEFORE_ALL_WINDOWS: >- - if not exist C:\vcpkg\vcpkg.exe ( - git clone https://github.com/microsoft/vcpkg.git C:\vcpkg && - C:\vcpkg\bootstrap-vcpkg.bat -disableMetrics - ) && - C:\vcpkg\vcpkg.exe install openblas:x64-windows - CIBW_ENVIRONMENT_WINDOWS: | - EASYSBA_LAPACK_LIBS=openblas - EASYSBA_INCLUDE_DIRS=C:\\vcpkg\\installed\\x64-windows\\include - EASYSBA_LIBRARY_DIRS=C:\\vcpkg\\installed\\x64-windows\\lib - INCLUDE=C:\\vcpkg\\installed\\x64-windows\\include - LIB=C:\\vcpkg\\installed\\x64-windows\\lib - PATH=C:\\vcpkg\\installed\\x64-windows\\bin;{PATH} run: python -m cibuildwheel --output-dir wheelhouse - name: Upload wheels diff --git a/pyproject.toml b/pyproject.toml index c9686db..0af5ef3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,5 +22,12 @@ before-all = "yum -y install openblas-devel lapack-devel" [tool.cibuildwheel.macos] environment = { EASYSBA_USE_ACCELERATE = "1", EASYSBA_LAPACK_LIBS = "" } +# Windows configuration: Uses vcpkg to install OpenBLAS +# The before-all command: +# 1. Checks if vcpkg is already installed at C:\vcpkg +# 2. If not, clones and bootstraps vcpkg +# 3. Installs openblas for x64-windows architecture +# The environment variables point to the vcpkg installation paths for includes and libraries [tool.cibuildwheel.windows] -environment = { EASYSBA_LAPACK_LIBS = "openblas" } +before-all = "powershell -Command \"if (!(Test-Path C:\\vcpkg\\vcpkg.exe)) { git clone https://github.com/microsoft/vcpkg.git C:\\vcpkg; C:\\vcpkg\\bootstrap-vcpkg.bat -disableMetrics }; C:\\vcpkg\\vcpkg.exe install openblas:x64-windows\"" +environment = { EASYSBA_LAPACK_LIBS = "openblas", EASYSBA_INCLUDE_DIRS = "C:\\vcpkg\\installed\\x64-windows\\include", EASYSBA_LIBRARY_DIRS = "C:\\vcpkg\\installed\\x64-windows\\lib" }