Skip to content

Commit 05a55da

Browse files
committed
SNOW-3121122: Add SQLA2.1 to CI
1 parent d8583c1 commit 05a55da

File tree

3 files changed

+103
-4
lines changed

3 files changed

+103
-4
lines changed

.github/workflows/build_test.yml

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ jobs:
5656
python-version: "3.13"
5757
- hatch-env: sa14
5858
python-version: "3.12"
59+
- hatch-env: sa21
60+
python-version: "3.12"
5961
steps:
6062
- uses: actions/checkout@v4
6163
with:
@@ -73,8 +75,8 @@ jobs:
7375
python -m hatch -e ${{ matrix.hatch-env }} build --clean
7476
- name: Install and check import
7577
run: |
76-
python -m uv pip install dist/snowflake_sqlalchemy-*.whl
77-
python -c "import snowflake.sqlalchemy; print(snowflake.sqlalchemy.__version__)"
78+
hatch run ${{ matrix.hatch-env }}:pip install dist/snowflake_sqlalchemy-*.whl --force-reinstall --no-deps
79+
hatch run ${{ matrix.hatch-env }}:check-import
7880
7981
test-dialect:
8082
name: Test dialect ${{ matrix.os }}-${{ fromJson('{"default":"3.13","sa14":"3.12"}')[matrix.hatch-env] }}-${{ matrix.cloud-provider }}-${{ matrix.hatch-env }}
@@ -261,6 +263,97 @@ jobs:
261263
path: |
262264
./coverage.xml
263265
266+
test-dialect-v21:
267+
name: Test dialect sa21 ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
268+
needs: [lint, build-install]
269+
runs-on: ${{ matrix.os }}
270+
strategy:
271+
fail-fast: false
272+
matrix:
273+
os: [ubuntu-latest, macos-15, windows-latest]
274+
python-version: ["3.12"]
275+
cloud-provider: [aws, azure, gcp]
276+
steps:
277+
- uses: actions/checkout@v4
278+
with:
279+
persist-credentials: false
280+
- name: Set up Python
281+
uses: actions/setup-python@v5
282+
with:
283+
python-version: ${{ matrix.python-version }}
284+
- name: Setup parameters file
285+
shell: bash
286+
env:
287+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
288+
run: |
289+
printf "%s" "$PARAMETERS_SECRET" | gpg --quiet --batch --yes \
290+
--decrypt \
291+
--passphrase-fd 0 \
292+
--pinentry-mode loopback \
293+
--output tests/parameters.py \
294+
.github/workflows/parameters/parameters_${{ matrix.cloud-provider }}.py.gpg
295+
- name: Upgrade pip and install hatch
296+
run: |
297+
python -m pip install -U uv
298+
python -m uv pip install -U hatch
299+
python -m hatch env create sa21
300+
- name: Verify SQLAlchemy version
301+
run: hatch run sa21:python -c "import sqlalchemy; print(sqlalchemy.__version__); assert sqlalchemy.__version__.startswith('2.1'), f'Expected SQLAlchemy 2.1.x, got {{sqlalchemy.__version__}}'"
302+
- name: Run test for AWS
303+
run: hatch run sa21:test-dialect-aws
304+
if: matrix.cloud-provider == 'aws'
305+
- name: Run tests
306+
run: hatch run sa21:test-dialect
307+
- uses: actions/upload-artifact@v4
308+
with:
309+
name: coverage.xml_dialect-sa21-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
310+
path: |
311+
./coverage.xml
312+
313+
test-dialect-compatibility-v21:
314+
name: Test dialect sa21 compatibility ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
315+
needs: lint
316+
runs-on: ${{ matrix.os }}
317+
strategy:
318+
fail-fast: false
319+
matrix:
320+
os: [ubuntu-latest, macos-15, windows-latest]
321+
python-version: ["3.12"]
322+
cloud-provider: [aws, azure, gcp]
323+
steps:
324+
- uses: actions/checkout@v4
325+
with:
326+
persist-credentials: false
327+
- name: Set up Python
328+
uses: actions/setup-python@v5
329+
with:
330+
python-version: ${{ matrix.python-version }}
331+
- name: Upgrade pip and install hatch
332+
run: |
333+
python -m pip install -U uv
334+
python -m uv pip install -U hatch
335+
python -m hatch env create sa21
336+
- name: Verify SQLAlchemy version
337+
run: hatch run sa21:python -c "import sqlalchemy; print(sqlalchemy.__version__); assert sqlalchemy.__version__.startswith('2.1'), f'Expected SQLAlchemy 2.1.x, got {{sqlalchemy.__version__}}'"
338+
- name: Setup parameters file
339+
shell: bash
340+
env:
341+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
342+
run: |
343+
printf "%s" "$PARAMETERS_SECRET" | gpg --quiet --batch --yes \
344+
--decrypt \
345+
--passphrase-fd 0 \
346+
--pinentry-mode loopback \
347+
--output tests/parameters.py \
348+
.github/workflows/parameters/parameters_${{ matrix.cloud-provider }}.py.gpg
349+
- name: Run tests
350+
run: hatch run sa21:test-dialect-compatibility
351+
- uses: actions/upload-artifact@v4
352+
with:
353+
name: coverage.xml_dialect-sa21-compatibility-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
354+
path: |
355+
./coverage.xml
356+
264357
combine-coverage:
265358
name: Combine coverage
266359
if: ${{ success() || failure() }}
@@ -270,6 +363,8 @@ jobs:
270363
test-dialect-compatibility,
271364
test-dialect-v14,
272365
test-dialect-compatibility-v14,
366+
test-dialect-v21,
367+
test-dialect-compatibility-v21,
273368
]
274369
runs-on: ubuntu-latest
275370
steps:

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,14 @@ extra-dependencies = [
8989
"pandas>=2.1.1,<2.2",
9090
"numpy<2",
9191
]
92+
93+
[tool.hatch.envs.sa21]
94+
installer = "uv"
95+
builder = true
96+
extra-dependencies = ["SQLAlchemy>=2.1.0b1"]
9297
features = ["development", "pandas"]
9398
python = "3.12"
99+
pip-pre = true
94100

95101
[tool.hatch.envs.sa14.scripts]
96102
test-dialect = "pytest --ignore_v20_test -ra -vvv --tb=short --cov snowflake.sqlalchemy --cov-append --junitxml ./junit.xml --ignore=tests/sqlalchemy_test_suite tests/"

snyk/requiremtnts.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)