44
44
matrix :
45
45
os : [ubuntu-latest, macos-latest]
46
46
python-version : [3.8, 3.9, "3.10", "3.11", "3.12", "3.13-dev"]
47
+ openslide : [package, openslide-bin]
47
48
include :
48
49
- os : ubuntu-latest
49
50
python-version : " 3.12"
51
+ openslide : package
50
52
sdist : sdist
51
53
# Python 3.8 is too old to support universal binaries, and
52
54
# setup-python's Python 3.9 and 3.10 won't build them. Use the
86
88
run : |
87
89
python -m pip install --upgrade pip
88
90
pip install auditwheel build jinja2 pytest
89
- - name : Install OpenSlide
91
+ - name : Install OpenSlide (package)
92
+ if : matrix.openslide == 'package'
90
93
run : |
91
94
case "${{ matrix.os }}" in
92
95
ubuntu-latest)
99
102
brew install openslide
100
103
;;
101
104
esac
105
+ - name : Install OpenSlide (openslide-bin)
106
+ if : matrix.openslide == 'openslide-bin'
107
+ run : pip install openslide-bin
102
108
- name : Build dist
103
109
run : |
104
110
if [ -z "${{ matrix.sdist }}" ]; then
@@ -124,9 +130,10 @@ jobs:
124
130
fi
125
131
mkdir -p "artifacts/whl/${{ needs.pre-commit.outputs.dist-base }}"
126
132
mv dist/* "artifacts/whl/${{ needs.pre-commit.outputs.dist-base }}"
127
- # save version-specific wheels and oldest abi3 wheel
133
+ # from pkg builds, save version-specific wheels and oldest abi3 wheel
128
134
python -c 'import sys
129
- if sys.version_info < (3, 12): print("archive_wheel=1")' >> $GITHUB_ENV
135
+ if sys.version_info < (3, 12) and "${{ matrix.openslide }}" == "package":
136
+ print("archive_wheel=1")' >> $GITHUB_ENV
130
137
- name : Install
131
138
run : pip install artifacts/whl/${{ needs.pre-commit.outputs.dist-base }}/*.whl
132
139
- name : Run tests
@@ -158,6 +165,7 @@ jobs:
158
165
strategy :
159
166
matrix :
160
167
python-version : [3.8, 3.9, "3.10", "3.11", "3.12", "3.13-dev"]
168
+ openslide : [zip, wheel]
161
169
steps :
162
170
- name : Check out repo
163
171
uses : actions/checkout@v4
@@ -169,7 +177,8 @@ jobs:
169
177
run : |
170
178
python -m pip install --upgrade pip
171
179
pip install build flask pytest
172
- - name : Install OpenSlide
180
+ - name : Install OpenSlide (zip)
181
+ if : matrix.openslide == 'zip'
173
182
env :
174
183
GH_TOKEN : ${{ github.token }}
175
184
run : |
@@ -184,14 +193,18 @@ jobs:
184
193
--pattern "${zipname}.zip"
185
194
7z x ${zipname}.zip
186
195
echo "OPENSLIDE_PATH=c:\\openslide\\${zipname}\\bin" >> $GITHUB_ENV
196
+ - name : Install OpenSlide (wheel)
197
+ if : matrix.openslide == 'wheel'
198
+ run : pip install openslide-bin
187
199
- name : Build wheel
188
200
run : |
189
201
python -m build -w
190
202
mkdir -p "artifacts/whl/${{ needs.pre-commit.outputs.dist-base }}"
191
203
mv dist/*.whl "artifacts/whl/${{ needs.pre-commit.outputs.dist-base }}"
192
- # save version-specific wheels and oldest abi3 wheel
193
- python -c 'import sys
194
- if sys.version_info < (3, 12): print("archive_wheel=1")' >> $GITHUB_ENV
204
+ # from zip builds, save version-specific wheels and oldest abi3 wheel
205
+ python -c 'import sys;
206
+ if sys.version_info < (3, 12) and "${{ matrix.openslide }}" == "zip":
207
+ print("archive_wheel=1")' >> $GITHUB_ENV
195
208
- name : Install
196
209
run : pip install artifacts/whl/${{ needs.pre-commit.outputs.dist-base }}/*.whl
197
210
- name : Run tests
0 commit comments