Skip to content

Commit

Permalink
Merge pull request qutip#1696 from hodgestar/fix/test-numpy-versions
Browse files Browse the repository at this point in the history
Add support for specifying the numpy version in the CI test matrix and pin numpy to the latest 1.20.X by default.
  • Loading branch information
hodgestar committed Oct 22, 2021
2 parents a412856 + 818214c commit 8910940
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
# matrix size; make sure to test all supported versions in some form.
python-version: [3.9]
case-name: [defaults]
numpy-requirement: [">=1.20,<1.21"]
# Extra special cases. In these, the new variable defined should always
# be a truth-y value (hence 'nomkl: 1' rather than 'mkl: 0'), because
# the lack of a variable is _always_ false-y, and the defaults lack all
Expand All @@ -38,6 +39,8 @@ jobs:
os: ubuntu-latest
python-version: 3.6
scipy-requirement: ">=1.4,<1.5"
# let the old SciPy version select an appropriate numpy version:
numpy-requirement: ""

# No MKL runs. MKL is now the default for conda installations, but
# not necessarily for pip.
Expand All @@ -51,6 +54,7 @@ jobs:
- case-name: OpenMP
os: ubuntu-latest
python-version: 3.9
numpy-requirement: ">=1.20,<1.21"
openmp: 1

# Builds without Cython at runtime. This is a core feature;
Expand Down Expand Up @@ -79,13 +83,13 @@ jobs:
fi
export CI_QUTIP_WITH_OPENMP=${{ matrix.openmp }}
if [[ -z "${{ matrix.nomkl }}" ]]; then
conda install blas=*=mkl numpy "scipy${{ matrix.scipy-requirement }}"
conda install blas=*=mkl "numpy${{ matrix.numpy-requirement }}" "scipy${{ matrix.scipy-requirement }}"
elif [[ "${{ matrix.os }}" =~ ^windows.*$ ]]; then
# Conda doesn't supply forced nomkl builds on Windows, so we rely on
# pip not automatically linking to MKL.
pip install numpy "scipy${{ matrix.scipy-requirement }}"
pip install "numpy${{ matrix.numpy-requirement }}" "scipy${{ matrix.scipy-requirement }}"
else
conda install nomkl numpy "scipy${{ matrix.scipy-requirement }}"
conda install nomkl "numpy${{ matrix.numpy-requirement }}" "scipy${{ matrix.scipy-requirement }}"
fi
python -m pip install -e .[$QUTIP_TARGET]
python -m pip install pytest-cov coveralls
Expand All @@ -95,6 +99,15 @@ jobs:
conda list
python -c "import qutip; qutip.about()"
- name: Environment information
run: |
uname -a
if [[ "ubuntu-latest" == "${{ matrix.os }}" ]]; then
hostnamectl
lscpu
free -h
fi
- name: Run tests
# If our tests are running for longer than an hour, _something_ is wrong
# somewhere. The GitHub default is 6 hours, which is a bit long to wait
Expand Down

0 comments on commit 8910940

Please sign in to comment.