From c063609f48c494418164c3e043568628bf66c3a8 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Fri, 4 Dec 2020 12:29:46 +0100 Subject: [PATCH] CI: manually install to prevent incompatible releases When `pymatgen` gets installed through `pip` it needs to be built and its build process will not respect any package version requirements that `aiida-core` imposes. A common problem is that the latest `numpy` release will get installed, including pre-releases, which often break our tests because it drops support of certain Python versions. To workaround this, the workflows are updated to install an explicit version of `numpy` that we know is compatible before installing `aiida-core` itself. In this case, `pymatgen` should simply use that version and not install the latest. --- .github/workflows/ci-code.yml | 7 +++++++ .github/workflows/test-install.yml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/ci-code.yml b/.github/workflows/ci-code.yml index bc047ab216..e5f4dce13d 100644 --- a/.github/workflows/ci-code.yml +++ b/.github/workflows/ci-code.yml @@ -94,6 +94,13 @@ jobs: if: matrix.python-version == 3.5 run: pip install -I setuptools==42.0.0 # Minimally required version for Python 3.5. + # Work-around issue caused by pymatgen's setup process, which will install the latest + # numpy version (including release candidates) regardless of our actual specification + # By installing the version from the requirements file, we should get a compatible version + - name: Install numpy + run: | + pip install `grep 'numpy==' requirements/requirements-py-${{ matrix.python-version }}.txt` + - name: Install aiida-core run: | pip install --use-feature=2020-resolver -r requirements/requirements-py-${{ matrix.python-version }}.txt diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index b1d2603af7..d70b5393a7 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -153,6 +153,13 @@ jobs: - run: pip install --upgrade pip + # Work-around issue caused by pymatgen's setup process, which will install the latest + # numpy version (including release candidates) regardless of our actual specification + # By installing the version from the requirements file, we should get a compatible version + - name: Install numpy + run: | + pip install `grep 'numpy==' requirements/requirements-py-${{ matrix.python-version }}.txt` + - name: upgrade setuptools [py35] if: matrix.python-version == 3.5 run: pip install -I setuptools==42.0.0