Skip to content

Commit ffa44c0

Browse files
authored
feat: add support for Python 3.13 & deprecate Python 3.8 (#3045)
* update layer build scripts to support python 3.13 * update dependencies * deprecate python 3.8 * update workflows * typing * pin ray * regenerate poetry.lock * update poetry lock
1 parent 41c6164 commit ffa44c0

File tree

9 files changed

+1746
-1884
lines changed

9 files changed

+1746
-1884
lines changed

.github/workflows/minimal-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python-version: ["3.8", "3.11", "3.12"]
20+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2121
platform: [ubuntu-latest, macos-latest, windows-latest]
2222

2323
env:

awswrangler/opensearch/_write.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,10 @@ def index_documents(
608608
try:
609609
if progressbar:
610610
widgets = [
611-
progressbar.Percentage(),
612-
progressbar.SimpleProgress(format=" (%(value_s)s/%(max_value_s)s)"),
613-
progressbar.Bar(),
614-
progressbar.Timer(),
611+
progressbar.Percentage(), # type: ignore[no-untyped-call]
612+
progressbar.SimpleProgress(format=" (%(value_s)s/%(max_value_s)s)"), # type: ignore[no-untyped-call]
613+
progressbar.Bar(), # type: ignore[no-untyped-call]
614+
progressbar.Timer(), # type: ignore[no-untyped-call]
615615
]
616616
progress_bar = progressbar.ProgressBar(
617617
widgets=widgets, max_value=total_documents, prefix="Indexing: "

building/build-lambda-layers.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,6 @@ pushd lambda
2121
# Building all related docker images
2222
./build-docker-images.sh $PYTHON_VERSION
2323

24-
# Python 3.8
25-
if [[ $PYTHON_VERSION == "ALL" || $PYTHON_VERSION == "3.8" ]]
26-
then
27-
docker run \
28-
--volume "$DIR_NAME":/aws-sdk-pandas/ \
29-
--workdir /aws-sdk-pandas/building/lambda \
30-
--rm \
31-
awswrangler-build-py38 \
32-
build-lambda-layer.sh "${VERSION}-py3.8${ARCH_SUFFIX}" "ninja-build"
33-
fi
34-
3524
# Python 3.9
3625
if [[ $PYTHON_VERSION == "ALL" || $PYTHON_VERSION == "3.9" ]]
3726
then
@@ -75,3 +64,14 @@ then
7564
awswrangler-build-py312 \
7665
build-lambda-layer.sh "${VERSION}-py3.12${ARCH_SUFFIX}" "ninja-build"
7766
fi
67+
68+
# Python 3.13
69+
if [[ $PYTHON_VERSION == "ALL" || $PYTHON_VERSION == "3.13" ]]
70+
then
71+
docker run \
72+
--volume "$DIR_NAME":/aws-sdk-pandas/ \
73+
--workdir /aws-sdk-pandas/building/lambda \
74+
--rm \
75+
awswrangler-build-py313 \
76+
build-lambda-layer.sh "${VERSION}-py3.13${ARCH_SUFFIX}" "ninja-build"
77+
fi

building/lambda/build-docker-images.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ export DOCKER_BUILDKIT=1
88

99
PYTHON_VERSION=${1:-ALL}
1010

11-
# Python 3.8
12-
if [[ $PYTHON_VERSION == "ALL" || $PYTHON_VERSION == "3.8" ]]
13-
then
14-
docker build \
15-
--pull \
16-
--tag awswrangler-build-py38 \
17-
--build-arg base_image=public.ecr.aws/lambda/python:3.8 \
18-
.
19-
fi
20-
2111
# Python 3.9
2212
if [[ $PYTHON_VERSION == "ALL" || $PYTHON_VERSION == "3.9" ]]
2313
then
@@ -59,4 +49,15 @@ then
5949
.
6050
fi
6151

52+
# Python 3.13
53+
if [[ $PYTHON_VERSION == "ALL" || $PYTHON_VERSION == "3.13" ]]
54+
then
55+
docker build \
56+
--pull \
57+
--tag awswrangler-build-py313 \
58+
--build-arg base_image=public.ecr.aws/lambda/python:3.13 \
59+
--file Dockerfile.al2023 \
60+
.
61+
fi
62+
6263
rm -rf pyproject.toml poetry.lock

poetry.lock

Lines changed: 1700 additions & 1835 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,25 @@ documentation = "https://aws-sdk-pandas.readthedocs.io/"
1818
keywords = ["pandas", "aws"]
1919

2020
classifiers = [
21-
"Programming Language :: Python :: 3.8",
2221
"Programming Language :: Python :: 3.9",
2322
"Programming Language :: Python :: 3.10",
2423
"Programming Language :: Python :: 3.11",
2524
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
2626
]
2727

2828
[tool.poetry.dependencies]
29-
python = ">=3.8, <4.0"
29+
python = ">=3.9, <4.0"
3030

3131
# Required
3232
boto3 = "^1.20.32"
3333
botocore = "^1.23.32"
34-
pandas = [
35-
{ version = ">=1.2.0,<2.1.0", markers = "python_version < \"3.9\"" },
36-
{ version = ">=1.2.0,<3.0.0", markers = "python_version >= \"3.9\"" },
34+
pandas = { version = ">=1.2.0,<3.0.0" }
35+
numpy = { version = ">=1.26,<3.0" }
36+
pyarrow = [
37+
{ version = ">=8.0.0,<18.0.0", markers = "python_version < \"3.13\"" },
38+
{ version = ">=18.0.0", markers = "python_version >= \"3.13\"" }
3739
]
38-
numpy = [
39-
{ version = ">=1.18,<2.0", markers = "python_version < \"3.9\"" },
40-
{ version = ">=1.26,<3.0", markers = "python_version >= \"3.9\"" }
41-
]
42-
pyarrow = ">=8.0.0"
4340
typing-extensions = "^4.4.0"
4441
packaging = ">=21.1,<25.0"
4542

@@ -75,11 +72,8 @@ geopandas = [
7572
]
7673

7774
# Distributed
78-
modin = [
79-
{ version = "0.23.1post0", markers = "python_version < \"3.9\"", optional = true },
80-
{ version = "^0.31.0", markers = "python_version >= \"3.9\"", optional = true }
81-
]
82-
ray = { version = "^2.30.0", extras = ["default", "data"], optional = true }
75+
modin = { version = "^0.31.0", optional = true }
76+
ray = { version = ">=2.30.0,<2.38.0", extras = ["default", "data"], optional = true }
8377

8478
[tool.poetry.extras]
8579
redshift = ["redshift-connector"]
@@ -182,7 +176,7 @@ max-returns=6 # Maximum number of return / yield for function / method body.
182176
max-statements=50 # Maximum number of statements in function / method body.
183177

184178
[tool.mypy]
185-
python_version = "3.8"
179+
python_version = "3.9"
186180
strict = true
187181
ignore_missing_imports = true
188182
warn_unused_ignores = true

test_infra/poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test_infra/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["Amazon Web Services"]
66
license = "Apache License 2.0"
77

88
[tool.poetry.dependencies]
9-
python = ">=3.8, <4.0"
9+
python = ">=3.9, <4.0"
1010
"aws-cdk-lib" = "^2.128.0"
1111
"aws-cdk.aws-glue-alpha" = "^2.128.0a0"
1212
"aws-cdk.aws-neptune-alpha" = "^2.128.0a0"

tox.ini

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{37,38,39,310,311,312}
2+
envlist = py{39,310,311,312,313}
33
isolated_build = True
44

55
[testenv]
@@ -11,7 +11,9 @@ passenv =
1111
AWS_SESSION_TOKEN
1212
setenv =
1313
COV_FAIL_UNDER = 87.00
14-
allowlist_externals = poetry
14+
allowlist_externals =
15+
pytest
16+
poetry
1517
commands_pre =
1618
poetry install --no-root --sync --extras "deltalake gremlin mysql opencypher opensearch oracle postgres redshift sparql sqlserver geopandas"
1719
commands =
@@ -21,7 +23,7 @@ commands =
2123
--dist load --maxschedchunk 2 \
2224
--junitxml=test-reports/junit.xml --log-file=test-reports/logs.txt tests/unit
2325

24-
[testenv:py{37,38,39,310,311}-distributed]
26+
[testenv:py{39,310,311,312,313}-distributed]
2527
passenv =
2628
AWS_PROFILE
2729
AWS_DEFAULT_REGION

0 commit comments

Comments
 (0)