-
-
Notifications
You must be signed in to change notification settings - Fork 4
119 lines (104 loc) · 4.45 KB
/
numpy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: NumPy
# Controls when the action will run.
on:
workflow_dispatch:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/numpy.yml'
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
- cron: "0 2 * * 0"
jobs:
numpy:
name: NumPy ${{ matrix.os }}/${{ matrix.python_version }}
env:
BITS: 64
NPY_USE_BLAS_ILP64: '1'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python_version: [pypy-3.9-nightly, pypy-3.10-nightly]
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
with:
repository: numpy/numpy
path: repo
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install OpenBLAS (linux, macOS)
run: |
cd repo
python -c "import tools.openblas_support as obs; plat=obs.get_plat(); ilp64=obs.get_ilp64(); print(f'{plat=},{ilp64=}')"
basedir=$(python tools/openblas_support.py)
sudo cp -r $basedir/lib/* /usr/local/lib
sudo cp $basedir/include/* /usr/local/include
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
- name: Install gfortran (macOS)
run: |
source repo/tools/wheels/gfortran_utils.sh
install_gfortran
if: matrix.os == 'macos-latest'
- name: Install requirements and numpy (windows)
shell: powershell
run: |
cd repo
$ErrorActionPreference = "Stop"
# choco install --confirm --no-progress --allow-downgrade rtools --version=4.3.5550
# choco install -y --no-progress unzip
# choco install -y --no-progress --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
echo "RTOOLS43_HOME=c:\rtools43" >> $env:GITHUB_ENV
# mkdir C:/opt/openblas/openblas_dll
# mkdir C:/opt/32/lib/pkgconfig
# mkdir C:/opt/64/lib/pkgconfig
# $target=$(python -c "import tools.openblas_support as obs; plat=obs.get_plat(); ilp64=obs.get_ilp64(); target=f'openblas_{plat}.zip'; obs.download_openblas(target, plat, ilp64);print(target)")
# unzip -o -d c:/opt/ $target
# echo "PKG_CONFIG_PATH=c:\opt\64\lib\pkgconfig" >> $env:GITHUB_ENV
# copy C:/opt/64/bin/*.dll C:/opt/openblas/openblas_dll
# Unfortunately all this doesn't work, so build without openblas
python -m pip install --upgrade pip
python -m pip install ninja
python -m pip install -r test_requirements.txt
python -m pip install . -v -Csetup-args="--vsenv" -Csetup-args="-Dblas=none" -Csetup-args="-Dlapack=none" -Csetup-args="-Dallow-noblas=true"
if: matrix.os == 'windows-latest'
- name: Install NumPy
run: |
cd repo
python -m pip install --upgrade pip
python -m pip install ninja
python -m pip install -r test_requirements.txt
python -m pip install . -v -Csetup-args="--vsenv" -Csetup-args="-Duse-ilp64=true" -Csetup-args="-Dblas-symbol-suffix=64_"
if: matrix.os != 'windows-latest'
- name: 'Copy OpenBLAS DLL to site-packages'
shell: powershell
run: |
# copy from c:/opt/openblas/openblas_dll to numpy/.libs to ensure it can
# get loaded when numpy is imported (no RPATH on Windows)
$target = $(python -c "import sysconfig; print(sysconfig.get_path('platlib'))")
mkdir $target/numpy/.libs
echo "target is $target"
copy C:/opt/openblas/openblas_dll/*.dll $target/numpy/.libs
echo "contents of target"
ls -Path $target/numpy/.libs
echo "contents of _distributor_init.py"
type repo/numpy/_distributor_init.py
# Disable this step
if: matrix.os == 'wwwwindows-latest'
- name: Test
shell: bash
run: |
# do not cd into the repo directory so we can import numpy
cp repo/pytest.ini .
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
pytest --pyargs numpy -rsx