Repository: theislab/cellrank (language: python)

Issue:
Fix CI
Fix failing CI:
- [x] pin `pandas!=1.4.0`
- [ ] fix PETSc/SLEPc install


Discussion / hints:
What's the status here? 

Fix patch:
diff --git a/.scripts/ci/install_dependencies.sh b/.scripts/ci/install_dependencies.sh
index 14a8b7964..130dfaaae 100755
--- a/.scripts/ci/install_dependencies.sh
+++ b/.scripts/ci/install_dependencies.sh
@@ -1,23 +1,15 @@
 #!/usr/bin/env bash
 
-set -ev
+set -euo pipefail
 
-if [[ "$RUNNER_OS" == "Linux" ]]; then
-    echo "Installing APT dependencies"
-    # https://github.com/yarnpkg/yarn/issues/7866
-    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
-    # R-related
-    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
-    sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
+echo "Fetching Yarn GPG key"
+# https://github.com/yarnpkg/yarn/issues/7866
+curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
 
-    sudo apt update -y
-    sudo apt install libopenblas-base r-base r-base-dev r-cran-mgcv -y
+echo "Installing R"
+sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
+sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
 
-    if [[ "$USE_SLEPC" == "true" ]]; then
-        echo "Installing PETSc/SLEPc dependencies"
-        sudo apt install gcc gfortran libopenmpi-dev libblas-dev liblapack-dev petsc-dev slepc-dev -y
-    fi
-elif [[ "$RUNNER_OS" != "macOS" ]]; then
-    echo "Invalid OS for dependencie installations: $OS"
-    exit 42
-fi
+echo "Installing APT dependencies"
+sudo apt update -y
+sudo apt install libopenblas-base r-base r-base-dev r-cran-mgcv -y
diff --git a/.scripts/ci/install_petsc_linux.sh b/.scripts/ci/install_petsc_linux.sh
new file mode 100755
index 000000000..ac93615bb
--- /dev/null
+++ b/.scripts/ci/install_petsc_linux.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+function install_petsc {
+    echo "Installing PETSc; version: '$PC_VERSION', dir: '$PETSC_DIR' with arch: '$PETSC_ARCH'"
+    curl -O "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-$PC_VERSION.tar.gz"
+    tar -xzf "petsc-lite-$PC_VERSION.tar.gz"
+    pushd "petsc-$PC_VERSION"
+    ./configure --with-cc=mpicc --with-fc=0 --with-cxx=mpicxx --with-debugging=0 --with-mpi=1
+    make all
+    make check
+    popd
+}
+
+function install_slepc {
+    echo "Installing SLEPc; version: '$SC_VERSION', dir: '$SLEPC_DIR'"
+    curl -O "https://slepc.upv.es/download/distrib/slepc-$SC_VERSION.tar.gz"
+    tar -xzf "slepc-$SC_VERSION.tar.gz"
+    pushd "slepc-$SC_VERSION"
+    ./configure
+    make all
+    make check
+    popd
+}
+
+echo "Installing PETSc/SLEPc dependencies"
+sudo apt-get update -y
+sudo apt-get install gcc gfortran libopenmpi-dev libblas-dev liblapack-dev -y
+
+pushd "$HOME"
+install_petsc
+install_slepc
+popd
diff --git a/tox.ini b/tox.ini
index 6ae9ab3f0..f3157e253 100644
--- a/tox.ini
+++ b/tox.ini
@@ -107,12 +107,19 @@ platform =
 deps =
     adjustText
     linux: rpy2>=3.3.0
-    py{37,38}: git+https://github.com/broadinstitute/wot@master
+    py37: git+https://github.com/broadinstitute/wot@master
+    # https://github.com/theislab/cellrank/pull/850
+    slepc: numpy==1.21.0
+    # we manually install PETSc/SLEPc on the CI from source
+    slepc: mpi4py>=3.0.3
+    slepc: petsc==3.15.4
+    slepc: petsc4py==3.15.1
+    slepc: slepc==3.15.2
+    slepc: slepc4py==3.15.1
 extras =
     test
-    slepc: krylov
-    py{37,38}: external
-passenv = TOXENV CI CODECOV_* GITHUB_ACTIONS PYTEST_FLAGS
+    py37: external
+passenv = TOXENV CI CODECOV_* GITHUB_ACTIONS PYTEST_FLAGS PETSC_* SLEPC_*
 usedevelop = true
 commands =
     python -m pytest --cov --cov-append --cov-report=term-missing --cov-config={toxinidir}/tox.ini --ignore docs/ {posargs:-vv} {env:PYTEST_FLAGS:}


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 85dbee5dc..a33c6de6f 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -53,6 +53,10 @@ jobs:
                 -   os: macos-latest
                     python: 3.8
                     use_slepc: false
+        env:
+            # make sure to pin this in tox.ini as well
+            PC_VERSION: 3.15.4  # PETSc version
+            SC_VERSION: 3.15.2  # SLEPc version
 
         steps:
         -   uses: actions/checkout@v2
@@ -61,12 +65,23 @@ jobs:
             with:
                 python-version: ${{ matrix.python }}
 
-        -   name: Install dependencies
-            env:
-                USE_SLEPC: ${{ matrix.use_slepc }}
+        -   name: Install Linux dependencies
+            if: runner.os == 'Linux'
             run: |
                 ./.scripts/ci/install_dependencies.sh
 
+        -   name: Export PETSc/SLEPc environment variables
+            if: ${{ runner.os == 'Linux' && matrix.use_slepc == true }}
+            run: |
+                echo "PETSC_DIR=$HOME/petsc-$PC_VERSION" >> $GITHUB_ENV
+                echo "SLEPC_DIR=$HOME/slepc-$SC_VERSION" >> $GITHUB_ENV
+                echo "PETSC_ARCH=arch-$RUNNER_OS-c-opt" >> $GITHUB_ENV
+
+        -   name: Install PETSc/SLEPc dependencies
+            if: ${{ runner.os == 'Linux' && matrix.use_slepc == true }}
+            run: |
+                ./.scripts/ci/install_petsc_linux.sh
+
         -   name: Get pip cache dir
             id: pip-cache
             run: |