forked from DigitalSlideArchive/HistomicsTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_wheels.py
executable file
·40 lines (35 loc) · 1.26 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
39
40
#!/usr/bin/env python
import os
import subprocess
script = """
python --version && \\
pip install --upgrade pip && \\
pip install 'large_image[tiff,openslide,pil]' \\
-f https://manthey.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:2.7",
"python:3.5",
"python:3.6",
"python:3.7",
"centos/python-27-centos7",
# "centos/python-35-centos7",
"centos/python-36-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:2.7 bash
# and then enter the script commands directly