From 7eb3c2bedc3b1a571614bb27ada83d0c176e92c7 Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Thu, 19 Dec 2024 23:37:31 +0800 Subject: [PATCH] ci: support pip3 for python 3.12 and later --- .github/workflows/ci.yml | 8 +++++++- cibw_before_all.sh | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e43642..e154059 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,13 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt-get --assume-yes install cmake swig pkg-config clang libclang-dev llvm wget unzip python3-wheel python3-setuptools build-essential python3-pip && sudo pip3 install meson ninja + sudo apt-get --assume-yes install cmake swig pkg-config clang libclang-dev llvm wget unzip python3-wheel python3-setuptools build-essential python3-pip + pygt311=$(python3 -c 'import sys; print(0) if sys.version_info.minor > 11 else print(1)' 2>&1) + if [[ $pygt311 == '0' ]]; then + sudo pip3 --break-system-packages install meson ninja + else + sudo pip3 install meson ninja + fi - name: Install rizin run: | diff --git a/cibw_before_all.sh b/cibw_before_all.sh index 1d39e9a..77a87ab 100644 --- a/cibw_before_all.sh +++ b/cibw_before_all.sh @@ -4,7 +4,12 @@ set -ex # Install deps -pip3 install meson ninja meson-python build +pygt311=$(python3 -c 'import sys; print(0) if sys.version_info.minor > 11 else print(1)' 2>&1) +if [[ $pygt311 == '0' ]]; then + pip3 install --break-system-packages meson ninja meson-python build +else + pip3 install meson ninja meson-python build +fi if command -v apt; then set +e