Repository navigation
311 lines (290 loc) · 10.1 KB
/
Copy pathpythonapp.yaml
File metadata and controls
311 lines (290 loc) · 10.1 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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
name: Python application
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
checks: write
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build_backend:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# DuckDB 2.x needs Python 3.11 or newer, and DuckDB 1.x has no wheels
# for Python 3.15. MotherDuck accepts only DuckDB 1.x.
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
duckdb: ["duckdb<2"]
include:
- {python: "3.11", duckdb: "duckdb>=2,<3"}
- {python: "3.12", duckdb: "duckdb>=2,<3"}
- {python: "3.13", duckdb: "duckdb>=2,<3"}
- {python: "3.14", duckdb: "duckdb>=2,<3"}
- {python: "3.15", duckdb: "duckdb>=2,<3"}
env:
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Remove cached duckdb extensions
run: rm -rf ~/.duckdb
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install --upgrade SQLAlchemy
python -m pip install --upgrade "${{ matrix.duckdb }}"
- name: Run tests
run: |
pytest \
--junitxml=results.xml \
--cov \
--cov-report xml:coverage.xml \
--verbose \
-rs \
--remote-data
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: results.xml
comment_mode: off
check_name: "Test Results - python=${{ matrix.python }} ${{ matrix.duckdb }}"
- uses: codecov/codecov-action@v7.1.1
# The Codecov CLI has no Python 3.15 wheels for its dependencies yet.
if: matrix.python != '3.15'
env:
PYTHON: ${{matrix.python}}
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON
# Dependabot PRs cannot read the Actions CODECOV_TOKEN secret
fail_ci_if_error: ${{ github.actor != 'dependabot[bot]' }}
use_pypi: true
verbose: true
minimum_versions:
# Keep in sync with the dependency floors in pyproject.toml.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Install minimum supported versions
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install "SQLAlchemy==2.0.0" "duckdb==1.3.0"
- name: Run tests
run: pytest -q -rs
sqlalchemy_2_0:
# build_backend picks SQLAlchemy 2.1 on Python 3.11+, so test 2.0 there too.
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python: "3.13"
sqlalchemy: "SQLAlchemy<2.1"
duckdb: "duckdb<2"
- python: "3.13"
sqlalchemy: "SQLAlchemy<2.1"
duckdb: "duckdb>=2,<3"
# the SQLAlchemy floor for Python 3.14 in pyproject.toml
- python: "3.14"
sqlalchemy: "SQLAlchemy==2.0.45"
duckdb: "duckdb>=2,<3"
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Install SQLAlchemy 2.0
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install "${{ matrix.sqlalchemy }}" "${{ matrix.duckdb }}"
- name: Run tests
run: pytest -q -rs
sqlalchemy_prerelease:
# Informational: upstream prerelease regressions do not block merges.
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.14"
allow-prereleases: true
- name: Install SQLAlchemy prerelease
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install --pre --upgrade SQLAlchemy
- name: Run SQLAlchemy prerelease tests
run: pytest -q
optional_versions:
# Exercise declared optional floors alongside the dialect's dependency floors.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.11"
- run: python -m pip install -e ".[dev]"
- run: python -m pip install "duckdb==1.3.0" "SQLAlchemy==2.0.0" "pyarrow==22.0.0" "pandas==2.2.0" "numpy<2"
- run: pytest -q duckdb_sqlalchemy/tests/test_review_contracts.py duckdb_sqlalchemy/tests/test_csv_review_fixes.py duckdb_sqlalchemy/tests/test_pandas.py duckdb_sqlalchemy/tests/test_execution_options.py duckdb_sqlalchemy/tests/e2e/test_bulk_insert_threshold.py duckdb_sqlalchemy/tests/e2e/test_dataframes_and_arrow.py
duckdb_prerelease:
# Informational: upstream nightly regressions do not block merges.
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.14"
allow-prereleases: true
- name: Install DuckDB prerelease
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install --pre --upgrade duckdb
- name: Run DuckDB prerelease tests
run: pytest -q
platforms:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
duckdb: ["duckdb<2", "duckdb>=2,<3"]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: python -m pip install -e ".[dev]" "${{ matrix.duckdb }}"
- run: pytest -q -m "not remote_data"
upstream_suite:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sqlalchemy: ["SQLAlchemy>=2.0,<2.1", "SQLAlchemy>=2.1,<2.2"]
duckdb: ["duckdb<2", "duckdb>=2,<3"]
env:
DUCKDB_SQLA_SUITE: "1"
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: python -m pip install -e ".[dev]"
- run: python -m pip install "${{ matrix.sqlalchemy }}" "${{ matrix.duckdb }}"
- run: |
pytest -q duckdb_sqlalchemy/tests/sqlalchemy_suite --dburi duckdb:///sqlalchemy_suite.duckdb -r fE -o strict_parametrization_ids=false
distributions:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
artifact: [wheel, sdist]
optional: [none, arrow, pandas]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: python -m pip install build twine
- run: python -m build
- run: python -m twine check dist/*
- name: Install distribution with selected optional dependency
env:
ARTIFACT: ${{ matrix.artifact }}
OPTIONAL: ${{ matrix.optional }}
run: |
if [ "$ARTIFACT" = wheel ]; then
python -m pip install dist/*.whl
else
python -m pip install dist/*.tar.gz
fi
if [ "$OPTIONAL" = arrow ]; then python -m pip install pyarrow; fi
if [ "$OPTIONAL" = pandas ]; then python -m pip install pandas; fi
- run: python -I scripts/verify_distribution.py
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: python -m pip install -e ".[dev]"
- uses: actions/checkout@v7
with:
ref: 6b41e798d7525a94176ada4e6a7ac1cb3d648df3
path: .benchmark-baseline
persist-credentials: false
- run: python -m pip install -e ".benchmark-baseline[dev]"
- run: python benchmarks/run.py --baseline --cases startup native_insert core_insert bulk_insert pandas_insert tuple_read arrow_read reflection --rows 10000 --repeats 2 --output baseline.json
- run: python -m pip install -e ".[dev]"
- run: python benchmarks/run.py --rows 10000 --repeats 2 --output benchmark.json
- name: Summarize timings against the baseline commit
# Informational: shared runners are too noisy to gate on timings.
run: |
{
echo "### Benchmarks against the baseline commit"
echo
python benchmarks/compare.py baseline.json benchmark.json
} >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@v7
with:
name: benchmark-results
path: |
benchmark.json
baseline.json
tests_passed:
# Single status check to require in branch rules.
if: always()
needs: [build_backend, minimum_versions, sqlalchemy_2_0, optional_versions, platforms, upstream_suite, distributions, benchmarks]
runs-on: ubuntu-latest
steps:
- name: Check job results
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
echo "$RESULTS"
for result in $RESULTS; do
if [ "$result" != "success" ]; then
exit 1
fi
done