forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-steps-windows.yml
80 lines (71 loc) · 3.35 KB
/
azure-steps-windows.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
steps:
- script: git submodule update --init
displayName: 'Fetch submodules'
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
addToPath: true
architecture: $(PYTHON_ARCH)
- script: python -m pip install --upgrade pip wheel
displayName: 'Install tools'
- script: python -m pip install -r test_requirements.txt
displayName: 'Install dependencies; some are optional to avoid test skips'
- powershell: |
# Note that rtools 42+ does not support 32 bits builds. We dropped testing
# those, but if there's a need to go back on that, use version 4.0.0.20220206
choco install --confirm --no-progress --allow-downgrade rtools --version=4.3.5550
choco install unzip -y
choco install -y --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
choco install ninja
echo "##vso[task.setvariable variable=RTOOLS43_HOME]c:\rtools43"
displayName: 'Install utilities'
- powershell: |
$ErrorActionPreference = "Stop"
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 "##vso[task.setvariable variable=PKG_CONFIG_PATH]c:/opt/64/lib/pkgconfig"
copy C:/opt/64/bin/*.dll C:/opt/openblas/openblas_dll
displayName: 'Download / Install OpenBLAS'
- powershell: |
# Note: ensure the `pip install .` command remains the last one here, to
# avoid "green on failure" issues
python -c "from tools import openblas_support; openblas_support.make_init('numpy')"
If ( Test-Path env:DISABLE_BLAS ) {
python -m pip install . -v -Csetup-args="--vsenv" -Csetup-args="-Dblas=none" -Csetup-args="-Dlapack=none" -Csetup-args="-Dallow-noblas=true"
}
elseif ( Test-Path env:NPY_USE_BLAS_ILP64 ) {
python -m pip install . -v -Csetup-args="--vsenv" -Csetup-args="-Duse-ilp64=true" -Csetup-args="-Dblas-symbol-suffix=64_"
} else {
python -m pip install . -v -Csetup-args="--vsenv"
}
displayName: 'Build NumPy'
- powershell: |
# 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
copy C:/opt/openblas/openblas_dll/*.dll $target/numpy/.libs
displayName: 'Copy OpenBLAS DLL to site-packages'
- script: |
python -m pip install threadpoolctl
python tools/openblas_support.py --check_version
displayName: 'Check OpenBLAS version'
- powershell: |
cd tools # avoid root dir to not pick up source tree
# Get a gfortran onto the path for f2py tests
$env:PATH = "$env:RTOOLS43_HOME\\x86_64-w64-mingw32.static.posix\\bin;$env:PATH"
If ( $env:TEST_MODE -eq "full" ) {
pytest --pyargs numpy -rsx --junitxml=junit/test-results.xml
} else {
pytest --pyargs numpy -m "not slow" -rsx --junitxml=junit/test-results.xml
}
displayName: 'Run NumPy Test Suite'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
testRunTitle: 'Publish test results for Python $(PYTHON_VERSION) $(BITS)-bit $(TEST_MODE) Windows'