forked from scikit-image/scikit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
168 lines (140 loc) · 4.93 KB
/
azure-pipelines.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# Azure Pipelines configuration file for Continuous Integration
# for building the package and running the tests under Windows.
jobs:
- job: 'Default'
pool:
vmImage: 'vs2017-win2016'
strategy:
maxParallel: 10
matrix:
Python37:
PYTHON_VERSION: '3.7'
ARCH: 'x86'
PIP_FLAGS: ''
Python37-x64:
PYTHON_VERSION: '3.7'
ARCH: 'x64'
PIP_FLAGS: ''
TEST_EXAMPLES: 'true'
Python38:
PYTHON_VERSION: '3.8'
ARCH: 'x86'
PIP_FLAGS: ''
Python38-x64:
PYTHON_VERSION: '3.8'
ARCH: 'x64'
PIP_FLAGS: ''
TEST_EXAMPLES: 'true'
BUILD_DOCS: 'true'
# build pre release packages on Python 3.8 since it has been out long
# enough for wheels to be built for packages that need to be compiled.
Python38-x64-pre:
PYTHON_VERSION: '3.8'
ARCH: 'x64'
PIP_FLAGS: '--pre'
Python39:
PYTHON_VERSION: '3.9'
ARCH: 'x86'
PIP_FLAGS: ''
Python39-x64:
PYTHON_VERSION: '3.9'
ARCH: 'x64'
PIP_FLAGS: ''
# NOTE(honles): winpty is required by one of the doc dependencies,
# but does not provide a wheel for Python 3.9
# TEST_EXAMPLES: 'true'
continueOnError: false
timeoutInMinutes: 60
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(PYTHON_VERSION)'
architecture: '$(ARCH)'
name: python
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Update pip
$PYTHON -m pip install -U pip setuptools wheel
# Check that we have the expected version and architecture for Python
$PYTHON --version
$PYTHON -m pip --version
$PYTHON -c "import struct; print('Void pointer width is', struct.calcsize('P') * 8)"
$PYTHON -m pip list
# Install the build and runtime dependencies of the project
$PYTHON -m pip install ${PIP_FLAGS} -r requirements/build.txt
# Disable C99 complex if PyWavelets needs to be built from source.
# The compiler used will be MSVC, but C99 may be detected improperly
USE_C99_COMPLEX=0 $PYTHON -m pip install ${PIP_FLAGS} -r requirements/default.txt
$PYTHON -m pip list
displayName: 'Pre-installation'
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Compile the package and build the wheel
$PYTHON setup.py bdist_wheel
# Install the generated wheel package
ls dist
$PYTHON -m pip install ${PIP_FLAGS} --no-index --find-links dist/ scikit-image
displayName: 'Installation'
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Install the test dependencies
$PYTHON -m pip install ${PIP_FLAGS} -r requirements/test.txt
$PYTHON -m pip list
# Set non-UI Matplotlib backend
cd ${AGENT_BUILDDIRECTORY} # D:\a\1
echo "backend : Agg" > matplotlibrc
displayName: 'Pre-testing'
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Change the working directory in order to run the tests
# on the installed version of skimage
cd ${AGENT_BUILDDIRECTORY} # D:\a\1
# Show the info about the installed scikit-image
$PYTHON -c "import skimage; print(skimage.__path__)"
# Force matplotlib to use the prepared config
export MATPLOTLIBRC=${AGENT_BUILDDIRECTORY}
# Run unit tests with pytest
# We don't test docstring examples (--doctest-modules) on
# Windows due to inconsistent ndarray formatting in `numpy`.
# For more details, see https://github.com/numpy/numpy/issues/13468
export TEST_ARGS="-v --cov=skimage"
$PYTHON -m pytest ${TEST_ARGS} --pyargs skimage
displayName: 'Package testing'
- bash: |
set -ex
export PYTHON="$(python.pythonLocation)\\python.exe"
# Install the doc dependencies
$PYTHON -m pip install ${PIP_FLAGS} -r requirements/docs.txt
$PYTHON -m pip list
# Build the documentation
choco install optipng
export SPHINXCACHE=${AGENT_BUILDDIRECTORY}/.cache/sphinx
export SPHINXOPTS=-W
make -C doc html
condition: eq(variables['BUILD_DOCS'], 'true')
displayName: 'Documentation testing'
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Install the doc dependencies
$PYTHON -m pip install ${PIP_FLAGS} -r requirements/docs.txt
$PYTHON -m pip list
# Force matplotlib to use the prepared config
export MATPLOTLIBRC=${AGENT_BUILDDIRECTORY}
# Run example applications
for f in doc/examples/*/*.py; do
$PYTHON "${f}"
if [ $? -ne 0 ]; then
exit 1
fi
done
condition: eq(variables['TEST_EXAMPLES'], 'true')
displayName: 'Gallery testing'
# - bash: |
# # -- Publish the .whl artifacts
# # -- Upload the content of dist/*.whl to a public wheelhouse
# displayName: 'Further consideration'