-
Notifications
You must be signed in to change notification settings - Fork 19
162 lines (142 loc) · 4.55 KB
/
python-check.yaml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Python Check
on:
push:
branches:
- main
pull_request:
paths:
- 'icechunk/**'
- 'icechunk-python/**'
- '.github/workflows/python-check.yaml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
working-directory: ./icechunk-python
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Just
run: sudo snap install --edge --classic just
- name: Stand up MinIO
run: |
docker compose up -d minio
- name: Wait for MinIO to be ready
run: |
for _ in {1..10}; do
if curl --silent --fail http://minio:9000/minio/health/live; then
break
fi
sleep 3
done
docker compose exec -T minio mc alias set minio http://minio:9000 minio123 minio123
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: icechunk-python
# target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
# manylinux: ${{ matrix.platform.manylinux }} # https://github.com/PyO3/maturin-action/issues/245
- name: Cargo lint + format icechunk-python
shell: bash
working-directory: icechunk
run: |
just pre-commit-python
- name: mypy
shell: bash
working-directory: icechunk-python
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install icechunk['test'] --find-links dist --force-reinstall
mypy python
- name: pre-commit lint
shell: bash
working-directory: icechunk-python
run: |
set -e
source .venv/bin/activate
pip install pre-commit
SKIP=just-rust pre-commit run --all-files
- name: Restore cached hypothesis directory
id: restore-hypothesis-cache
uses: actions/cache/restore@v4
with:
path: icechunk-python/.hypothesis/
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
restore-keys: |
cache-hypothesis-
- name: pytest
shell: bash
working-directory: icechunk-python
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install icechunk['test'] --find-links dist --force-reinstall
pytest
# explicitly save the cache so it gets updated, also do this even if it fails.
- name: Save cached hypothesis directory
id: save-hypothesis-cache
if: always()
uses: actions/cache/save@v4
with:
path: icechunk-python/.hypothesis/
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
xarray-backends:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: "icechunk"
- name: Stand up MinIO
working-directory: icechunk
run: |
docker compose up -d minio
- name: Wait for MinIO to be ready
working-directory: icechunk
run: |
for _ in {1..10}; do
if curl --silent --fail http://minio:9000/minio/health/live; then
break
fi
sleep 3
done
docker compose exec -T minio mc alias set minio http://minio:9000 minio123 minio123
- uses: actions/checkout@v4
with:
repository: "pydata/xarray"
path: "xarray"
fetch-depth: 0 # Fetch all history for all branches and tags.
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: icechunk/icechunk-python
args: --release --out dist --find-interpreter
sccache: 'true'
- name: pytest
shell: bash
working-directory: icechunk/icechunk-python
env:
ICECHUNK_XARRAY_BACKENDS_TESTS: 1
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install icechunk['test'] --find-links dist --force-reinstall
# pass xarray's pyproject.toml so that pytest can find the `flaky` fixture
pytest -c=../../xarray/pyproject.toml -W ignore tests/run_xarray_backends_tests.py