-
Notifications
You must be signed in to change notification settings - Fork 117
/
test_wheels.py
executable file
·38 lines (33 loc) · 1.2 KB
/
test_wheels.py
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
#!/usr/bin/env python
import os
import subprocess
script = """
python --version && \\
pip install --upgrade pip && \\
pip install 'large_image[tiff,openslide,pil]' \\
-f https://girder.github.io/large_image_wheels && \\
pip install histomicstk -f /wheels && \\
echo 'Test basic import of histomicstk' && \\
python -c 'import histomicstk' && \\
curl https://data.kitware.com/api/v1/file/5899dd6d8d777f07219fcb23/download -LJ -o tcga.svs && \\
export CLIPATH=`python -c 'import histomicstk,os;print(os.path.dirname( \\
histomicstk.__file__))'`/cli && \\
python "$CLIPATH/NucleiDetection/NucleiDetection.py" tcga.svs sample.anot \\
--analysis_roi="7000,7000,3000,3000" && \\
true"""
containers = [
'python:3.9',
'python:3.10',
'python:3.11',
'python:3.12',
'centos/python-38-centos7',
]
for container in containers:
print('---- Testing in %s ----' % container)
subprocess.check_call([
'docker', 'run', '-v',
'%s/wheels:/wheels' % os.path.dirname(os.path.realpath(__file__)),
'--rm', container, 'sh', '-c', script])
# To test manually, run a container such as
# docker run -v `pwd`/docs:/wheels --rm -it python:3.12 bash
# and then enter the script commands directly