Skip to content

Commit e60d6cb

Browse files
authored
[feat] Add Python 3.12 builds (#3161)
1 parent dc0baaf commit e60d6cb

File tree

7 files changed

+67
-28
lines changed

7 files changed

+67
-28
lines changed

.github/workflows/python-package.yml

+44-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
runs-on: ubuntu-latest
6464
strategy:
6565
matrix:
66-
manylinux-version: ['manylinux2014_x86_64', 'manylinux_2_24_x86_64']
66+
manylinux-version: ['manylinux2014_x86_64', 'manylinux_2_24_x86_64', 'manylinux_2_28_x86_64']
6767
name: Linux wheels build (using Docker) ${{ matrix.manylinux-version }}
6868
needs: aim-ui-dist
6969
steps:
@@ -95,14 +95,54 @@ jobs:
9595
python -m pip install -r requirements.dev.txt
9696
python -m pip install -r requirements.txt
9797
98-
- name: Build bdist wheels
98+
- name: Build bdist wheels for 'cp37-cp37m'
9999
uses: nick-fields/retry@v2
100100
with:
101101
max_attempts: 3
102102
timeout_minutes: 30
103103
retry_wait_seconds: 60
104-
command: docker run --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh
104+
command: docker run -e PYTHON_VERSION='cp37-cp37m' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh
105105

106+
- name: Build bdist wheels for 'cp38-cp38'
107+
uses: nick-fields/retry@v2
108+
with:
109+
max_attempts: 3
110+
timeout_minutes: 30
111+
retry_wait_seconds: 60
112+
command: docker run -e PYTHON_VERSION='cp38-cp38' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh
113+
114+
- name: Build bdist wheels for 'cp39-cp39'
115+
uses: nick-fields/retry@v2
116+
with:
117+
max_attempts: 3
118+
timeout_minutes: 30
119+
retry_wait_seconds: 60
120+
command: docker run -e PYTHON_VERSION='cp39-cp39' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh
121+
122+
- name: Build bdist wheels for 'cp310-cp310'
123+
uses: nick-fields/retry@v2
124+
with:
125+
max_attempts: 3
126+
timeout_minutes: 30
127+
retry_wait_seconds: 60
128+
command: docker run -e PYTHON_VERSION='cp310-cp310' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh
129+
130+
- name: Build bdist wheels for 'cp311-cp311'
131+
uses: nick-fields/retry@v2
132+
with:
133+
max_attempts: 3
134+
timeout_minutes: 30
135+
retry_wait_seconds: 60
136+
command: docker run -e PYTHON_VERSION='cp311-cp311' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh
137+
138+
- name: Build bdist wheels for 'cp312-cp312'
139+
if: matrix.manylinux-version == 'manylinux_2_28_x86_64'
140+
uses: nick-fields/retry@v2
141+
with:
142+
max_attempts: 3
143+
timeout_minutes: 30
144+
retry_wait_seconds: 60
145+
command: docker run -e PYTHON_VERSION='cp312-cp312' --mount type=bind,source=$PWD,target=/opt/aim quay.io/pypa/${{ matrix.manylinux-version }} bash /opt/aim/docker/build-wheels.sh
106146

107147
- name: Publish wheels
108148
env:
@@ -130,7 +170,7 @@ jobs:
130170
strategy:
131171
fail-fast: false
132172
matrix:
133-
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
173+
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
134174
arch: ['arm64', 'x86_64']
135175
exclude:
136176
- arch: 'arm64'

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Enhancements:
66
- Add feature to delete full experiments (mauricekraus)
7+
- Add support for python 3.12 (mahnerak)
78

89
## 3.20.1 Jun 3, 2024
910

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM python:3.9.10-slim
22

33
ARG AIM_VERSION
4-
RUN pip install Cython==3.0.0a9
4+
RUN pip install Cython==3.0.10
55
RUN pip install aim==$AIM_VERSION
66

77
WORKDIR /opt/aim

docker/build-wheels.sh

+17-19
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,24 @@ set -e
33

44
cd /opt/aim
55

6-
echo "build python wheels"
7-
for python_version in 'cp37-cp37m' 'cp38-cp38' 'cp39-cp39' 'cp310-cp310' 'cp311-cp311'
8-
do
9-
export PATH=/opt/python/${python_version}/bin:$PATH
10-
echo "build wheels for ${PYTHON_VERSION}"
11-
python -m build
12-
pip install dist/*${python_version}*.whl
13-
pip install git+https://github.com/aimhubio/auditwheel.git@include-exclude
14-
export LIB_DIR=`python -c "from aimrocks import lib_utils; print(lib_utils.get_lib_dir())"`
15-
export LIBS_BUNDLED=`ls ${LIB_DIR}/ \
16-
| grep .so \
17-
| sed -r 's/^(lib.*?\.so)\.*?$/\1/g' \
18-
| uniq \
19-
| paste -s -d','`
20-
export LD_LIBRARY_PATH=$LIB_DIR:$LD_LIBRARY_PATH
21-
auditwheel repair \
22-
--exclude $LIBS_BUNDLED --wheel-dir multilinux_dist \
23-
dist/*${python_version}*.whl
6+
export PATH=/opt/python/${PYTHON_VERSION}/bin:$PATH
7+
python -m pip cache purge
8+
echo "build wheels for ${PYTHON_VERSION}"
9+
python -m pip install build
10+
python -m build
11+
pip install dist/*${PYTHON_VERSION}*.whl
12+
pip install git+https://github.com/aimhubio/auditwheel.git@include-exclude-new
13+
export LIB_DIR=`python -c "from aimrocks import lib_utils; print(lib_utils.get_lib_dir())"`
14+
export LIBS_BUNDLED=`ls ${LIB_DIR}/ \
15+
| grep .so \
16+
| sed -r 's/^(lib.*?\.so)\.*?$/\1/g' \
17+
| uniq \
18+
| paste -s -d','`
19+
export LD_LIBRARY_PATH=$LIB_DIR:$LD_LIBRARY_PATH
20+
auditwheel repair \
21+
--exclude $LIBS_BUNDLED --wheel-dir multilinux_dist \
22+
dist/*${PYTHON_VERSION}*.whl
2423

25-
done
2624

2725
echo "python wheels build. SUCCESS"
2826
echo "DONE"

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ sphinx
33
sphinx_rtd_theme
44
m2r2==0.3.3.post2
55
sphinx-copybutton
6-
Cython==3.0.0a9
6+
Cython==3.0.10
77

88
-r ./../requirements.txt

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build-system]
2-
requires = ["setuptools", "cython == 3.0.0a11", "aimrocks == 0.4.0"]
2+
requires = ["setuptools", "cython == 3.0.10", "aimrocks == 0.5.*"]

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ def package_files(directory):
4545
LONG_DESCRIPTION = readme_text.strip()
4646

4747
SETUP_REQUIRED = [
48-
'Cython==3.0.0a11',
48+
'Cython==3.0.10',
4949
]
5050

5151
# What packages are required for this module to be executed?
5252
REQUIRED = [
5353
f'aim-ui=={__version__}',
5454
'aimrecords==0.0.7',
55-
'aimrocks==0.4.0',
55+
'aimrocks==0.5.*',
5656
'cachetools>=4.0.0',
5757
'click>=7.0',
5858
'cryptography>=3.0',

0 commit comments

Comments
 (0)