forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-steps-windows.yml
102 lines (92 loc) · 3.37 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
addToPath: true
architecture: $(PYTHON_ARCH)
condition: not(contains(variables['PYTHON_VERSION'], 'PyPy'))
- powershell: |
# UsePythonVersion only supports pypy3.6, we need 3.8
# https://github.com/microsoft/azure-pipelines-tasks/pull/15553
$url = "https://downloads.python.org/pypy/pypy3.8-v7.3.9-win64.zip"
$output = "pypy.zip"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
echo "downloaded $url to $output"
mkdir pypy3
Expand-Archive $output -DestinationPath pypy3
# move pypy3/pypy-c-*/* pypy3
move pypy3/pypy*/* pypy3
$pypypath = Join-Path (Get-Item .).FullName pypy3
$env:Path = $pypypath + ";" + $env:Path
setx PATH $env:Path
python -mensurepip
echo "##vso[task.prependpath]$pypypath"
condition: contains(variables['PYTHON_VERSION'], 'PyPy')
displayName: "Install PyPy3.8 "
- 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: |
choco install -y rtools
refreshenv
displayName: 'Install rtools'
- powershell: |
$ErrorActionPreference = "Stop"
# Download and get the path to "openblas". We cannot copy it
# to $PYTHON_EXE's directory since that is on a different drive which
# mingw does not like. Instead copy it to a directory and set OPENBLAS,
# since OPENBLAS will be picked up by the openblas discovery
$target = $(python tools/openblas_support.py)
mkdir openblas
echo "Copying $target to openblas/"
cp -r $target/* openblas/
$env:OPENBLAS = $target
displayName: 'Download / Install OpenBLAS'
# NOTE: for Windows builds it seems much more tractable to use runtests.py
# vs. manual setup.py and then runtests.py for testing only
- powershell: |
ls openblas
If ($(BITS) -eq 32) {
$env:CFLAGS = "-m32"
$env:LDFLAGS = "-m32"
$env:PATH = "$env:RTOOLS40_HOME\\mingw32\\bin;$env:PATH"
}
Else
{
$env:PATH = "$env:RTOOLS40_HOME\\mingw64\\bin;$env:PATH"
}
If ( Test-Path env:NPY_USE_BLAS_ILP64 ) {
$env:OPENBLAS64_ = "openblas"
} else {
$env:OPENBLAS = "openblas"
}
python -c "from tools import openblas_support; openblas_support.make_init('numpy')"
python -m pip wheel -v -v -v --no-build-isolation --no-use-pep517 --wheel-dir=dist .
ls dist -r | Foreach-Object {
python -m pip install $_.FullName
}
displayName: 'Build NumPy'
- script: |
python -m pip install threadpoolctl
python tools/openblas_support.py --check_version
displayName: 'Check OpenBLAS version'
- powershell: |
If ($(BITS) -eq 32) {
$env:CFLAGS = "-m32"
$env:LDFLAGS = "-m32"
$env:PATH = "$env:RTOOLS40_HOME\\mingw32\\bin;$env:PATH"
}
Else
{
$env:PATH = "$env:RTOOLS40_HOME\\mingw64\\bin;$env:PATH"
}
python runtests.py -n --show-build-log --mode=$(TEST_MODE) -- -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'