-
Notifications
You must be signed in to change notification settings - Fork 82
89 lines (86 loc) · 3.42 KB
/
pip-install.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
# This workflow will install the package as is on the github default branch using pip
name: pip Install
on:
push:
paths: [ "requirements*.yml", "conda-env-create.yml", "requirements/requirement*.txt", "setup*py", "setup*cfg", "pytproject*toml", "MANIFEST*in"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-24.04, windows-latest, macos-latest]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: 🐧 Install OpenSlide & OpenJPEG
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools
python -m pip install --upgrade pip
- name: 🍎 Install OpenSlide & OpenJPEG
if: runner.os == 'macOS'
run: |
brew install openslide openjpeg
python -m pip install --upgrade pip
- name: 🪟 Install OpenJPEG
if: runner.os == 'Windows'
run: |
# Install OpenJPEG
git clone https://github.com/uclouvain/openjpeg.git
cd openjpeg
mkdir build
cd build
cmake -G "MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release
ls
make -j4
make install
make clean
- name: 🪟 Install OpenSlide
if: runner.os == 'Windows'
run: |
choco install wget --no-progress
wget https://github.com/openslide/openslide-winbuild/releases/download/v20220811/openslide-win64-20220811.zip
7z x openslide-win64-20220811.zip
ls openslide-win64-20220811
# Add to PATH
echo "$(realpath ./openslide-win64-20220811/bin)" >> $GITHUB_PATH
echo "$(realpath ./openslide-win64-20220811/lib)" >> $GITHUB_PATH
# Install
mkdir "C:\Program Files\openslide"
Copy-Item -Path ".\openslide-win64-20220811\*" -Destination "C:\Program Files\openslide" -Recurse
ls "C:/Program Files/openslide"
- name: 🪟 Install SQLite Shell
if: runner.os == 'Windows'
run: choco install sqlite.shell --no-progress
- name: SQLite Version Information
run: |
sqlite3 --version
sqlite3 ":memory:" -list ".output stdout" "pragma compile_options" ".exit"
- name: OpenSlide Version Information
if: runner.os == 'Linux'
run: openslide-quickhash1sum --version
- name: OpenJPEG Version Information
continue-on-error: true # This -h option has exit code 1 for some reason
run: opj_dump -h
- name: pip Install From GitHub Repo on Linux and macOS
if: runner.os != 'Windows'
run: python -m pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@${GITHUB_REF_NAME}
- name: pip Install From GitHub on Windows
if: runner.os == 'Windows'
run: python -m pip install git+https://github.com/TissueImageAnalytics/tiatoolbox@$env:GITHUB_REF_NAME
- name: Test TIAToolbox Import
shell: python
run: |
import os
if hasattr(os, "add_dll_directory"):
# Required for Python>=3.8 on Windows
with os.add_dll_directory(r"D:\a\tiatoolbox\tiatoolbox\openslide-win64-20220811\bin"):
import tiatoolbox
else:
os.environ["PATH"] = r"D:\a\tiatoolbox\tiatoolbox\openslide-win64-20220811\bin;"
import tiatoolbox