[CI] Fix Cython installation (#4983)
authorAndres Noetzli <andres.noetzli@gmail.com>
Mon, 31 Aug 2020 18:48:42 +0000 (11:48 -0700)
committerGitHub <noreply@github.com>
Mon, 31 Aug 2020 18:48:42 +0000 (11:48 -0700)
Cython has been causing issues recently, see e.g.
https://github.com/CVC4/CVC4/pull/4982/checks?check_run_id=1052433862.
It looks like the issue is that globally installed packages can't be
found by Python (maybe the global site-package directories changed/are
not included in the search paths anymore?). This commit changes the
installation of Cython to install it locally to the user instead of
globally. It also adds `bin` in the user base directory to `PATH` s.t.
CMake is able to find the `cython` binary.

.github/workflows/ci.yml

index 00fa15bc5c37d0e7290d33fc89d6a43636ca6e52..d7909b96130a4fd896df5cc2405c06409a792abe 100644 (file)
@@ -90,12 +90,12 @@ jobs:
         python3 -m pip install pexpect
         echo "::add-path::/usr/local/opt/ccache/libexec"
 
-    # Note: We install Cython with sudo since cmake can't find Cython otherwise.
     - name: Install Cython
       if: matrix.python-bindings && runner.os == 'Linux'
       run: |
-        sudo python3 -m pip install \
-          Cython==0.29 --install-option="--no-cython-compile"
+        python3 -m pip install \
+          Cython==0.29.* --install-option="--no-cython-compile"
+        echo "::add-path::$(python3 -m site --user-base)/bin"
 
     - name: Install Cython (macOS)
       if: matrix.python-bindings && runner.os == 'macOS'