From bf16eec9950e58f341593e67ccd458c3b2197757 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 09:56:14 -0400 Subject: [PATCH 1/7] Add support for Python 3.9 Python 3.9.0 was released on 10-05-2020, this commits marks the support of Python 3.9 in qiskit-ignis. It adds the supported python version in the package metadata and updates the CI configuration to run test jobs on Python 3.9. --- .github/workflows/main.yml | 4 ++-- setup.py | 1 + tox.ini | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 95f1b3641..f4e14989f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, 3.9] os: ["macOS-latest", "ubuntu-latest"] steps: - uses: actions/checkout@v2 @@ -42,7 +42,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 - uses: goanpeca/setup-miniconda@v1 diff --git a/setup.py b/setup.py index a33a92c77..3ed1eb054 100644 --- a/setup.py +++ b/setup.py @@ -72,6 +72,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Topic :: Scientific/Engineering", ], keywords="qiskit sdk quantum", diff --git a/tox.ini b/tox.ini index f3b9931d3..3fbc98041 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.1 -envlist = py36, py37, py38, lint +envlist = py36, py37, py38, py39, lint skipsdist = True [testenv] From 5411afac454e5fd17832fad7ebe637a814de81a1 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 13 Jan 2021 15:46:24 -0500 Subject: [PATCH 2/7] Build from master for aer 3.9 support --- .github/workflows/main.yml | 2 ++ requirements-dev.txt | 4 +++- tools/build_aer.py | 19 ------------------- 3 files changed, 5 insertions(+), 20 deletions(-) delete mode 100755 tools/build_aer.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c4212ac3..9aa19a38e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,6 +71,8 @@ jobs: python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: diff --git a/requirements-dev.txt b/requirements-dev.txt index 298420dc1..f28d3b306 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,8 @@ pylint==2.4.4 pycodestyle -qiskit-aer>=0.3.0 +qiskit-aer>=0.3.0;python_version<'3.9' +# Remove after qiskit-aer 0.8.0 release: +git+https://github.com/Qiskit/qiskit-aer;python_version>='3.9' scikit-learn>=0.17 Sphinx>=2.1 sphinx-rtd-theme>=0.4.0 diff --git a/tools/build_aer.py b/tools/build_aer.py deleted file mode 100755 index 466738d7e..000000000 --- a/tools/build_aer.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/python3 - -import os -import shutil -import subprocess -import sys -import tempfile - - - -if os.name == 'nt' or sys.platform == 'darwin': - subprocess.call(['pip', 'install', '-U', - 'git+https://github.com/Qiskit/qiskit-aer.git']) - -if sys.platform == 'linux' or sys.platform == 'linux2': - subprocess.call(['pip', 'install', '-U', - 'git+https://github.com/Qiskit/qiskit-aer.git', - '--install-option', '--', '--install-option', - '-DCMAKE_CXX_COMPILER=g++-7']) From 75ba2875d5aed3cb4190ab642ae3fdb84192edf1 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 13 Jan 2021 15:57:23 -0500 Subject: [PATCH 3/7] Split aer install into separate tox job --- requirements-dev.txt | 6 ++---- tox.ini | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f28d3b306..14b586092 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,6 @@ pylint==2.4.4 pycodestyle qiskit-aer>=0.3.0;python_version<'3.9' -# Remove after qiskit-aer 0.8.0 release: -git+https://github.com/Qiskit/qiskit-aer;python_version>='3.9' scikit-learn>=0.17 Sphinx>=2.1 sphinx-rtd-theme>=0.4.0 @@ -10,8 +8,8 @@ sphinx-tabs>=1.1.11 sphinx-autodoc-typehints stestr>=2.5.0 ddt>=1.2.0,!=1.4.0 -jupyter -jupyter-sphinx +jupyter;python_version<'3.9' +jupyter-sphinx;python_version<'3.9' reno matplotlib pyfakefs diff --git a/tox.ini b/tox.ini index b5530564f..8c9ada10b 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,14 @@ commands = pip install -U -c constraints.txt -r{toxinidir}/requirements-dev.txt pip check stestr run {posargs} +# Remove after qiskit-aer 0.8.0 release: +[testenv:py39] +commands = + pip install -U -c constraints.txt git+https://github.com/Qiskit/qiskit-terra.git + pip install -U -c constraints.txt git+https://github.com/Qiskit/qiskit-aer.git + pip install -U -c constraints.txt -r{toxinidir}/requirements-dev.txt + pip check + stestr run {posargs} [testenv:no-opt] deps = From 715be4349772a513a52ce4547b3838c4d97576e2 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 13 Jan 2021 16:04:35 -0500 Subject: [PATCH 4/7] Use tox -epy39 for 3.9 jobs --- .github/workflows/main.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9aa19a38e..b76e23e04 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,10 +33,9 @@ jobs: run: tox -e py if: runner.os != 'macOS' - name: Install and Run Tests - env: - QISKIT_IN_PARALLEL: TRUE - run: tox -e py - if: runner.os == 'macOS' + run: tox -e py39 + if: matrix.python-version == '3.9' + tests-no-opt: name: tests-python3.8-no-optional-dependencies runs-on: ${{ matrix.os }} @@ -92,6 +91,10 @@ jobs: - name: Install and Run Tests run: tox --sitepackages -epy shell: bash -l {0} + - name: Install and Run Tests + run: tox --sitepackages -epy39 + shell: bash -l {0} + if: matrix.python-version == '3.9' lint: name: lint runs-on: ubuntu-latest From 30b36d60e40c1df62a78db21425c73fc27dea354 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 13 Jan 2021 16:10:48 -0500 Subject: [PATCH 5/7] Tweak gha condition --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b76e23e04..10d39c29e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: if: runner.os != 'macOS' - name: Install and Run Tests run: tox -e py39 - if: matrix.python-version == '3.9' + if: ${{matrix.python-version}} == 3.9 tests-no-opt: name: tests-python3.8-no-optional-dependencies @@ -94,7 +94,7 @@ jobs: - name: Install and Run Tests run: tox --sitepackages -epy39 shell: bash -l {0} - if: matrix.python-version == '3.9' + if: ${{matrix.python-version}} == 3.9 lint: name: lint runs-on: ubuntu-latest From be47dfc0ee84be289fcb774990bc9f0602060391 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 13 Jan 2021 16:14:38 -0500 Subject: [PATCH 6/7] Fix 3.9 reverse conditions in gha config --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10d39c29e..422c0fa32 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,10 +31,10 @@ jobs: run: python -m pip install -U tox setuptools virtualenv wheel - name: Install and Run Tests run: tox -e py - if: runner.os != 'macOS' + if: matrix.python-version != '3.9' - name: Install and Run Tests run: tox -e py39 - if: ${{matrix.python-version}} == 3.9 + if: matrix.python-version == '3.9' tests-no-opt: name: tests-python3.8-no-optional-dependencies @@ -91,10 +91,11 @@ jobs: - name: Install and Run Tests run: tox --sitepackages -epy shell: bash -l {0} + if: matrix.python-version != '3.9' - name: Install and Run Tests run: tox --sitepackages -epy39 shell: bash -l {0} - if: ${{matrix.python-version}} == 3.9 + if: matrix.python-version == '3.9' lint: name: lint runs-on: ubuntu-latest From 656036d9901cf4103588576e0906524fbd713bbf Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 13 Jan 2021 16:27:56 -0500 Subject: [PATCH 7/7] Remove 3.9 windows job until aer release --- .github/workflows/main.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 422c0fa32..2b5e32111 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,7 +67,8 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + # TODO: Add 3.9 to the list after aer 0.8.0 release + python-version: [3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 - name: Add msbuild to PATH @@ -91,11 +92,7 @@ jobs: - name: Install and Run Tests run: tox --sitepackages -epy shell: bash -l {0} - if: matrix.python-version != '3.9' - - name: Install and Run Tests - run: tox --sitepackages -epy39 - shell: bash -l {0} - if: matrix.python-version == '3.9' + lint: name: lint runs-on: ubuntu-latest