Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Python workflow #1369

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get install python-setuptools lcov libboost-dev libgmp-dev
sudo apt-get install python3-setuptools lcov libboost-dev libgmp-dev

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get install python-setuptools libboost-dev libgmp-dev
sudo apt-get install python3-setuptools libboost-dev libgmp-dev

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND GCOV)
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target test-python
COMMAND ctest --output-on-failure
COMMAND lcov --no-checksum --directory $<TARGET_FILE_DIR:triton> --capture --output-file coverage.info
COMMAND lcov --remove coverage.info '/usr*' --remove coverage.info 'pintools*' --remove coverage.info 'examples*' -o coverage.info
COMMAND lcov --ignore-errors unused --remove coverage.info '/usr*' --remove coverage.info 'pintools*' --remove coverage.info 'examples*' -o coverage.info
COMMAND genhtml coverage.info -o coverage
COMMAND ${CMAKE_COMMAND} -E echo "-- Report generated in ${CMAKE_CURRENT_BINARY_DIR}/coverage/index.html"
)
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMG
ARG BASE_IMG=quay.io/pypa/manylinux_2_28_x86_64

FROM $BASE_IMG

Expand Down Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions src/scripts/docker/build-wheel-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading