Skip to content

Commit 93c9b69

Browse files
authored
SNOW-997139: Support Python 3.12 (#1841)
1 parent 85d621c commit 93c9b69

33 files changed

+178
-101
lines changed

.github/workflows/build_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
strategy:
5353
matrix:
54-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
54+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
5555
steps:
5656
- uses: actions/checkout@v3
5757
- name: Set up Python
@@ -80,7 +80,7 @@ jobs:
8080
id: macosx_x86_64
8181
- image: macos-latest
8282
id: macosx_arm64
83-
python-version: ["3.8", "3.9", "3.10", "3.11"]
83+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
8484
name: Build ${{ matrix.os.id }}-py${{ matrix.python-version }}
8585
runs-on: ${{ matrix.os.image }}
8686
steps:
@@ -96,7 +96,7 @@ jobs:
9696
platforms: all
9797
- uses: actions/checkout@v3
9898
- name: Building wheel
99-
uses: pypa/cibuildwheel@v2.12.0
99+
uses: pypa/cibuildwheel@v2.16.2
100100
env:
101101
CIBW_BUILD: cp${{ env.shortver }}-${{ matrix.os.id }}
102102
MACOSX_DEPLOYMENT_TARGET: 10.14 # Should be kept in sync with ci/build_darwin.sh
@@ -124,7 +124,7 @@ jobs:
124124
download_name: macosx_x86_64
125125
- image_name: windows-2019
126126
download_name: win_amd64
127-
python-version: ["3.8", "3.9", "3.10", "3.11"]
127+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
128128
cloud-provider: [aws, azure, gcp]
129129
steps:
130130
- uses: actions/checkout@v3
@@ -289,7 +289,7 @@ jobs:
289289
strategy:
290290
fail-fast: false
291291
matrix:
292-
python-version: ["3.8", "3.9", "3.10", "3.11"]
292+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
293293
cloud-provider: [aws]
294294
steps:
295295
- name: Set shortver

.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.8", "3.9", "3.10", "3.11"]
12+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1313
steps:
1414
- uses: actions/checkout@v3
1515
- name: Set up Python

DESCRIPTION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
1212

1313
- Added a new boolean parameter `force_return_table` to `SnowflakeCursor.fetch_arrow_all` to force returning `pyarrow.Table` in case of zero rows.
1414
- Cleanup some C++ code warnings and performance issues.
15+
- Added support for Python 3.12
1516

1617
- v3.6.0(December 09,2023)
1718

Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ timestamps {
5151
'Test Python 39': { build job: 'RT-PyConnector39-PC',parameters: params},
5252
'Test Python 310': { build job: 'RT-PyConnector310-PC',parameters: params},
5353
'Test Python 311': { build job: 'RT-PyConnector311-PC',parameters: params},
54+
'Test Python 312': { build job: 'RT-PyConnector312-PC',parameters: params},
5455
)
5556
}
5657
}

ci/build_darwin.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# - To compile only a specific version(s) pass in versions like: `./build_darwin.sh "3.8 3.9"`
66
arch=$(uname -m)
77
if [[ "$arch" == "arm64" ]]; then
8-
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11}"
8+
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11 3.12}"
99
else
10-
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11}"
10+
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11 3.12}"
1111
fi
1212

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

ci/build_linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set -o pipefail
88

99
U_WIDTH=16
10-
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11}"
10+
PYTHON_VERSIONS="${1:-3.8 3.9 3.10 3.11 3.12}"
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
SET SCRIPT_DIR=%~dp0
77
SET CONNECTOR_DIR=%~dp0\..\
88

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

1111
cd %CONNECTOR_DIR%
1212

ci/docker/connector_build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ 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"
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"
1818

1919
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

ci/docker/connector_test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ RUN chmod +x /usr/local/bin/entrypoint.sh
1212

1313
WORKDIR /home/user
1414
RUN chmod 777 /home/user
15-
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/"
15+
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/"
1616

1717
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM public.ecr.aws/lambda/python:3.12-x86_64
2+
3+
WORKDIR /home/user/snowflake-connector-python
4+
RUN chmod 777 /home/user/snowflake-connector-python
5+
ENV PATH="${PATH}:/opt/python/cp312-cp312/bin/"
6+
ENV PYTHONPATH="${PYTHONPATH}:/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/"
7+
8+
RUN pip3 install -U pip setuptools wheel tox tox-external_wheels
9+
10+
CMD [ "app.handler" ]

0 commit comments

Comments
 (0)