Skip to content

Commit 888e479

Browse files
SNOW-1763673 python3.13 support (#2239)
Co-authored-by: Mark Keller <[email protected]> (cherry picked from commit ac24917)
1 parent db88a5b commit 888e479

34 files changed

+225
-146
lines changed

.github/workflows/build_test.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set up Python
3333
uses: actions/setup-python@v4
3434
with:
35-
python-version: '3.8'
35+
python-version: '3.9'
3636
- name: Display Python version
3737
run: python -c "import sys; import os; print(\"\n\".join(os.environ[\"PATH\"].split(os.pathsep))); print(sys.version); print(sys.executable);"
3838
- name: Upgrade setuptools, pip and wheel
@@ -53,7 +53,7 @@ jobs:
5353
runs-on: ubuntu-latest
5454
strategy:
5555
matrix:
56-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
56+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
5757
steps:
5858
- uses: actions/checkout@v4
5959
- name: Set up Python
@@ -82,7 +82,7 @@ jobs:
8282
id: macosx_x86_64
8383
- image: macos-latest
8484
id: macosx_arm64
85-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
85+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
8686
name: Build ${{ matrix.os.id }}-py${{ matrix.python-version }}
8787
runs-on: ${{ matrix.os.image }}
8888
steps:
@@ -98,7 +98,7 @@ jobs:
9898
platforms: all
9999
- uses: actions/checkout@v4
100100
- name: Building wheel
101-
uses: pypa/cibuildwheel@v2.16.5
101+
uses: pypa/cibuildwheel@v2.21.3
102102
env:
103103
CIBW_BUILD: cp${{ env.shortver }}-${{ matrix.os.id }}
104104
MACOSX_DEPLOYMENT_TARGET: 10.14 # Should be kept in sync with ci/build_darwin.sh
@@ -127,8 +127,17 @@ jobs:
127127
download_name: macosx_x86_64
128128
- image_name: windows-latest
129129
download_name: win_amd64
130-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
130+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
131131
cloud-provider: [aws, azure, gcp]
132+
# TODO: When there are prebuilt wheels accessible for our dependencies (i.e. numpy)
133+
# for Python 3.13 windows runs can be re-enabled. Currently, according to numpy:
134+
# "Numpy built with MINGW-W64 on Windows 64 bits is experimental, and only available for
135+
# testing. You are advised not to use it for production."
136+
exclude:
137+
- os:
138+
image_name: windows-latest
139+
download_name: win_amd64
140+
python-version: "3.13"
132141
steps:
133142
- uses: actions/checkout@v4
134143
- name: Set up Python
@@ -192,9 +201,11 @@ jobs:
192201
fail-fast: false
193202
matrix:
194203
os:
195-
- image_name: ubuntu-latest
204+
# Because old the version 3.0.2 of snowflake-connector-python depends on oscrypto which causes conflicts with higher versions of libssl
205+
# TODO: It can be changed to ubuntu-latest, when python sf connector version in tox is above 3.4.0
206+
- image_name: ubuntu-20.04
196207
download_name: linux
197-
python-version: [3.8]
208+
python-version: [3.9]
198209
cloud-provider: [aws]
199210
steps:
200211
- uses: actions/checkout@v4
@@ -233,7 +244,7 @@ jobs:
233244
os:
234245
- image_name: ubuntu-latest
235246
download_name: linux
236-
python-version: [3.8]
247+
python-version: [3.9]
237248
cloud-provider: [aws]
238249
steps:
239250
- uses: actions/checkout@v4
@@ -256,7 +267,7 @@ jobs:
256267
shell: bash
257268

258269
test-fips:
259-
name: Test FIPS linux-3.8-${{ matrix.cloud-provider }}
270+
name: Test FIPS linux-3.9-${{ matrix.cloud-provider }}
260271
needs: build
261272
runs-on: ubuntu-latest
262273
strategy:
@@ -275,23 +286,23 @@ jobs:
275286
- name: Download wheel(s)
276287
uses: actions/download-artifact@v4
277288
with:
278-
name: manylinux_x86_64_py3.8
289+
name: manylinux_x86_64_py3.9
279290
path: dist
280291
- name: Show wheels downloaded
281292
run: ls -lh dist
282293
shell: bash
283294
- name: Run tests
284295
run: ./ci/test_fips_docker.sh
285296
env:
286-
PYTHON_VERSION: 3.8
297+
PYTHON_VERSION: 3.9
287298
cloud_provider: ${{ matrix.cloud-provider }}
288299
PYTEST_ADDOPTS: --color=yes --tb=short
289300
TOX_PARALLEL_NO_SPINNER: 1
290301
shell: bash
291302
- uses: actions/upload-artifact@v4
292303
with:
293304
include-hidden-files: true
294-
name: coverage_linux-fips-3.8-${{ matrix.cloud-provider }}
305+
name: coverage_linux-fips-3.9-${{ matrix.cloud-provider }}
295306
path: |
296307
.coverage
297308
coverage.xml
@@ -303,7 +314,7 @@ jobs:
303314
strategy:
304315
fail-fast: false
305316
matrix:
306-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
317+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
307318
cloud-provider: [aws]
308319
steps:
309320
- name: Set shortver
@@ -447,7 +458,7 @@ jobs:
447458
- name: Set up Python
448459
uses: actions/setup-python@v4
449460
with:
450-
python-version: '3.8'
461+
python-version: '3.9'
451462
- name: Display Python version
452463
run: python -c "import sys; print(sys.version)"
453464
- name: Upgrade setuptools and pip

.github/workflows/create_req_files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: ["3.9", "3.10", "3.11", "3.12"]
12+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1313
steps:
1414
- uses: actions/checkout@v3
1515
- name: Set up Python

DESCRIPTION.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,50 @@ https://docs.snowflake.com/
77
Source code is also available at: https://github.com/snowflakedb/snowflake-connector-python
88

99
# Release Notes
10+
- v3.14.1(TBD)
11+
- Added support for Python 3.13.
12+
- NOTE: Windows 64 support is still experimental and should not yet be used for production environments.
13+
- Dropped support for Python 3.8.
14+
- Basic decimal floating-point type support.
15+
- Added handling of PAT provided in `password` field.
16+
- Improved error message for client-side query cancellations due to timeouts.
17+
- Added support of GCS regional endpoints.
18+
- Added `gcs_use_virtual_endpoints` connection property that forces the usage of the virtual GCS usage. See more: https://cloud.google.com/storage/docs/request-endpoints#xml-api
19+
- Fixed a bug that caused driver to fail silently on `TO_DATE` arrow to python conversion when invalid date was followed by the correct one.
20+
- Added `check_arrow_conversion_error_on_every_column` connection property that can be set to `False` to restore previous behaviour in which driver will ignore errors until it occurs in the last column. This flag's purpose is to unblock workflows that may be impacted by the bugfix and will be removed in later releases.
21+
22+
- v3.14.0(March 03, 2025)
23+
- Bumped pyOpenSSL dependency upper boundary from <25.0.0 to <26.0.0.
24+
- Added a <19.0.0 pin to pyarrow as a workaround to a bug affecting Azure Batch.
25+
- Optimized distribution package lookup to speed up import.
26+
- Fixed a bug where privatelink OCSP Cache url could not be determined if privatelink account name was specified in uppercase.
27+
- Added support for iceberg tables to `write_pandas`.
28+
- Fixed base64 encoded private key tests.
29+
- Fixed a bug where file permission check happened on Windows.
30+
- Added support for File types.
31+
- Added `unsafe_file_write` connection parameter that restores the previous behaviour of saving files downloaded with GET with 644 permissions.
32+
- Deprecated `insecure_mode` connection property and replaced it with `disable_ocsp_checks` with the same behavior as the former property.
33+
1034
- v3.13.2(January 29, 2025)
1135
- Changed not to use scoped temporary objects.
1236

13-
- v3.12.4(TBD)
37+
- v3.13.1(January 29, 2025)
38+
- Remedied SQL injection vulnerability in snowflake.connector.pandas_tools.write_pandas. See more https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-2vpq-fh52-j3wv
39+
- Remedied vulnerability in deserialization of the OCSP response cache. See more: https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-m4f6-vcj4-w5mx
40+
- Remedied vulnerability connected to cache files permissions. See more: https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-r2x6-cjg7-8r43
41+
42+
- v3.13.0(January 23,2025)
43+
- Added a feature to limit the sizes of IO-bound ThreadPoolExecutors during PUT and GET commands.
44+
- Updated README.md to include instructions on how to verify package signatures using `cosign`.
45+
- Updated the log level for cursor's chunk rowcount from INFO to DEBUG.
46+
- Added a feature to verify if the connection is still good enough to send queries over.
47+
- Added support for base64-encoded DER private key strings in the `private_key` authentication type.
48+
49+
- v3.12.4(December 3,2024)
1450
- Fixed a bug where multipart uploads to Azure would be missing their MD5 hashes.
51+
- Fixed a bug where OpenTelemetry header injection would sometimes cause Exceptions to be thrown.
52+
- Fixed a bug where OCSP checks would throw TypeError and make mainly GCP blob storage unreachable.
53+
- Bumped pyOpenSSL dependency from >=16.2.0,<25.0.0 to >=22.0.0,<25.0.0.
1554

1655
- v3.12.3(October 25,2024)
1756
- Improved the error message for SSL-related issues to provide clearer guidance when an SSL error occurs.

Jenkinsfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ timestamps {
4747
println("Exception computing commit hash from: ${response}")
4848
}
4949
parallel (
50-
'Test Python 38': { build job: 'RT-PyConnector38-PC',parameters: params},
5150
'Test Python 39': { build job: 'RT-PyConnector39-PC',parameters: params},
5251
'Test Python 310': { build job: 'RT-PyConnector310-PC',parameters: params},
5352
'Test Python 311': { build job: 'RT-PyConnector311-PC',parameters: params},
5453
'Test Python 312': { build job: 'RT-PyConnector312-PC',parameters: params},
54+
'Test Python 313': { build job: 'RT-PyConnector313-PC',parameters: params},
55+
'Test Python 39 OldDriver': { build job: 'RT-PyConnector39-OldDriver-PC',parameters: params},
56+
'Test Python 39 FIPS': { build job: 'RT-FIPS-PyConnector39',parameters: params},
5557
)
5658
}
5759
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using the Snowflake JDBC or ODBC drivers.
1515

1616
The connector has **no** dependencies on JDBC or ODBC.
1717
It can be installed using ``pip`` on Linux, Mac OSX, and Windows platforms
18-
where Python 3.8.0 (or higher) is installed.
18+
where Python 3.9.0 (or higher) is installed.
1919

2020
Snowflake Documentation is available at:
2121
https://docs.snowflake.com/
@@ -27,7 +27,7 @@ https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowfl
2727

2828
### Locally
2929

30-
Install Python 3.8.0 or higher. Clone the Snowflake Connector for Python repository, then run the following commands
30+
Install a supported Python version. Clone the Snowflake Connector for Python repository, then run the following commands
3131
to create a wheel package using PEP-517 build:
3232

3333
```shell
@@ -42,7 +42,7 @@ Find the `snowflake_connector_python*.whl` package in the `./dist` directory.
4242
### In Docker
4343
Or use our Dockerized build script `ci/build_docker.sh` and find the built wheel files in `dist/repaired_wheels`.
4444

45-
Note: `ci/build_docker.sh` can be used to compile only certain versions, like this: `ci/build_docker.sh "3.8 3.9"`
45+
Note: `ci/build_docker.sh` can be used to compile only certain versions, like this: `ci/build_docker.sh "3.9 3.10"`
4646

4747
## Code hygiene and other utilities
4848
These tools are integrated into `tox` to allow us to easily set them up universally on any computer.

ci/build_darwin.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
#
33
# Build Snowflake Python Connector on Mac
44
# NOTES:
5-
# - To compile only a specific version(s) pass in versions like: `./build_darwin.sh "3.8 3.9"`
6-
arch=$(uname -m)
7-
if [[ "$arch" == "arm64" ]]; then
8-
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11 3.12}"
9-
else
10-
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11 3.12}"
11-
fi
5+
# - To compile only a specific version(s) pass in versions like: `./build_darwin.sh "3.9 3.10"`
6+
PYTHON_VERSIONS="${1:-3.9 3.10 3.11 3.12 3.13}"
127

138
THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
149
CONNECTOR_DIR="$(dirname "${THIS_DIR}")"

ci/build_docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Build Snowflake Python Connector in Docker
44
# NOTES:
5-
# - To compile only a specific version(s) pass in versions like: `./build_docker.sh "3.8 3.9"`
5+
# - To compile only a specific version(s) pass in versions like: `./build_docker.sh "3.9 3.10"`
66
set -o pipefail
77

88
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

ci/build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# Build Snowflake Python Connector on Linux
44
# NOTES:
55
# - This is designed to ONLY be called in our build docker image
6-
# - To compile only a specific version(s) pass in versions like: `./build_linux.sh "3.8 3.9"`
6+
# - To compile only a specific version(s) pass in versions like: `./build_linux.sh "3.9 3.10"`
77
set -o pipefail
88

99
U_WIDTH=16
10-
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11 3.12}"
10+
PYTHON_VERSIONS="${1:-3.9 3.10 3.11 3.12 3.13}"
1111
THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1212
CONNECTOR_DIR="$(dirname "${THIS_DIR}")"
1313
DIST_DIR="${CONNECTOR_DIR}/dist"

ci/build_windows.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
SET SCRIPT_DIR=%~dp0
77
SET CONNECTOR_DIR=%~dp0\..\
88

9-
set python_versions= 3.8 3.9 3.10 3.11 3.12
9+
set python_versions= 3.9 3.10 3.11 3.12 3.13
1010

1111
cd %CONNECTOR_DIR%
1212

1313
set venv_dir=%WORKSPACE%\venv-flake8
1414
if %errorlevel% neq 0 goto :error
1515

16-
py -3.8 -m venv %venv_dir%
16+
py -3.9 -m venv %venv_dir%
1717
if %errorlevel% neq 0 goto :error
1818

1919
call %venv_dir%\scripts\activate

ci/docker/connector_build/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ WORKDIR /home/user
1414
RUN chmod 777 /home/user
1515
RUN git clone https://github.com/matthew-brett/multibuild.git && cd /home/user/multibuild && git checkout bfc6d8b82d8c37b8ca1e386081fd800e81c6ab4a
1616

17-
ENV PATH="${PATH}:/opt/python/cp37-cp37m/bin:/opt/python/cp38-cp38/bin:/opt/python/cp39-cp39/bin:/opt/python/cp310-cp310/bin:/opt/python/cp311-cp311/bin:/opt/python/cp312-cp312/bin"
18-
1917
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

0 commit comments

Comments
 (0)