From d560f1d2d0e7f1d20f21875f8015db7b2421d41b Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Fri, 3 May 2024 10:49:40 -0400 Subject: [PATCH] GitHub Actions: Fix pytest install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python's pip from Homebrew now refuses to isntall globally: error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try brew install xyz, where xyz is the package you are trying to install. If you wish to install a Python library that isn't in Homebrew, use a virtual environment: python3 -m venv path/to/venv source path/to/venv/bin/activate python3 -m pip install xyz If you wish to install a Python application that isn't in Homebrew, it may be easiest to use 'pipx install xyz', which will manage a virtual environment for you. You can install pipx with brew install pipx You may restore the old behavior of pip by passing the '--break-system-packages' flag to pip, or by adding 'break-system-packages = true' to your pip.conf file. The latter will permanently disable this error. If you disable this error, we STRONGLY recommend that you additionally pass the '--user' flag to pip, or set 'user = true' in your pip.conf file. Failure to do this can result in a broken Homebrew installation. Read more about this behavior here: Using Pipx instead. Making the same change for Ubuntu just in case. --- .github/workflows/cmake.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 320885e0bf..3b0b8f40e7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -94,13 +94,13 @@ jobs: - uses: actions/checkout@v1 - name: Install Build Tools - run: brew install bison flex + run: brew install bison flex pipx - name: Install Dependencies run: brew install bzip2 check curl-openssl json-c libxml2 ncurses openssl@1.1 pcre2 zlib - name: Install pytest for easier to read test results - run: python3 -m pip install pytest + run: pipx install pytest - uses: lukka/get-cmake@v3.21.2 @@ -148,13 +148,13 @@ jobs: run: sudo apt-get update - name: Install Build Tools - run: sudo apt-get install -y bison flex valgrind + run: sudo apt-get install -y bison flex valgrind pipx - name: Install Dependencies run: sudo apt-get install -y check libbz2-dev libcurl4-openssl-dev libjson-c-dev libmilter-dev libncurses5-dev libpcre3-dev libssl-dev libxml2-dev zlib1g-dev - name: Install pytest for easier to read test results - run: python3 -m pip install pytest + run: pipx install pytest - uses: lukka/get-cmake@v3.21.2