From f2c35068bc226bf1692de37c2bf2ed64cf0e86b8 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..4120dc3 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 + python3 -c 'import sys; exit(0) if sys.version_info.minor > 11 else exit(1)' + if [[ $? == 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 ad62290..92f55fb 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 +python3 -c 'import sys; exit(0) if sys.version_info.minor > 11 else exit(1)' +if [[ $? == 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