Skip to content

Commit 8d6a706

Browse files
authored
Merge pull request #5 from OpenPTV/scipy-openblas
Scipy openblas
2 parents 40be27c + 29e6082 commit 8d6a706

2 files changed

Lines changed: 20 additions & 33 deletions

File tree

.github/workflows/cibuildwheel.yml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,16 @@ jobs:
2222
with:
2323
python-version: "3.11"
2424

25-
- name: Install dependencies (macOS)
26-
if: runner.os == 'macOS'
27-
run: |
28-
brew install uv
25+
- name: Install cibuildwheel and build dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
# Install these on the host so cibuildwheel can resolve the paths
29+
python -m pip install cibuildwheel scipy-openblas delvewheel
2930
30-
- name: Cache vcpkg
31-
if: runner.os == 'Windows'
32-
uses: actions/cache@v4
33-
with:
34-
path: C:\\vcpkg\\installed
35-
key: vcpkg-openblas-${{ runner.os }}
36-
37-
- name: Install cibuildwheel
38-
run: python -m pip install --upgrade pip cibuildwheel
31+
- name: Build wheels
32+
run: python -m cibuildwheel --output-dir wheelhouse
3933

4034
- name: Build wheels
41-
env:
42-
CIBW_ENVIRONMENT_MACOS: EASYSBA_USE_ACCELERATE=1 EASYSBA_LAPACK_LIBS=
43-
# Use the pre-installed vcpkg location for speed and reliability
44-
CIBW_BEFORE_ALL_WINDOWS: >-
45-
vcpkg install openblas:x64-windows
46-
47-
CIBW_ENVIRONMENT_WINDOWS: >-
48-
EASYSBA_LAPACK_LIBS="libopenblas"
49-
EASYSBA_INCLUDE_DIRS="C:/vcpkg/installed/x64-windows/include"
50-
EASYSBA_LIBRARY_DIRS="C:/vcpkg/installed/x64-windows/lib"
51-
INCLUDE="C:/vcpkg/installed/x64-windows/include;$INCLUDE"
52-
LIB="C:/vcpkg/installed/x64-windows/lib;$LIB"
5335
run: python -m cibuildwheel --output-dir wheelhouse
5436

5537
- name: Upload wheels

pyproject.toml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ dependencies = ["numpy>=1.20"]
1414
build-frontend = "build"
1515
skip = "*-musllinux* *-win32"
1616
test-skip = "*"
17+
18+
# Default environment for Linux
1719
environment = { EASYSBA_LAPACK_LIBS = "openblas" }
1820

1921
[tool.cibuildwheel.linux]
@@ -22,14 +24,17 @@ before-all = "yum -y install openblas-devel lapack-devel"
2224
[tool.cibuildwheel.macos]
2325
environment = { EASYSBA_USE_ACCELERATE = "1", EASYSBA_LAPACK_LIBS = "" }
2426

25-
# [tool.cibuildwheel.windows]
26-
# environment = { EASYSBA_LAPACK_LIBS = "openblas" }
27-
2827
[tool.cibuildwheel.windows]
29-
# Install delvewheel to bundle the DLL into the wheel
30-
before-build = "pip install delvewheel"
31-
repair-wheel-command = "delvewheel repair --add-path C:\\vcpkg\\installed\\x64-windows\\bin -w {dest_dir} {wheel}"
28+
# We already installed these on the host, but we install them in the
29+
# build venv as well to be safe for the repair step.
30+
before-build = "pip install scipy-openblas delvewheel"
3231

3332
[tool.cibuildwheel.windows.environment]
34-
# Match the filename vcpkg actually produces: libopenblas
35-
EASYSBA_LAPACK_LIBS = "libopenblas"
33+
EASYSBA_LAPACK_LIBS = "openblas"
34+
# These $(...) commands will now work because scipy-openblas is on the host
35+
INCLUDE = "$(python -c \"import scipy_openblas; print(scipy_openblas.get_include_dir())\");$INCLUDE"
36+
LIB = "$(python -c \"import scipy_openblas; print(scipy_openblas.get_lib_dir())\");$LIB"
37+
38+
[tool.cibuildwheel.windows.repair-wheel-command]
39+
# Use the repair-wheel-command to bundle the DLL
40+
repair-wheel-command = "python -c \"import scipy_openblas, subprocess, sys; subprocess.check_call(['delvewheel', 'repair', '--add-path', scipy_openblas.get_lib_dir(), '-w', sys.argv[1], sys.argv[2]])\" {dest_dir} {wheel}"

0 commit comments

Comments
 (0)