forked from scikit-image/scikit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
192 lines (169 loc) · 5.93 KB
/
tests.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Workflow to build and test wheels
name: Test
on: [push, pull_request]
jobs:
test_skimage_linux:
name: linux-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
runs-on: ubuntu-latest
env:
BUILD_DOCS: 1
TEST_EXAMPLES: 0
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
PIP_FLAGS: [""]
MINIMUM_REQUIREMENTS: [0]
QT: ["PyQt5"]
WITH_PYSIDE: [0]
BUILD_DOCS: [1]
PYTHONOPTIMIZE: [0]
TEST_EXAMPLES: [0]
OPTIONAL_DEPS: [0]
OPTIONS_NAME: ["default"]
INSTALL_FROM_SDIST: [0]
include:
- platform_id: manylinux_x86_64
python-version: 3.7
MINIMUM_REQUIREMENTS: 1
BUILD_DOCS: 0
OPTIONAL_DEPS: 0
# Test miminum requirements (don't build docs there is a problem
# with dask and astropy)
OPTIONS_NAME: "mini-req"
- platform_id: manylinux_x86_64
python-version: 3.7
MINIMUM_REQUIREMENTS: 1
OPTIONAL_DEPS: 1
BUILD_DOCS: 0
OPTIONS_NAME: "mini-req-optional-deps"
- platform_id: manylinux_x86_64
python-version: 3.8
PIP_FLAGS: "--pre"
# test pre-releases
OPTIONS_NAME: "pre"
- platform_id: manylinux_x86_64
python-version: 3.7
BUILD_DOCS: 1
OPTIONAL_DEPS: 1
OPTIONS_NAME: "optional-deps"
- platform_id: manylinux_x86_64
python-version: 3.7
PYTHONOPTIMIZE: 2
BUILD_DOCS: 0
OPTIONS_NAME: "optimize"
- platform_id: manylinux_x86_64
python-version: 3.7
INSTALL_FROM_SDIST: 1
OPTIONS_NAME: "install-from-sdist"
steps:
- name: Checkout scikit-image
uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version}}
- name: Build package
env:
VERSION: ${{ matrix.python-version }}
PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
INSTALL_FROM_SDIST: ${{ matrix.INSTALL_FROM_SDIST }}
run: |
set -ex
source tools/github/before_install.sh
python setup.py sdist
if [[ $INSTALL_FROM_SDIST ]]; then
pip uninstall cython -y;
pip install dist/scikit-image-*.tar.gz;
else
pip install -vv -e .;
fi
- name: Run tests
env:
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
QT: ${{ matrix.QT }}
WITH_PYSIDE: ${{ matrix.WITH_PYSIDE }}
BUILD_DOCS: ${{ matrix.BUILD_DOCS }}
TEST_EXAMPLES: ${{ matrix.TEST_EXAMPLES }}
OPTIONAL_DEPS: ${{ matrix.OPTIONAL_DEPS }}
run: |
echo $PIP_FLAGS
pip install $PIP_FLAGS -r requirements/test.txt
export MPL_DIR=`python -c 'import matplotlib; print(matplotlib.get_configdir())'`
mkdir -p ${MPL_DIR}
touch ${MPL_DIR}/matplotlibrc
if [[ "${OPTIONAL_DEPS}" == "1" ]]; then
pip install -r ./requirements/optional.txt
if [[ "${EXTRA_DEPS}" != "0" ]]; then
# Extra deps need compilation, and it may not always be possible to
# compile them easily on all platforms
pip install -r ./requirements/extras.txt
fi
fi
source tools/github/script.sh
test_skimage_macos:
name: macos-cp${{ matrix.python-version }}
runs-on: macos-latest
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
QT: ["PyQt5"]
BUILD_DOCS: [1]
TEST_EXAMPLES: [0]
OPTIONAL_DEPS: [1]
OPTIONS_NAME: ["default"]
include:
- python-version: 3.7
OPTIONAL_DEPS: 0
- python-version: 3.9
OPTIONAL_DEPS: 0
exclude:
- python-version: 3.7
OPTIONAL_DEPS: 1
# Problem with SimpleITK and py 3.9
- python-version: 3.9
OPTIONAL_DEPS: 1
env:
BUILD_DOCS: 1
TEST_EXAMPLES: 0
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CPPFLAGS: "-Xpreprocessor -fopenmp"
CFLAGS: "-Wno-implicit-function-declaration -I/usr/local/opt/libomp/include"
CXXFLAGS: "-I/usr/local/opt/libomp/include"
LDFLAGS: "-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
steps:
- name: Checkout scikit-image
uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version}}
- name: OSX configuration
run: |
# OpenMP is not present on macOS by default
set -ex
brew install libomp
- name: Build package
run: |
set -ex
source tools/github/before_install.sh
python setup.py sdist
pip install -vv --no-build-isolation -e .;
- name: Run tests
run: |
pip install $PIP_FLAGS -r requirements/test.txt
export MPL_DIR=`python -c 'import matplotlib; print(matplotlib.get_configdir())'`
mkdir -p ${MPL_DIR}
touch ${MPL_DIR}/matplotlibrc
if [[ "${OPTIONAL_DEPS}" == "1" ]]; then
pip install -r ./requirements/optional.txt
pip install -r ./requirements/extras.txt
fi
source tools/github/script.sh