Skip to content

Commit 8f2c486

Browse files
authored
SNOW-2867672: bump connector & pythons (#627)
1 parent 5faa97a commit 8f2c486

File tree

6 files changed

+63
-34
lines changed

6 files changed

+63
-34
lines changed

.github/workflows/build_test.yml

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up Python
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: "3.8"
32+
python-version: "3.12"
3333
- name: Upgrade and install tools
3434
run: |
3535
python -m pip install -U uv
@@ -51,15 +51,19 @@ jobs:
5151
strategy:
5252
fail-fast: true
5353
matrix:
54-
hatch-env: [default, sa14]
54+
include:
55+
- hatch-env: default
56+
python-version: "3.14"
57+
- hatch-env: sa14
58+
python-version: "3.12"
5559
steps:
5660
- uses: actions/checkout@v4
5761
with:
5862
persist-credentials: false
5963
- name: Setup up Python
6064
uses: actions/setup-python@v5
6165
with:
62-
python-version: "3.8"
66+
python-version: ${{ matrix.python-version }}
6367
- name: Upgrade and install tools
6468
run: |
6569
python -m pip install -U uv
@@ -73,28 +77,28 @@ jobs:
7377
python -c "import snowflake.sqlalchemy; print(snowflake.sqlalchemy.__version__)"
7478
7579
test-dialect:
76-
name: Test dialect ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
80+
name: Test dialect ${{ matrix.os }}-${{ fromJson('{"default":"3.14","sa14":"3.12"}')[matrix.hatch-env] }}-${{ matrix.cloud-provider }}-${{ matrix.hatch-env }}
7781
needs: [lint, build-install]
7882
runs-on: ${{ matrix.os }}
7983
strategy:
8084
fail-fast: false
8185
matrix:
8286
os: [ubuntu-latest, macos-13, windows-latest]
83-
python-version: ["3.8"]
8487
cloud-provider: [aws, azure, gcp]
88+
hatch-env: [default, sa14]
8589
steps:
8690
- uses: actions/checkout@v4
8791
with:
8892
persist-credentials: false
8993
- name: Set up Python
9094
uses: actions/setup-python@v5
9195
with:
92-
python-version: ${{ matrix.python-version }}
96+
python-version: ${{ fromJson('{"default":"3.14","sa14":"3.12"}')[matrix.hatch-env] }}
9397
- name: Upgrade pip and prepare environment
9498
run: |
9599
python -m pip install -U uv
96100
python -m uv pip install -U hatch
97-
python -m hatch env create default
101+
python -m hatch env create ${{ matrix.hatch-env }}
98102
- name: Setup parameters file
99103
shell: bash
100104
env:
@@ -106,40 +110,47 @@ jobs:
106110
--pinentry-mode loopback \
107111
--output tests/parameters.py \
108112
.github/workflows/parameters/parameters_${{ matrix.cloud-provider }}.py.gpg
109-
- name: Run test for AWS
113+
- name: Run test for AWS (default)
114+
if: matrix.cloud-provider == 'aws' && matrix.hatch-env == 'default'
110115
run: hatch run test-dialect-aws
111-
if: matrix.cloud-provider == 'aws'
112-
- name: Run tests
116+
- name: Run test for AWS (sa14)
117+
if: matrix.cloud-provider == 'aws' && matrix.hatch-env == 'sa14'
118+
run: hatch run sa14:test-dialect-aws
119+
- name: Run tests (default)
120+
if: matrix.hatch-env == 'default'
113121
run: hatch run test-dialect
122+
- name: Run tests (sa14)
123+
if: matrix.hatch-env == 'sa14'
124+
run: hatch run sa14:test-dialect
114125
- uses: actions/upload-artifact@v4
115126
with:
116-
name: coverage.xml_dialect-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
127+
name: coverage.xml_dialect-${{ matrix.os }}-${{ fromJson('{"default":"3.14","sa14":"3.12"}')[matrix.hatch-env] }}-${{ matrix.cloud-provider }}-${{ matrix.hatch-env }}
117128
path: |
118129
./coverage.xml
119130
120131
test-dialect-compatibility:
121-
name: Test dialect compatibility ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
132+
name: Test dialect compatibility ${{ matrix.os }}-${{ fromJson('{"default":"3.14","sa14":"3.12"}')[matrix.hatch-env] }}-${{ matrix.cloud-provider }}-${{ matrix.hatch-env }}
122133
needs: [lint, build-install]
123134
runs-on: ${{ matrix.os }}
124135
strategy:
125136
fail-fast: false
126137
matrix:
127138
os: [ubuntu-latest, macos-13, windows-latest]
128-
python-version: ["3.8"]
129139
cloud-provider: [aws, azure, gcp]
140+
hatch-env: [default, sa14]
130141
steps:
131142
- uses: actions/checkout@v4
132143
with:
133144
persist-credentials: false
134145
- name: Set up Python
135146
uses: actions/setup-python@v5
136147
with:
137-
python-version: ${{ matrix.python-version }}
148+
python-version: ${{ fromJson('{"default":"3.14","sa14":"3.12"}')[matrix.hatch-env] }}
138149
- name: Upgrade pip and install hatch
139150
run: |
140151
python -m pip install -U uv
141152
python -m uv pip install -U hatch
142-
python -m hatch env create default
153+
python -m hatch env create ${{ matrix.hatch-env }}
143154
- name: Setup parameters file
144155
shell: bash
145156
env:
@@ -151,11 +162,15 @@ jobs:
151162
--pinentry-mode loopback \
152163
--output tests/parameters.py \
153164
.github/workflows/parameters/parameters_${{ matrix.cloud-provider }}.py.gpg
154-
- name: Run tests
165+
- name: Run tests (default)
166+
if: matrix.hatch-env == 'default'
155167
run: hatch run test-dialect-compatibility
168+
- name: Run tests (sa14)
169+
if: matrix.hatch-env == 'sa14'
170+
run: hatch run sa14:test-dialect-compatibility
156171
- uses: actions/upload-artifact@v4
157172
with:
158-
name: coverage.xml_dialect-compatibility-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
173+
name: coverage.xml_dialect-compatibility-${{ matrix.os }}-${{ fromJson('{"default":"3.14","sa14":"3.12"}')[matrix.hatch-env] }}-${{ matrix.cloud-provider }}-${{ matrix.hatch-env }}
159174
path: |
160175
./coverage.xml
161176
@@ -167,7 +182,7 @@ jobs:
167182
fail-fast: false
168183
matrix:
169184
os: [ubuntu-latest, macos-13, windows-latest]
170-
python-version: ["3.8"]
185+
python-version: ["3.12"]
171186
cloud-provider: [aws, azure, gcp]
172187
steps:
173188
- uses: actions/checkout@v4
@@ -212,7 +227,7 @@ jobs:
212227
fail-fast: false
213228
matrix:
214229
os: [ubuntu-latest, macos-13, windows-latest]
215-
python-version: ["3.8"]
230+
python-version: ["3.12"]
216231
cloud-provider: [aws, azure, gcp]
217232
steps:
218233
- uses: actions/checkout@v4
@@ -261,7 +276,7 @@ jobs:
261276
- name: Set up Python
262277
uses: actions/setup-python@v5
263278
with:
264-
python-version: "3.8"
279+
python-version: "3.12"
265280
- name: Prepare environment
266281
run: |
267282
python -m pip install -U uv

DESCRIPTION.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ Snowflake Documentation is available at:
77
Source code is also available at:
88
<https://github.com/snowflakedb/snowflake-sqlalchemy>
99
# Unreleased Notes
10-
- v1.7.8
10+
- v1.8.0
11+
- Add logging of SQLAlchemy version
12+
- Bump `snowflake-connector-python<5.0.0`
13+
- Add python up to 3.14
1114
- Add logging of SQLAlchemy version and pandas (if used)
1215

1316
# Release Notes

pyproject.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ classifiers = [
3030
"Programming Language :: Python :: 3.10",
3131
"Programming Language :: Python :: 3.11",
3232
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
3334
"Programming Language :: SQL",
3435
"Topic :: Database",
3536
"Topic :: Scientific/Engineering :: Information Analysis",
@@ -38,7 +39,7 @@ classifiers = [
3839
"Topic :: Software Development :: Libraries :: Application Frameworks",
3940
"Topic :: Software Development :: Libraries :: Python Modules",
4041
]
41-
dependencies = ["SQLAlchemy>=1.4.19", "snowflake-connector-python<4.0.0"]
42+
dependencies = ["SQLAlchemy>=1.4.19", "snowflake-connector-python<5.0.0"]
4243

4344
[tool.hatch.version]
4445
path = "src/snowflake/sqlalchemy/version.py"
@@ -75,17 +76,17 @@ exclude = ["/.github"]
7576
packages = ["src/snowflake"]
7677

7778
[tool.hatch.envs.default]
78-
path = ".venv"
79-
type = "virtual"
8079
extra-dependencies = ["SQLAlchemy>=1.4.19,<2.1.0"]
8180
features = ["development", "pandas"]
82-
python = "3.8"
81+
python = "3.12"
8382
installer = "uv"
8483

8584
[tool.hatch.envs.sa14]
86-
extra-dependencies = ["SQLAlchemy>=1.4.19,<2.0.0"]
85+
installer = "uv"
86+
builder = true
87+
extra-dependencies = ["SQLAlchemy>=1.4.19,<2.0.0", "pandas<2.1", "numpy<2"]
8788
features = ["development", "pandas"]
88-
python = "3.8"
89+
python = "3.12"
8990

9091
[tool.hatch.envs.sa14.scripts]
9192
test-dialect = "pytest --ignore_v20_test -ra -vvv --tb=short --cov snowflake.sqlalchemy --cov-append --junitxml ./junit.xml --ignore=tests/sqlalchemy_test_suite tests/"
@@ -105,7 +106,7 @@ gh-cache-sum = "python -VV | sha256sum | cut -d' ' -f1"
105106
check-import = "python -c 'import snowflake.sqlalchemy; print(snowflake.sqlalchemy.__version__)'"
106107

107108
[[tool.hatch.envs.release.matrix]]
108-
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
109+
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
109110
features = ["development", "pandas"]
110111

111112
[tool.hatch.envs.release.scripts]

snyk/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
SQLAlchemy>=1.4.19
2-
snowflake-connector-python<4.0.0
2+
snowflake-connector-python<5.0.0

tests/conftest.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import time
1010
import uuid
1111
from logging import getLogger
12+
from typing import Literal
1213

1314
import pytest
1415
from sqlalchemy import create_engine
@@ -98,6 +99,9 @@ def help():
9899

99100
logger = getLogger(__name__)
100101

102+
TZ_ENV_VAR: Literal["TZ"] = "TZ"
103+
DEFAULT_TZ_VALUE: Literal["UTC"] = "UTC"
104+
101105
DEFAULT_PARAMETERS = {
102106
"account": "<account_name>",
103107
"user": "<user_name>",
@@ -150,9 +154,12 @@ def get_db_parameters() -> dict:
150154
Sets the db connection parameters
151155
"""
152156
ret = {}
153-
os.environ["TZ"] = "UTC"
154-
if not IS_WINDOWS:
155-
time.tzset()
157+
os.environ[TZ_ENV_VAR] = DEFAULT_TZ_VALUE
158+
if hasattr(time, "tzset"):
159+
if not IS_WINDOWS:
160+
time.tzset()
161+
else:
162+
logger.warning("time.tzset is unavailable on this platform")
156163

157164
ret.update(DEFAULT_PARAMETERS)
158165
ret.update(CONNECTION_PARAMETERS)

tox.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
min_version = 4.0.0
33
envlist = fix_lint,
4-
py{37,38,39,310,311}{,-pandas},
4+
py{37,38,39,310,311,312,313,314}{,-pandas},
55
coverage,
66
skip_missing_interpreters = true
77

@@ -17,6 +17,9 @@ external_wheels =
1717
py39-ci: dist/.whl
1818
py310-ci: dist/.whl
1919
py311-ci: dist/.whl
20+
py312-ci: dist/.whl
21+
py313-ci: dist/.whl
22+
py314-ci: dist/.whl
2023
deps = pip
2124
passenv =
2225
AWS_ACCESS_KEY_ID
@@ -67,7 +70,7 @@ commands = coverage combine
6770
coverage xml -o {toxworkdir}/coverage.xml
6871
coverage html -d {toxworkdir}/htmlcov
6972
;diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml
70-
depends = py37, py38, py39, py310, py311
73+
depends = py37, py38, py39, py310, py311, py312, py313, py314
7174

7275
[testenv:fix_lint]
7376
description = format the code base to adhere to our styles, and complain about what we cannot do automatically

0 commit comments

Comments
 (0)