From da025846b5fa3c498d5a96cc94ee3c6dd58720db Mon Sep 17 00:00:00 2001 From: Max Rossmannek Date: Thu, 12 Sep 2024 16:51:46 +0200 Subject: [PATCH] ci: propagate updates from qiskit-addon-utils (#7) --- .github/workflows/coverage.yml | 2 ++ .../workflows/test_development_versions.yml | 31 +++++++++++++------ .github/workflows/test_latest_versions.yml | 5 +-- .github/workflows/test_minimum_versions.yml | 5 +-- tox.ini | 7 +++-- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 931f65d..a1c94a0 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -34,8 +34,10 @@ jobs: run: | tox -e coverage - name: Convert to lcov + if: always() run: coverage3 lcov -o coveralls.lcov - name: Upload report to Coveralls + if: always() uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test_development_versions.yml b/.github/workflows/test_development_versions.yml index 64f7791..184c7fb 100644 --- a/.github/workflows/test_development_versions.yml +++ b/.github/workflows/test_development_versions.yml @@ -28,19 +28,32 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies (development versions) + - name: Determine development versions shell: bash run: | - python -m pip install --upgrade pip tox - python -m pip install extremal-python-dependencies==0.0.3 + # NOTE: by determining the current git commit SHAs, we can ensure that + # the individually run tox environments indeed actually use the exact + # same versions (which may not be the case if at the exact time a new + # commit gets added to the respective repositories). + # Additionally, using these commit SHAs ensures that the locally built + # Python wheels get cached, ensuring a faster tox environment setup + # for the multiple jobs below. + QISKIT_SHA=$(git ls-remote "https://github.com/Qiskit/qiskit" | grep HEAD | awk '{print $1}') + echo "QISKIT_SHA=$QISKIT_SHA" >> "$GITHUB_ENV" + echo "Using Qiskit/qiskit @ $QISKIT_SHA" + QISKIT_IBM_RUNTIME_SHA=$(git ls-remote "https://github.com/Qiskit/qiskit-ibm-runtime" | grep HEAD | awk '{print $1}') + echo "QISKIT_IBM_RUNTIME_SHA=$QISKIT_IBM_RUNTIME_SHA" >> "$GITHUB_ENV" + echo "Using Qiskit/qiskit-ibm-runtime @ $QISKIT_IBM_RUNTIME_SHA" + - name: Pinning development versions + shell: bash + run: | + python -m pip install --upgrade pip + python -m pip install tox extremal-python-dependencies==0.0.3 extremal-python-dependencies pin-dependencies \ - "qiskit @ git+https://github.com/Qiskit/qiskit.git" \ - "qiskit-ibm-runtime @ git+https://github.com/Qiskit/qiskit-ibm-runtime.git" \ + "qiskit @ git+https://github.com/Qiskit/qiskit.git@$QISKIT_SHA" \ + "qiskit-ibm-runtime @ git+https://github.com/Qiskit/qiskit-ibm-runtime.git@$QISKIT_IBM_RUNTIME_SHA" \ --inplace - name: Test using tox environment shell: bash run: | - toxpyversion=$(echo ${{ matrix.python-version }} | sed -E 's/^([0-9]+)\.([0-9]+).*$/\1\2/') - tox -epy${toxpyversion} - tox -epy${toxpyversion}-notebook - tox -edoctest + tox -e py,notebook,doctest diff --git a/.github/workflows/test_latest_versions.yml b/.github/workflows/test_latest_versions.yml index 6466cad..4452092 100644 --- a/.github/workflows/test_latest_versions.yml +++ b/.github/workflows/test_latest_versions.yml @@ -40,7 +40,4 @@ jobs: - name: Test using tox environment shell: bash run: | - toxpyversion=$(echo ${{ matrix.python-version }} | sed -E 's/^([0-9]+)\.([0-9]+).*$/\1\2/') - tox -epy${toxpyversion} - tox -epy${toxpyversion}-notebook - tox -edoctest + tox -e py,notebook,doctest --parallel --parallel-no-spinner diff --git a/.github/workflows/test_minimum_versions.yml b/.github/workflows/test_minimum_versions.yml index 4436115..832008d 100644 --- a/.github/workflows/test_minimum_versions.yml +++ b/.github/workflows/test_minimum_versions.yml @@ -36,7 +36,4 @@ jobs: - name: Test using tox environment shell: bash run: | - toxpyversion=$(echo ${{ matrix.python-version }} | sed -E 's/^([0-9]+)\.([0-9]+).*$/\1\2/') - tox -epy${toxpyversion} - tox -epy${toxpyversion}-notebook - tox -edoctest + tox -e py,notebook,doctest --parallel --parallel-no-spinner diff --git a/tox.ini b/tox.ini index 26e2955..54f24b4 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,9 @@ envlist = py{39,310,311,312}{,-notebook}, lint, coverage, docs, doctest isolated_build = True [testenv] +package = wheel +wheel_build_env = .pkg +parallel_show_output = True extras = test commands = @@ -40,12 +43,12 @@ extras = commands = pytest --nbmake --nbmake-timeout=3000 {posargs} docs/ -[testenv:doctest] +[testenv:{,py-,py3-,py39-,py310-,py311-,py312-}doctest] extras = test doctest commands = - pytest --doctest-plus --doctest-only + pytest --doctest-plus --doctest-only {posargs} [testenv:coverage] basepython = python3.10