From a2f788c5a8e97420caccd38869078e4c35bd35ad Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 11:46:40 +0200 Subject: [PATCH 01/11] Add support for setting the numpy version in test runs. --- .github/workflows/tests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6f89efa2a4..cc9dcd08bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -60,6 +60,12 @@ jobs: python-version: 3.8 nocython: 1 + # Numpy 1.21.0 run. Builds currently fail with Python 3.9 and + # numpy 1.21.X on the Intel 8171 and 8272 Azure VMs. + - case-name: numpy-1.20 + os: ubuntu-latest + numpy-requirement: ">=1.20,<1.21" + steps: - uses: actions/checkout@v2 @@ -79,7 +85,7 @@ 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. From d7bf159fb4cd77bf66a694fee4e2f2b5f9253f6d Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 11:57:34 +0200 Subject: [PATCH 02/11] Explicitly set Python version. --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc9dcd08bb..5861516b64 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,6 +64,7 @@ jobs: # numpy 1.21.X on the Intel 8171 and 8272 Azure VMs. - case-name: numpy-1.20 os: ubuntu-latest + python-version: 3.9 numpy-requirement: ">=1.20,<1.21" steps: From fa90e5dd7d5ff5737f07d52bc3f9810e8850dd24 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 14:56:02 +0200 Subject: [PATCH 03/11] Pin base numpy to 1.21.0 in test runs. --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5861516b64..d9dca5f5f1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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.21.0"] # 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 From 51c29af203fc435f423759a333442719b7e98203 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 15:45:55 +0200 Subject: [PATCH 04/11] Pin numpy to 1.20.X by default. --- .github/workflows/tests.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d9dca5f5f1..9c1c88f67e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +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.21.0"] + 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 @@ -52,6 +52,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; @@ -61,13 +62,6 @@ jobs: python-version: 3.8 nocython: 1 - # Numpy 1.21.0 run. Builds currently fail with Python 3.9 and - # numpy 1.21.X on the Intel 8171 and 8272 Azure VMs. - - case-name: numpy-1.20 - os: ubuntu-latest - python-version: 3.9 - numpy-requirement: ">=1.20,<1.21" - steps: - uses: actions/checkout@v2 From 166ffc87eb0ae33ee6ef269440e08de2a76524fa Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 16:22:22 +0200 Subject: [PATCH 05/11] Add host environment information. --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9c1c88f67e..11e03fbe03 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -97,6 +97,13 @@ jobs: conda list python -c "import qutip; qutip.about()" + - name: Environment information + run: | + uname -r + hostnamectl + free -h + lscpu + - 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 From 6c28e8274fe26e589ba940362f75b6d6f238b4bc Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 16:51:27 +0200 Subject: [PATCH 06/11] Don't call hostnamectl or lscpu on OS X. --- .github/workflows/tests.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 11e03fbe03..7c06e61407 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -99,10 +99,12 @@ jobs: - name: Environment information run: | - uname -r - hostnamectl + uname -a + if [[ "ubuntu-latest" == "${{ matrix.os }}" ]]; then + hostnamectl + lscpu + fi free -h - lscpu - name: Run tests # If our tests are running for longer than an hour, _something_ is wrong From cd4a90c3d90c08801118e7599675d64f989c7e7c Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 16:52:48 +0200 Subject: [PATCH 07/11] Remove redundant setting of numpy-requirement in OpenMP tests run. --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c06e61407..da72c8f50f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,7 +52,6 @@ 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; From 9922162a9b10b66e63f57ab422a239baca12d4fc Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 16:57:25 +0200 Subject: [PATCH 08/11] Use the selected version of numpy in all cases. --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index da72c8f50f..6fab25b674 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,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. @@ -84,9 +86,9 @@ jobs: 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 From 028b2623798eb1c9524941d06b93ab145b7f28cc Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 17:00:46 +0200 Subject: [PATCH 09/11] Don't call 'free' on OS X either. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6fab25b674..138d3b9751 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -104,8 +104,8 @@ jobs: if [[ "ubuntu-latest" == "${{ matrix.os }}" ]]; then hostnamectl lscpu + free -h fi - free -h - name: Run tests # If our tests are running for longer than an hour, _something_ is wrong From bc1b28535848da97d8cde7e69e2e68ec113af007 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 17:36:26 +0200 Subject: [PATCH 10/11] Pin numpy requirement for OpenMP test case on Python 3.9. --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 138d3b9751..40154a92d1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,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; From 818214c8e58d17c2f264d28eb8dc361eb0f32c5c Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 22 Oct 2021 17:44:57 +0200 Subject: [PATCH 11/11] Remove brackets around numpy-requirement. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40154a92d1..eceee8cc60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,7 +54,7 @@ jobs: - case-name: OpenMP os: ubuntu-latest python-version: 3.9 - numpy-requirement: [">=1.20,<1.21"] + numpy-requirement: ">=1.20,<1.21" openmp: 1 # Builds without Cython at runtime. This is a core feature;