Repository navigation
282 lines (230 loc) · 8.82 KB
/
Copy pathpython_build.yml
File metadata and controls
282 lines (230 loc) · 8.82 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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: python_build
on:
merge_group:
push:
branches: [main]
pull_request:
branches: [main, next, next/*]
defaults:
run:
working-directory: ./python
env:
PROFILE: ci
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
test-minimal:
runs-on: ubuntu-latest
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python-version: '3.11'
- name: Check Python
run: |
uv sync --no-install-project
make check-python
- name: Build and install deltalake
run: |
# Install minimum PyArrow version
make develop
uv pip install pyarrow==21.0.0
- name: Run tests
run: make unit-test
test:
name: Python Build (Python 3.11 PyArrow latest)
runs-on: ubuntu-latest
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Start emulated services
run: docker compose up -d
- name: Build and install deltalake
run: make develop
- name: Run tests
run: uv run --no-sync pytest -n auto -m '((s3 or azure) and integration and not pyspark) or not integration and not benchmark and not no_pyarrow' --doctest-modules
- name: Test without pandas
run: |
uv pip uninstall pandas
uv run --no-sync pytest -n auto -m "not pandas and not integration and not benchmark and not no_pyarrow"
- name: Test without pyarrow and without pandas
run: |
uv pip uninstall pyarrow
uv run --no-sync pytest -n auto -m "not pyarrow and not pandas and not datafusion and not integration and not benchmark"
test-datafusion:
name: Python Build (Python 3.11 DataFusion integration)
runs-on: ubuntu-latest
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python-version: '3.11'
- name: Build and install deltalake
run: make develop
# Restore the DataFusion dependency and major-version assertion when 55.x wheels
# are published. Until then, the integration test skips without a matching consumer.
- name: Run DataFusion integration test
run: DELTALAKE_RUN_DATAFUSION_TESTS=1 uv run --no-sync pytest -v tests/test_datafusion.py -m datafusion
test-lakefs:
name: Python Build (Python 3.11 LakeFS Integration tests)
runs-on: ubuntu-latest
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Start emulated services
run: docker compose -f ../docker-compose-lakefs.yml up -d
- name: Build and install deltalake
run: make develop
- name: Run tests
run: uv run --no-sync pytest -m '(lakefs and integration)' --doctest-modules
test-unitycatalog:
name: Python Build (Python 3.11 Unity Catalog Integration tests)
runs-on: ubuntu-latest
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Build and install deltalake
run: |
make develop
# Installs uc-server, which the tests start.
uv pip install --group unitycatalog
- name: Run tests
run: uv run --no-sync pytest -m '(unitycatalog and integration)' --doctest-modules
test-pyspark:
name: PySpark Integration Tests
runs-on: ubuntu-latest
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Environment
uses: ./.github/actions/setup-env
# <https://github.com/actions/setup-java/releases/tag/v5.2.0>
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
with:
distribution: "zulu"
java-version: "21"
- name: Start emulated services
run: docker compose up -d
- name: Build and install deltalake
run: make develop-pyspark
- name: Run tests
run: make test-pyspark
multi-python-running:
name: Running with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python-version }}
- name: Build and install deltalake
run: |
make develop
- name: Run deltalake
run: |
uv run --no-sync python -c 'import deltalake'
- name: Run deltalake without pyarrow
run: |
uv pip uninstall pyarrow
uv run --no-sync python -c 'import deltalake'
- name: Run deltalake without pyarrow pandas
run: |
uv pip uninstall pyarrow pandas
uv run --no-sync python -c 'import deltalake'
- name: Run deltalake without pandas
run: |
uv pip install pyarrow
uv run --no-sync python -c 'import deltalake'
test-windows:
name: Python Windows tests (${{ matrix.architecture }})
strategy:
fail-fast: false
matrix:
include:
- runner: windows-latest
architecture: x64
target: x86_64-pc-windows-msvc
- runner: windows-11-arm
architecture: arm64
target: aarch64-pc-windows-msvc
runs-on: ${{ matrix.runner }}
env:
# This job does not use setup-builder, which installs sccache.
RUSTC_WRAPPER: ""
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
# <https://github.com/actions/setup-python/releases/tag/v6.2.0>
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.11'
architecture: ${{ matrix.architecture }}
- name: Configure ARM64 native compiler
if: matrix.architecture == 'arm64'
shell: pwsh
run: |
$llvm = "$env:ProgramFiles\LLVM\bin"
if (!(Test-Path "$llvm\clang.exe") -or !(Test-Path "$llvm\clang-cl.exe")) {
throw "LLVM clang and clang-cl are required for Windows ARM64"
}
$llvm >> $env:GITHUB_PATH
"CC_aarch64_pc_windows_msvc=clang-cl" >> $env:GITHUB_ENV
"CXX_aarch64_pc_windows_msvc=clang-cl" >> $env:GITHUB_ENV
- name: Install uv
# <https://github.com/astral-sh/setup-uv/releases/tag/v8.0.0>
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
- name: Install test dependencies
if: matrix.architecture == 'x64'
run: uv sync --python python --no-install-project --all-extras
- name: Install test dependencies without optional extras
if: matrix.architecture == 'arm64'
run: uv sync --python python --no-install-project --no-group other
- name: Build and install deltalake
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
with:
target: ${{ matrix.target }}
rust-toolchain: stable
working-directory: python
command: develop
args: --uv --profile ci
- name: Assert Windows Python wheels do not select Unix-only OpenSSH
shell: bash
run: |
set -euo pipefail
tree=$(cargo tree -p deltalake-python --target ${{ matrix.target }})
if grep -Eq '(^|[[:space:]])openssh v' <<<"$tree"; then
printf '%s\n' "$tree"
printf '%s\n' "openssh must not be selected for the Windows Python target"
exit 1
fi
if grep -Eq '(^|[[:space:]])opendal-service-sftp v' <<<"$tree"; then
printf '%s\n' "$tree"
printf '%s\n' "OpenDAL SFTP must not be selected for the Windows Python target"
exit 1
fi
# Not enable in Windows arm64 because PyArrow has no Windows ARM64 wheels.
- name: Install minimum PyArrow version
if: matrix.architecture == 'x64'
run: uv pip install pyarrow==21.0.0
- name: Run unit tests and doctests
if: matrix.architecture == 'x64'
run: uv run --no-sync pytest -q -n auto --doctest-modules
- name: Run unit tests without PyArrow and Pandas
if: matrix.architecture == 'arm64'
run: uv run --no-sync pytest -q -n auto -m "not pyarrow and not pandas and not datafusion and not integration and not benchmark"