Skip to content

Commit

Permalink
CI: manually install to prevent incompatible releases
Browse files Browse the repository at this point in the history
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.

Cherry-pick: c063609
  • Loading branch information
sphuber committed Dec 4, 2020
1 parent b9fcbd8 commit 8058a97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ jobs:
pip install --upgrade pip
pip --version
# 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
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,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: Install aiida-core
run: |
pip install -e .[atomic_tools,docs,notebook,rest,tests]
Expand Down

0 comments on commit 8058a97

Please sign in to comment.