From 0e9a3e260d0bba2e92e3f6a6a457514a4b25073f Mon Sep 17 00:00:00 2001 From: Christian Heitman Date: Mon, 15 Jul 2024 16:59:31 -0300 Subject: [PATCH] Update Python workflow --- .github/workflows/python.yml | 12 +++++++++++- src/scripts/docker/Dockerfile | 4 ++-- src/scripts/docker/build-wheel-linux.sh | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 5354db03f..21172d910 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -62,7 +62,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] include: - python-version: 3.8 pycp: cp38-cp38 @@ -76,6 +76,12 @@ jobs: - python-version: 3.11 pycp: cp311-cp311 pylib: python311.lib + - python-version: 3.12 + pycp: cp312-cp312 + pylib: python312.lib + - python-version: 3.13 + pycp: cp313-cp313 + pylib: python313.lib steps: - name: Checkout uses: actions/checkout@v3 @@ -155,6 +161,10 @@ jobs: pycp: cp39-cp39 - python-version: 3.10 pycp: cp310-cp310 + # - python-version: 3.11 + # pycp: cp311-cp311 + # - python-version: 3.12 + # pycp: cp312-cp312 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/src/scripts/docker/Dockerfile b/src/scripts/docker/Dockerfile index cf08bac3b..bae7bd2a1 100644 --- a/src/scripts/docker/Dockerfile +++ b/src/scripts/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMG +ARG BASE_IMG=quay.io/pypa/manylinux_2_28_x86_64 FROM $BASE_IMG @@ -41,7 +41,7 @@ RUN echo "[+] Download, build and install Bitwuzla" && \ git clone https://github.com/bitwuzla/bitwuzla.git && \ cd bitwuzla && \ git checkout -b 0.4.0 0.4.0 && \ - export PY310_PATH=$(dirname $(realpath -L $(which python3.10))) && \ + export PY310_PATH=$(python3.10 -c 'import sys, os; print(os.path.dirname(sys.executable))') && \ CC=clang CXX=clang++ PATH=$PATH:$PY310_PATH python3.10 ./configure.py --shared --prefix $(pwd)/install && \ cd build && \ PATH=$PATH:$PY310_PATH ninja -j $(nproc) install diff --git a/src/scripts/docker/build-wheel-linux.sh b/src/scripts/docker/build-wheel-linux.sh index fab3e7794..72879e714 100755 --- a/src/scripts/docker/build-wheel-linux.sh +++ b/src/scripts/docker/build-wheel-linux.sh @@ -71,6 +71,24 @@ export PYTHON_LIBRARY=$($PYTHON_BINARY -c "from sysconfig import get_paths; prin $PYTHON_BINARY -m build --wheel --outdir $WHEEL_DIR/linux_x86_64 +# Build Triton Python wheel package for Python 3.12. +echo "[+] Build Triton wheel package for Python 3.12" +cd $SOURCE_DIR +export PYTHON_BINARY=/opt/_internal/cpython-3.12.*/bin/python +export PYTHON_INCLUDE_DIRS=$($PYTHON_BINARY -c "from sysconfig import get_paths; print(get_paths()['include'])") +export PYTHON_LIBRARY=$($PYTHON_BINARY -c "from sysconfig import get_paths; print(get_paths()['include'])") + +$PYTHON_BINARY -m build --wheel --outdir $WHEEL_DIR/linux_x86_64 + +# Build Triton Python wheel package for Python 3.13. +echo "[+] Build Triton wheel package for Python 3.13" +cd $SOURCE_DIR +export PYTHON_BINARY=/opt/_internal/cpython-3.13.0/bin/python +export PYTHON_INCLUDE_DIRS=$($PYTHON_BINARY -c "from sysconfig import get_paths; print(get_paths()['include'])") +export PYTHON_LIBRARY=$($PYTHON_BINARY -c "from sysconfig import get_paths; print(get_paths()['include'])") + +$PYTHON_BINARY -m build --wheel --outdir $WHEEL_DIR/linux_x86_64 + # Repair wheels. echo "[+] Repair wheel packages" cd $SOURCE_DIR