From 28d66003b337b6dbfac63ce89baa06341800053b Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 19 Feb 2025 17:01:55 -0700 Subject: [PATCH] move python packages to requirements.txt platform specific scripts in contrib/CI are expected to be run as root, but python packages should not be automatically installed into the package manager's directories, so they were moved out of the scripts to requirements.txt so that they can be installed separately --- .github/workflows/check.yml | 23 ++++++++++++++++++++--- .github/workflows/rpm.yml | 3 +++ .github/workflows/test.yml | 10 ++++++++++ contrib/CI/centos8.sh | 3 --- contrib/CI/macos.sh | 3 --- contrib/CI/requirements.txt | 2 ++ contrib/CI/rockylinux.sh | 3 --- contrib/CI/ubuntu.sh | 3 --- 8 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 contrib/CI/requirements.txt diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 15ff28da4..282d64402 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -69,6 +69,7 @@ env: CXX: clang++ DEP_INSTALL_PREFIX: ~/.local COMMON_CONFIG: -DCMAKE_C_FLAGS="-Wall -Wextra -Werror -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -pedantic" -DDEP_INSTALL_PREFIX="${DEP_INSTALL_PREFIX}" -DDEP_BUILD_THREADS=2 -DENABLE_SUDO_TESTS=On + PIP_BREAK_SYSTEM_PACKAGES: 1 jobs: ShellCheck: @@ -95,10 +96,11 @@ jobs: - name: Ubuntu Prerequisites run: sudo contrib/CI/ubuntu.sh + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Install Extra Python Packages - run: | - sudo apt -y install python3-pip - sudo pip3 install pylint + run: sudo python3 -m pip install pylint - name: Configure CMake run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} @@ -126,6 +128,9 @@ jobs: - name: Install wget run: yum -y install wget + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Uninstall CMake from package manager run: yum -y autoremove cmake3 @@ -168,6 +173,9 @@ jobs: - name: Install Python 2 run: yum -y install python2 + - name: Install Python Packages + run: sudo python2 -m pip install -r contrib/CI/requirements.txt + - name: Configure CMake For Core Tests run: | mkdir -p build @@ -196,6 +204,9 @@ jobs: - name: Ubuntu Prerequisites run: sudo contrib/CI/ubuntu.sh + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Configure CMake run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} -DTEST_WORKING_DIRECTORY=/tmp @@ -225,6 +236,9 @@ jobs: - name: Install Valgrind run: apt -y install valgrind + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Configure CMake run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} @@ -250,6 +264,9 @@ jobs: - name: Ubuntu Prerequisites run: sudo contrib/CI/ubuntu.sh + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Configure CMake run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} -DDEP_USE_JEMALLOC=Off -DTEST_WORKING_DIRECTORY="$(pwd)" diff --git a/.github/workflows/rpm.yml b/.github/workflows/rpm.yml index 6ccac6e34..6f07c769b 100644 --- a/.github/workflows/rpm.yml +++ b/.github/workflows/rpm.yml @@ -89,6 +89,9 @@ jobs: - name: Rocky Linux Prerequisites run: contrib/CI/rockylinux.sh + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Configure CMake run: | mkdir build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 31f961956..273fe0676 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,6 +69,7 @@ env: CXX: clang++ DEP_INSTALL_PREFIX: ~/.local COMMON_CONFIG: -DCMAKE_C_FLAGS="-Wall -Wextra -Werror -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -pedantic" -DDEP_INSTALL_PREFIX="${DEP_INSTALL_PREFIX}" -DDEP_BUILD_THREADS=2 -DENABLE_SUDO_TESTS=On + PIP_BREAK_SYSTEM_PACKAGES: 1 jobs: Linux: @@ -99,6 +100,9 @@ jobs: if: startsWith(matrix.img, 'ubuntu:') run: contrib/CI/ubuntu.sh + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Configure CMake run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} @@ -126,6 +130,9 @@ jobs: - name: macOS Prerequisites run: contrib/CI/macos.sh + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Configure CMake run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }} -DTEST_WORKING_DIRECTORY="$(pwd)" @@ -157,6 +164,9 @@ jobs: - name: Set Up Python3 run: ln -sf /usr/bin/python3.9 /usr/bin/python3 + - name: Install Python Packages + run: sudo python3 -m pip install -r contrib/CI/requirements.txt + - name: Configure CMake run: >- export PATH=/usr/bin:$(cygpath ${SYSTEMROOT})/system32 && diff --git a/contrib/CI/centos8.sh b/contrib/CI/centos8.sh index a175300e8..c871fb3a7 100755 --- a/contrib/CI/centos8.sh +++ b/contrib/CI/centos8.sh @@ -78,6 +78,3 @@ yum -y install attr autoconf clang cmake3 diffutils fuse git make patch pkgconfi # SQLAlchemy needs Python.h yum -y install python3-devel - -# install pip packages -python3 -m pip install pugsql sqlalchemy diff --git a/contrib/CI/macos.sh b/contrib/CI/macos.sh index 1d40beddc..9543c993e 100755 --- a/contrib/CI/macos.sh +++ b/contrib/CI/macos.sh @@ -78,6 +78,3 @@ brew install autoconf coreutils cmake pcre2 python # get osxfuse from homebrew/cask brew tap homebrew/cask brew install --cask osxfuse || true # brew 4.0.0 switches to macfuse, but pkg-config can't find it - -# install pip packages -PIP_BREAK_SYSTEM_PACKAGES=1 python3 -m pip install pugsql sqlalchemy diff --git a/contrib/CI/requirements.txt b/contrib/CI/requirements.txt new file mode 100644 index 000000000..ebf4cc8ec --- /dev/null +++ b/contrib/CI/requirements.txt @@ -0,0 +1,2 @@ +pugsql +sqlalchemy diff --git a/contrib/CI/rockylinux.sh b/contrib/CI/rockylinux.sh index 760152dce..9d45f2de2 100755 --- a/contrib/CI/rockylinux.sh +++ b/contrib/CI/rockylinux.sh @@ -75,6 +75,3 @@ dnf -y install attr autoconf clang cmake3 findutils fuse git make patch pkgconfi # SQLAlchemy needs Python.h yum -y install python3-devel - -# install pip packages -python3 -m pip install pugsql sqlalchemy diff --git a/contrib/CI/ubuntu.sh b/contrib/CI/ubuntu.sh index dac209381..2596a6eef 100755 --- a/contrib/CI/ubuntu.sh +++ b/contrib/CI/ubuntu.sh @@ -88,6 +88,3 @@ apt -y install \ python3 \ python3-pip \ sudo - -# install pip packages -PIP_BREAK_SYSTEM_PACKAGES=1 python3 -m pip install pugsql sqlalchemy