Skip to content

Commit 9bf8037

Browse files
authored
Fixes for Windows (#394)
1 parent abca2f6 commit 9bf8037

16 files changed

+235
-198
lines changed

.github/workflows/main.yml

Lines changed: 68 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ jobs:
1111
python-version: [3.7, 3.8]
1212

1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v2
1515
- name: Set up Python ${{ matrix.python-version }}
16-
uses: actions/setup-python@v1
16+
uses: actions/setup-python@v2
1717
with:
1818
python-version: ${{ matrix.python-version }}
19-
architecture: 'x64'
2019

2120
- name: Install dependencies
2221
run: |
@@ -39,46 +38,8 @@ jobs:
3938
- name: Python tests
4039
run: poetry run pytest tests
4140

42-
- name: Test tiff cubing
43-
run: tests/scripts/tiff_cubing.sh
44-
45-
- name: Test tile cubing
46-
run: tests/scripts/tile_cubing.sh
47-
48-
- name: Test simple tiff cubing
49-
run: tests/scripts/simple_tiff_cubing.sh
50-
51-
- name: Test simple tiff cubing (no compression)
52-
run: tests/scripts/simple_tiff_cubing_no_compression.sh
53-
54-
- name: Test metadata generation
55-
run: tests/scripts/meta_generation.sh
56-
57-
- name: Test KNOSSOS conversion
58-
run: tests/scripts/knossos_conversion.sh
59-
60-
- name: Decompress reference magnification data
61-
run: |
62-
mkdir -p testdata/tiff_mag_2_reference
63-
tar -xzvf testdata/tiff_mag_2_reference.tar.gz -C testdata/tiff_mag_2_reference
64-
65-
- name: Test downsampling
66-
run: tests/scripts/downsampling.sh
67-
68-
- name: Test upsampling
69-
run: tests/scripts/upsampling.sh
70-
71-
- name: Test anisotropic downsampling
72-
run: tests/scripts/anisotropic_downsampling.sh
73-
74-
- name: Test compression and verification
75-
run: tests/scripts/compression_and_verification.sh
76-
77-
- name: Test in-place compression
78-
run: tests/scripts/in_place_compression.sh
79-
80-
- name: Remove reference magnification data
81-
run: rm -r testdata/tiff_mag_2_reference/
41+
- name: CLI tests
42+
run: tests/scripts/all_tests.sh
8243

8344
- name: Generate Docs
8445
if: matrix.python-version == '3.8'
@@ -112,18 +73,79 @@ jobs:
11273
[[ -z $(git status -s) ]]
11374
11475
- name: Publish python package
115-
if: startsWith(github.event.ref, 'refs/tags') && matrix.python-version == '3.7'
76+
if: startsWith(github.event.ref, 'refs/tags') && matrix.python-version == '3.8'
11677
env:
11778
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
11879
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
11980
run: ./publish.sh
12081

82+
build_win:
83+
# Caution! The Windows VM seems to be running out of storage rather quickly.
84+
runs-on: windows-latest
85+
strategy:
86+
max-parallel: 4
87+
matrix:
88+
python-version: [3.7, 3.8]
89+
90+
steps:
91+
- uses: actions/checkout@v2
92+
- name: Set up Python ${{ matrix.python-version }}
93+
uses: actions/setup-python@v2
94+
with:
95+
python-version: ${{ matrix.python-version }}
96+
97+
- name: Install dependencies
98+
shell: bash
99+
run: |
100+
pip install poetry
101+
poetry install
102+
103+
- name: Decompress test data
104+
shell: bash
105+
run: tar -xzvf testdata/WT1_wkw.tar.gz
106+
107+
- name: Python tests
108+
shell: bash
109+
run: poetry run pytest tests
110+
111+
- name: CLI tests
112+
shell: bash
113+
run: tests/scripts/all_tests.sh
114+
115+
build_mac:
116+
runs-on: macos-latest
117+
strategy:
118+
max-parallel: 4
119+
matrix:
120+
python-version: [3.7, 3.8]
121+
122+
steps:
123+
- uses: actions/checkout@v2
124+
- name: Set up Python ${{ matrix.python-version }}
125+
uses: actions/setup-python@v2
126+
with:
127+
python-version: ${{ matrix.python-version }}
128+
129+
- name: Install dependencies
130+
run: |
131+
pip install poetry
132+
poetry install
133+
134+
- name: Decompress test data
135+
run: tar -xzvf testdata/WT1_wkw.tar.gz
136+
137+
- name: Python tests
138+
run: poetry run pytest tests
139+
140+
- name: CLI tests
141+
run: tests/scripts/all_tests.sh
142+
121143
docker:
122-
needs: build
144+
needs: [build, build_win, build_mac]
123145
runs-on: ubuntu-latest
124146

125147
steps:
126-
- uses: actions/checkout@v1
148+
- uses: actions/checkout@v2
127149
- name: Build docker image
128150
run: docker build -t scalableminds/webknossos-cuber:$GITHUB_SHA .
129151

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section
1717
### Changed
1818

1919
### Fixed
20+
- Fixes support for Windows. [#394](https://github.com/scalableminds/webknossos-cuber/pull/394)
2021

2122
## [0.8.12](https://github.com/scalableminds/webknossos-cuber/releases/tag/v0.8.12) - 2021-08-19
2223
[Commits](https://github.com/scalableminds/webknossos-cuber/compare/v0.8.11...v0.8.12)

tests/conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pytest
2+
from pathlib import Path
3+
from os import makedirs
4+
from shutil import rmtree
5+
from typing import Generator
6+
7+
TESTOUTPUT_DIR = Path("testoutput")
8+
9+
10+
@pytest.fixture(autouse=True, scope="function")
11+
def run_around_tests() -> Generator:
12+
makedirs(TESTOUTPUT_DIR, exist_ok=True)
13+
yield
14+
rmtree(TESTOUTPUT_DIR)

tests/scripts/all_tests.sh

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,32 @@ if [ -d "./testoutput" ]; then rm -Rf ./testoutput; fi
55

66
BASEDIR=./tests/scripts
77

8-
sh ${BASEDIR}/tiff_cubing.sh
9-
sh ${BASEDIR}/simple_tiff_cubing.sh
10-
sh ${BASEDIR}/simple_tiff_cubing_no_compression.sh
11-
sh ${BASEDIR}/tile_cubing.sh
12-
sh ${BASEDIR}/meta_generation.sh
13-
sh ${BASEDIR}/knossos_conversion.sh
14-
158
mkdir -p testdata/tiff_mag_2_reference
169
tar -xzvf testdata/tiff_mag_2_reference.tar.gz -C testdata/tiff_mag_2_reference
1710

11+
sh ${BASEDIR}/tiff_cubing.sh
12+
sh ${BASEDIR}/meta_generation.sh
13+
sh ${BASEDIR}/downsampling.sh
14+
sh ${BASEDIR}/upsampling.sh
15+
rm -r testoutput/tiff_upsampling
16+
rm -r testdata/tiff_mag_2_reference
17+
1818
sh ${BASEDIR}/anisotropic_downsampling.sh
1919
sh ${BASEDIR}/compression_and_verification.sh
20-
sh ${BASEDIR}/downsampling.sh
21-
sh ${BASEDIR}/in_memory_downsampled_cubing.sh
20+
rm -r testoutput/tiff_compress
21+
2222
sh ${BASEDIR}/in_place_compression.sh
23-
sh ${BASEDIR}/simple_anisotropic_tiff_cubing.sh
23+
rm -r testoutput/tiff_compress2
24+
rm -r testoutput/tiff
25+
26+
sh ${BASEDIR}/tile_cubing.sh
27+
rm -r testoutput/temca2
2428

25-
rm -r testdata/tiff_mag_2_reference/
29+
sh ${BASEDIR}/simple_tiff_cubing.sh
30+
rm -r testoutput/tiff2
31+
32+
sh ${BASEDIR}/simple_tiff_cubing_no_compression.sh
33+
rm -r testoutput/tiff3
34+
35+
sh ${BASEDIR}/knossos_conversion.sh
36+
rm -r testoutput/knossos

tests/scripts/compression_and_verification.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ python -m wkcuber.check_equality testoutput/tiff testoutput/tiff_compress
1717

1818
echo "Create broken copy of dataset"
1919
rm -rf testoutput/tiff_compress-broken
20-
cp -R testoutput/tiff_compress{,-broken}
20+
cp -R testoutput/tiff_compress testoutput/tiff_compress-broken
2121
rm -r testoutput/tiff_compress-broken/color/1/z0/y0/x0.wkw
2222

2323
echo "Compare original dataset to broken one and expect to determine difference"

0 commit comments

Comments
 (0)