-
Notifications
You must be signed in to change notification settings - Fork 87
103 lines (99 loc) · 4.53 KB
/
test.yaml
File metadata and controls
103 lines (99 loc) · 4.53 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Test
on:
push:
branches: [main]
tags:
- "v*"
pull_request:
branches: "*"
jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash # bash also on windows
strategy:
fail-fast: false
matrix:
include:
- {os: windows-latest, python: "3.11", dask-version: "2025.12.0", name: "Dask 2025.12.0"}
- {os: windows-latest, python: "3.13", dask-version: "latest", name: "Dask latest"}
- {os: ubuntu-latest, python: "3.11", dask-version: "latest", name: "Dask latest"}
- {os: ubuntu-latest, python: "3.13", dask-version: "latest", name: "Dask latest"}
- {os: macos-latest, python: "3.11", dask-version: "latest", name: "Dask latest"}
- {os: macos-latest, python: "3.13", prerelease: "allow", name: "Python 3.13 (pre-release)"}
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
DASK_VERSION: ${{ matrix.dask-version }}
PRERELEASE: ${{ matrix.prerelease }}
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
id: setup-uv
with:
version: "latest"
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
if [[ "${PRERELEASE}" == "allow" ]]; then
sed -i '' 's/requires-python.*//' pyproject.toml # otherwise uv complains that anndata requires python>=3.12 and we only do >=3.11 😱
uv add git+https://github.com/scverse/anndata.git
uv add pandas>=3.dev0
fi
if [[ -n "${DASK_VERSION}" ]]; then
if [[ "${DASK_VERSION}" == "latest" ]]; then
uv add dask
else
uv add dask==${DASK_VERSION}
fi
fi
uv sync --group=test
# Start storage emulators (S3, Azure, GCS) only on Linux; Docker service containers are not available on
# Windows/macOS runners, so tests/io/remote_storage/ is skipped there (see Test step). Remote I/O is still
# exercised on every PR via the Ubuntu matrix jobs.
- name: Build and start storage emulators
if: matrix.os == 'ubuntu-latest'
run: |
docker build -f tests/io/remote_storage/Dockerfile.emulators -t spatialdata-emulators .
docker run --rm -d --name spatialdata-emulators \
-p 5000:5000 -p 10000:10000 -p 4443:4443 \
spatialdata-emulators
- name: Wait for emulator ports
if: matrix.os == 'ubuntu-latest'
run: |
echo "Waiting for S3 (5000), Azure (10000), GCS (4443)..."
python3 -c "
import socket, time
for _ in range(45):
try:
for p in (5000, 10000, 4443):
socket.create_connection(('127.0.0.1', p), timeout=2)
print('Emulators ready.')
break
except (socket.error, OSError):
time.sleep(2)
else:
raise SystemExit('Emulators did not become ready.')
"
# On Linux, emulators run above so full suite (incl. tests/io/remote_storage/) runs. On Windows/macOS, skip remote_storage.
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
# gcsfs otherwise defaults to ExtendedGcsFileSystem (prod Storage Control gRPC; breaks fake-gcs-server).
GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT: "false"
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
uv run pytest --cov --color=yes --cov-report=xml
else
uv run pytest --cov --color=yes --cov-report=xml --ignore=tests/io/remote_storage/
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
name: coverage
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}