Skip to content

Commit 93e09b2

Browse files
authored
feat: add Python 3.13 support (#350)
- Update Python version requirements and package metadata classifiers for Python 3.13 - Update CI workflow to test Python 3.13 - Enable Python 3.13 wheel-building using manylinux_2_28 (glibc 2.28+) - Pin Python 3.13.2 for macOS to mitigate multiprocessing resource tracker cleanup issues
1 parent f34fce7 commit 93e09b2

File tree

9 files changed

+80
-13
lines changed

9 files changed

+80
-13
lines changed

.github/workflows/python-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2020

2121
steps:
2222
- name: Checkout code

.github/workflows/python-integration.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
runner: [ ubuntu-22.04, macos-13 ]
28-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
27+
runner: [ubuntu-22.04, macos-13, macos-14]
28+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2929
test-run:
3030
- name: "S3"
3131
bucket: ${{ vars.S3_BUCKET }}
@@ -41,6 +41,20 @@ jobs:
4141
endpoint-url: ""
4242
profile-role: ${{ vars.PROFILE_IAM_ROLE }}
4343
profile-bucket: ${{ vars.S3_EXPRESS_PROFILE_BUCKET }}
44+
exclude:
45+
# For Python 3.13, PyTorch does not support macos-13/x86_64, only macos-14/arm64.
46+
- runner: macos-13
47+
python-version: "3.13"
48+
- runner: macos-14
49+
python-version: "3.8"
50+
- runner: macos-14
51+
python-version: "3.9"
52+
- runner: macos-14
53+
python-version: "3.10"
54+
- runner: macos-14
55+
python-version: "3.11"
56+
- runner: macos-14
57+
python-version: "3.12"
4458
permissions:
4559
id-token: write
4660
contents: read

.github/workflows/wheels.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- cp310
3535
- cp311
3636
- cp312
37+
- cp313
3738
builder:
3839
- runner: codebuild-${{ vars.CODEBUILD_PROJECT_NAME }}-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large
3940
kind: manylinux
@@ -50,6 +51,13 @@ jobs:
5051
- runner: macos-14
5152
kind: macosx
5253
arch: arm64
54+
# cp313 macos-13 (x86_64) is not supported by PyTorch
55+
exclude:
56+
- python: cp313
57+
builder:
58+
runner: macos-13
59+
kind: macosx
60+
arch: x86_64
5361
permissions:
5462
id-token: write
5563
contents: read
@@ -100,8 +108,6 @@ jobs:
100108
# Run cibuildwheel manually, as the current runner uses setup-python
101109
# https://github.com/pypa/cibuildwheel/issues/1623
102110
- run: >
103-
CIBW_MANYLINUX_X86_64_IMAGE=manylinux2014
104-
CIBW_MANYLINUX_AARCH64_IMAGE=manylinux2014
105111
python -m pipx run
106112
cibuildwheel
107113
"s3torchconnectorclient"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## TBD
22

33
### New features
4+
* Add support for Python 3.13
45

56
### Bug fixes
67

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Amazon S3, without first saving to local storage.
1919

2020
### Prerequisites
2121

22-
- Python 3.8-3.12 is supported.
22+
- Python 3.8-3.13 is supported.
2323
- PyTorch >= 2.0 (TODO: Check with PyTorch 1.x)
2424

2525
### Installation

run_cibuildwheel_on_ec2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ export PROFILE_IAM_ROLE=${PROFILE_IAM_ROLE}
3737
export S3_PROFILE_BUCKET=${S3_PROFILE_BUCKET}
3838
export S3_EXPRESS_PROFILE_BUCKET=${S3_EXPRESS_PROFILE_BUCKET}
3939

40-
CIBW_MANYLINUX_X86_64_IMAGE=manylinux2014 CIBW_MANYLINUX_AARCH64_IMAGE=manylinux2014 cibuildwheel --output-dir wheelhouse --platform linux s3torchconnectorclient
40+
cibuildwheel --output-dir wheelhouse --platform linux s3torchconnectorclient

s3torchbenchmarking/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "s3torchbenchmarking"
77
version = "0.0.1"
88
description = "Tools to run and compare benchmarks against various PyTorch connectors like the s3torchconnector."
9-
requires-python = ">=3.8,<3.13"
9+
requires-python = ">=3.8,<3.14"
1010
readme = "README.md"
1111
dependencies = [
1212
"s3torchconnector[lightning,dcp]",

s3torchconnector/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "s3torchconnector"
77
version = "1.4.2"
88
description = "S3 connector integration for PyTorch"
9-
requires-python = ">=3.8,<3.13"
9+
requires-python = ">=3.8,<3.14"
1010
readme = "README.md"
1111
classifiers = [
1212
"Development Status :: 5 - Production/Stable",
@@ -16,6 +16,7 @@ classifiers = [
1616
"Programming Language :: Python :: 3.10",
1717
"Programming Language :: Python :: 3.11",
1818
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
1920
"License :: OSI Approved :: BSD License",
2021
"Operating System :: OS Independent",
2122
"Topic :: Utilities"

s3torchconnectorclient/pyproject.toml

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "s3torchconnectorclient"
77
version = "1.4.2"
88
description = "Internal S3 client implementation for s3torchconnector"
9-
requires-python = ">=3.8,<3.13"
9+
requires-python = ">=3.8,<3.14"
1010
readme = "README.md"
1111
classifiers = [
1212
"Development Status :: 5 - Production/Stable",
@@ -16,6 +16,7 @@ classifiers = [
1616
"Programming Language :: Python :: 3.10",
1717
"Programming Language :: Python :: 3.11",
1818
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
1920
"License :: OSI Approved :: BSD License",
2021
"Operating System :: OS Independent",
2122
"Topic :: Utilities"
@@ -75,10 +76,13 @@ environment-pass = [
7576
"S3_EXPRESS_PROFILE_BUCKET"
7677
]
7778
before-build = "cp README.md s3torchconnectorclient; cp LICENSE s3torchconnectorclient/; cp THIRD-PARTY-LICENSES s3torchconnectorclient/; cp NOTICE s3torchconnectorclient/"
78-
build = ["cp38*", "cp39*", "cp310*", "cp311*", "cp312*"]
79-
skip = "*musllinux* *i686"
79+
build = ["cp38*", "cp39*", "cp310*", "cp311*", "cp312*", "cp313*"]
80+
skip = "*musllinux* *i686 cp313-macosx_x86_64*"
8081

8182
[tool.cibuildwheel.linux]
83+
# Python 3.8-3.12: Use manylinux2014 (glibc 2.17)
84+
manylinux-x86_64-image = "manylinux2014"
85+
manylinux-aarch64-image = "manylinux2014"
8286
before-all = [
8387
"curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y",
8488
"bash -c 'platform=$(uname -p); if [ \"$platform\" == \"aarch64\" ]; then sed -i \"s|centos/7|altarch/7|g\" /etc/yum.repos.d/*.repo; fi'",
@@ -93,7 +97,38 @@ before-all = [
9397
"yum install -y devtoolset-10-gcc-c++",
9498
"yum install -y llvm-toolset-7.0-clang"
9599
]
96-
environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/devtoolset-10/root/usr/bin:$HOME/.cargo/bin:$PATH", LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib", CC="/opt/rh/devtoolset-10/root/usr/bin/gcc", CXX="/opt/rh/devtoolset-10/root/usr/bin/g++" }
100+
[tool.cibuildwheel.linux.environment]
101+
PATH = "/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/devtoolset-10/root/usr/bin:$HOME/.cargo/bin:$PATH"
102+
LD_LIBRARY_PATH = "/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib"
103+
CC = "/opt/rh/devtoolset-10/root/usr/bin/gcc"
104+
CXX = "/opt/rh/devtoolset-10/root/usr/bin/g++"
105+
106+
[[tool.cibuildwheel.overrides]]
107+
# Python 3.13: Use manylinux_2_28 (glibc 2.28)
108+
select = "cp313-*manylinux*"
109+
manylinux-x86_64-image = "manylinux_2_28"
110+
manylinux-aarch64-image = "manylinux_2_28"
111+
before-all = [
112+
"yum -y update",
113+
"yum -y install openssl3 openssl3-devel",
114+
"yum install -y gcc-toolset-10-gcc",
115+
"yum install -y gcc-toolset-10-gcc-c++",
116+
"yum install -y clang clang-devel llvm-toolset",
117+
"curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y",
118+
"bash -c 'platform=$(uname -p); if [ \"$platform\" == \"aarch64\" ]; then sed -i \"s|centos/7|altarch/7|g\" /etc/yum.repos.d/*.repo; fi'",
119+
"yum install -y fuse",
120+
"yum install -y fuse-devel",
121+
"yum install -y make",
122+
"yum install -y git",
123+
"yum install -y pkgconfig",
124+
"yum install -y tar",
125+
"yum install -y wget"
126+
]
127+
[tool.cibuildwheel.overrides.environment]
128+
PATH = "/usr/lib64/ccache:/usr/lib64/llvm:/opt/rh/gcc-toolset-10/root/usr/bin:$HOME/.cargo/bin:$PATH"
129+
LD_LIBRARY_PATH = "/usr/lib64/llvm:/opt/rh/gcc-toolset-10/root/usr/lib64:/opt/rh/gcc-toolset-10/root/usr/lib:$LD_LIBRARY_PATH"
130+
CC = "/opt/rh/gcc-toolset-10/root/usr/bin/gcc"
131+
CXX = "/opt/rh/gcc-toolset-10/root/usr/bin/g++"
97132

98133
[tool.cibuildwheel.macos]
99134
environment = { MACOSX_DEPLOYMENT_TARGET = "10.12" }
@@ -121,3 +156,13 @@ before-all = [
121156
"sudo installer -pkg /tmp/Python3129.pkg -target /",
122157
"sh '/Applications/Python 3.12/Install Certificates.command'"
123158
]
159+
160+
[[tool.cibuildwheel.overrides]]
161+
# Same issue as above - Using CPython 3.13.2 for MacOS to mitigate resource tracker hanging issue
162+
# So far, CPython 3.13.3, 3.13.4, 3.13.5 are identified to be affected by this issue
163+
select = "cp313-macosx*"
164+
before-all = [
165+
"curl -o /tmp/Python3132.pkg https://www.python.org/ftp/python/3.13.2/python-3.13.2-macos11.pkg",
166+
"sudo installer -pkg /tmp/Python3132.pkg -target /",
167+
"sh '/Applications/Python 3.13/Install Certificates.command'"
168+
]

0 commit comments

Comments
 (0)