8000 CI: fix Windows GHA jobs for vendored meson-python and spin · numpy/numpy@924294b · GitHub
[go: up one dir, main page]

Skip to content

Commit 924294b

Browse files
committed
CI: fix Windows GHA jobs for vendored meson-python and spin
1 parent b6d5f67 commit 924294b

File tree

2 files changed

+40
-63
lines changed

2 files changed

+40
-63
lines changed

.github/workflows/windows_clangcl.yml

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
meson:
2121
name: Meson windows build/test
2222
runs-on: windows-2019
23-
# if: "github.repository == 'numpy/numpy'"
23+
if: "github.repository == 'numpy/numpy'"
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@@ -32,14 +32,14 @@ jobs:
3232
with:
3333
python-version: ${{ env.PYTHON_VERSION }}
3434

35-
- name: Install dependencies
35+
- name: Install build dependencies from PyPI
3636
run: |
37-
pip install -r build_requirements.txt
38-
- name: openblas-libs
37+
pip install spin Cython
38+
39+
- name: Install OpenBLAS and Clang-cl
3940
run: |
40-
# Download and install pre-built OpenBLAS library
41-
# with 32-bit interfaces
42-
# Unpack it in the pkg-config hardcoded path
41+
# Download and install pre-built OpenBLAS library with 32-bit
42+
# interfaces Unpack it in the pkg-config hardcoded path
4343
choco install unzip -y
4444
choco install wget -y
4545
# Install llvm, which contains clang-cl
@@ -48,44 +48,35 @@ jobs:
4848
wget https://anaconda.org/multibuild-wheels-staging/openblas-libs/v0.3.21/download/openblas-v0.3.21-win_amd64-gcc_10_3_0.zip
4949
unzip -d c:\opt openblas-v0.3.21-win_amd64-gcc_10_3_0.zip
5050
echo "PKG_CONFIG_PATH=c:\opt\64\lib\pkgconfig;" >> $env:GITHUB_ENV
51-
- name: meson-configure
52-
run: |
53-
"[binaries]","c = 'clang-cl'","cpp = 'clang-cl'","ar = 'llvm-lib'","c_ld = 'lld-link'","cpp_ld = 'lld-link'" | Out-File $PWD/clang-cl-build.ini -Encoding ascii
54-
meson setup build --prefix=$PWD\build-install --native-file=$PWD/clang-cl-build.ini -Ddebug=false --optimization 2 --vsenv
55-
- name: meson-build
56-
run: |
57-
meson compile -C build -v
5851
59-
- name: meson-install
52+
- name: Write native file for Clang-cl binaries
6053
run: |
61-
cd build
62-
meson install --no-rebuild
63-
- name: build-path
54+
# TODO: this job is identical to the one in `windows_meson.yml` aside
55+
# from installing Clang-cl and usage of this .ini file. So merge the
56+
# two and use a matrix'ed CI job run.
57+
"[binaries]","c = 'clang-cl'","cpp = 'clang-cl'","ar = 'llvm-lib'","c_ld = 'lld-link'","cpp_ld = 'lld-link'" | Out-File $PWD/clang-cl-build.ini -Encoding ascii
58+
59+
- name: Install NumPy
6460
run: |
65-
echo "installed_path=$PWD\build-install\Lib\site-packages" >> $env:GITHUB_ENV
66-
- name: post-install
61+
spin build -j2 -- --vsenv --native-file=$PWD/clang-cl-build.ini
62+
63+
- name: Copy OpenBLAS DLL, write _distributor_init.py
6764
run: |
68-
$numpy_path = "${env:installed_path}\numpy"
65+
# Getting the OpenBLAS DLL to the right place so it loads
66+
$installed_path = "$PWD\build-install\usr\Lib\site-packages"
67+
$numpy_path = "${installed_path}\numpy"
6968
$libs_path = "${numpy_path}\.libs"
7069
mkdir ${libs_path}
7170
$ob_path = "C:/opt/64/bin/"
7271
cp $ob_path/*.dll $libs_path
7372
# Write _distributor_init.py to load .libs DLLs.
7473
python -c "from tools import openblas_support; openblas_support.make_init(r'${numpy_path}')"
7574
76-
- name: prep-test
75+
- name: Install test dependencies
7776
run: |
78-
echo "PYTHONPATH=${env:installed_path}" >> $env:GITHUB_ENV
7977
python -m pip install -r test_requirements.txt
8078
python -m pip install threadpoolctl
8179
82-
- name: test
80+
- name: Run test suite
8381
run: |
84-
mkdir tmp
85-
cd tmp
86-
echo "============================================"
87-
python -c "import numpy; print(numpy.show_runtime())"
88-
echo "============================================"
89-
echo "LASTEXITCODE is '$LASTEXITCODE'"
90-
python -c "import numpy, sys; sys.exit(numpy.test(verbose=3) is False)"
91-
echo "LASTEXITCODE is '$LASTEXITCODE'"
82+
spin test

.github/workflows/windows_meson.yml

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,65 +27,51 @@ jobs:
2727
with:
2828
submodules: recursive
2929
fetch-depth: 0
30+
3031
- name: Setup Python
3132
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
3233
with:
3334
python-version: ${{ env.PYTHON_VERSION }}
3435

35-
- name: Install dependencies
36+
- name: Install build dependencies from PyPI
3637
run: |
37-
pip install -r build_requirements.txt
38-
- name: openblas-libs
38+
python -m pip install spin Cython
39+
40+
- name: Install OpenBLAS (MacPython build)
3941
run: |
40-
# Download and install pre-built OpenBLAS library
41-
# with 32-bit interfaces
42-
# Unpack it in the pkg-config hardcoded path
42+
# Download and install pre-built OpenBLAS library with 32-bit
43+
# interfaces. Unpack it in the pkg-config hardcoded path
4344
choco install unzip -y
4445
choco install wget -y
4546
choco install -y --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
4647
wget https://anaconda.org/multibuild-wheels-staging/openblas-libs/v0.3.21/download/openblas-v0.3.21-win_amd64-gcc_10_3_0.zip
4748
unzip -d c:\opt openblas-v0.3.21-win_amd64-gcc_10_3_0.zip
4849
echo "PKG_CONFIG_PATH=c:\opt\64\lib\pkgconfig;" >> $env:GITHUB_ENV
49-
- name: meson-configure
50-
run: |
51-
meson setup build --prefix=$PWD\build-install -Ddebug=false --optimization 2 --vsenv
52-
- name: meson-build
53-
run: |
54-
meson compile -C build -v
5550
56-
- name: meson-install
57-
run: |
58-
cd build
59-
meson install --no-rebuild
60-
- name: build-path
51+
- name: Install NumPy
6152
run: |
62-
echo "installed_path=$PWD\build-install\Lib\site-packages" >> $env:GITHUB_ENV
63-
- name: post-install
53+
spin build -j2 -- --vsenv
54+
55+
- name: Copy OpenBLAS DLL, write _distributor_init.py
6456
run: |
65-
$numpy_path = "${env:installed_path}\numpy"
57+
# Getting the OpenBLAS DLL to the right place so it loads
58+
$installed_path = "$PWD\build-install\usr\Lib\site-packages"
59+
$numpy_path = "${installed_path}\numpy"
6660
$libs_path = "${numpy_path}\.libs"
6761
mkdir ${libs_path}
6862
$ob_path = "C:/opt/64/bin/"
6963
cp $ob_path/*.dll $libs_path
7064
# Write _distributor_init.py to load .libs DLLs.
7165
python -c "from tools import openblas_support; openblas_support.make_init(r'${numpy_path}')"
7266
73-
- name: prep-test
67+
- name: Install test dependencies
7468
run: |
75-
echo "PYTHONPATH=${env:installed_path}" >> $env:GITHUB_ENV
7669
python -m pip install -r test_requirements.txt
7770
python -m pip install threadpoolctl
7871
79-
- name: test
72+
- name: Run test suite
8073
run: |
81-
mkdir tmp
82-
cd tmp
83-
echo "============================================"
84-
python -c "import numpy; print(numpy.show_runtime())"
85-
echo "============================================"
86-
echo "LASTEXITCODE is '$LASTEXITCODE'"
87-
python -c "import numpy, sys; sys.exit(numpy.test(verbose=3) is False)"
88-
echo "LASTEXITCODE is '$LASTEXITCODE'"
74+
spin test
8975
9076
msvc_32bit_python_openblas:
9177
name: MSVC, 32-bit Python, no BLAS

0 commit comments

Comments
 (0)
0