From ef1646a9911453443a18db493a05f846adf881b2 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 4 Dec 2024 13:52:47 -0800 Subject: [PATCH] Use geoana 0.2.1 for building the website (#579) Use an older version of geoana to build the website to avoid errors coming from incompatibilities with the latest version. Install `geoana==0.2.1` in GitHub Actions to run tests and to build the website. Just pinning it in the `requirements.txt` file doesn't work because of missing build dependencies for that old version. So the build requirements (listed in a new `requirements-build-geoana.txt` file) are installed along with other needed packages (e.g. Sphinx), and `geoana=0.2.1` gets installed with `pip` but disabling the build isolation (passing `--no-build-isolation`). This fix is just a patch, we should make the repo compatible with latest geoana at some point. By then, we should revert these changes. --- .github/workflows/python-app.yml | 18 ++++++++++++++++-- requirements-build-geoana.txt | 13 +++++++++++++ requirements.txt | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 requirements-build-geoana.txt diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8b9d69cc..aae93f9e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -23,8 +23,16 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + + # Gather requirements and install older version of geoana + cat requirements.txt | grep -v "^geoana" > requirements-ci.txt + cat requirements-build-geoana.txt | grep -v "^#" >> requirements-ci.txt + pip install -r requirements-ci.txt + rm requirements-ci.txt + pip install --no-build-isolation geoana==0.2.1 + + # Install extra packages pip install flake8 pytest - pip install -r requirements.txt - name: Test with pytest run: | pytest -s -v tests @@ -43,7 +51,13 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + + # Gather requirements and install older version of geoana + cat requirements.txt | grep -v "^geoana" > requirements-ci.txt + cat requirements-build-geoana.txt | grep -v "^#" >> requirements-ci.txt + pip install -r requirements-ci.txt + rm requirements-ci.txt + pip install --no-build-isolation geoana==0.2.1 - name: Build pages run: | diff --git a/requirements-build-geoana.txt b/requirements-build-geoana.txt new file mode 100644 index 00000000..8b6f52a0 --- /dev/null +++ b/requirements-build-geoana.txt @@ -0,0 +1,13 @@ +# Requirements to build geoana 0.2.1 without isolation +# +# This file was added as a way to install geoana 0.2.1 (old version) in GitHub +# Actions and build the website using an this old version of geoana. +# +# We should remove this file after updating the repo to work with the latest +# version of geoana. The easiest way to do so would be to revert the commit +# that added this file. +# +numpy<1.23 +cython +setuptools<60 +wheel diff --git a/requirements.txt b/requirements.txt index 95ebc05a..98f84f33 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ sphinxcontrib-bibtex sphinx_rtd_theme pytest matplotlib -geoana +geoana==0.2.1