From a41d026cc93be7ac72be72bcb98f098fb04e1360 Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Thu, 14 May 2026 09:17:53 -0400 Subject: [PATCH 1/4] Migrate to PEP 735 dependency groups More information at https://packaging.python.org/en/latest/specifications/dependency-groups/ This also bumps the tox version to 4.22, the first version that supports dependency groups. --- pyproject.toml | 21 +++++++++++++-------- tox.ini | 16 ++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e689893..9e7d75b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,26 +32,31 @@ dependencies = [ "qiskit>=2.2, <3", ] -[project.optional-dependencies] +[dependency-groups] dev = [ - "qiskit-addon-utils[test,doctest,nbtest,lint,docs]", - "tox>=4.4.3", + {include-group = "test"}, + {include-group = "doctest"}, + {include-group = "nbtest"}, + {include-group = "lint"}, + {include-group = "docs"}, + "tox>=4.22.0", ] basetest = [ "pytest>=8.0", "pytest-cov>=5.0", ] test = [ - "qiskit-addon-utils[basetest]", + {include-group = "basetest"}, "qiskit-qasm3-import>=0.5.0", "samplomatic>=0.13", ] doctest = [ - "qiskit-addon-utils[basetest,notebook-dependencies]", + {include-group = "basetest"}, + {include-group = "notebook-dependencies"}, "pytest-doctestplus>=1.3.0", ] nbtest = [ - "qiskit-addon-utils[basetest]", + {include-group = "basetest"}, "nbmake>=1.5.0", ] style = [ @@ -59,7 +64,7 @@ style = [ "nbqa>=1.8.5", ] lint = [ - "qiskit-addon-utils[style]", + {include-group = "style"}, "pylint==4.0.5", "mypy==1.20.0", "reno>=4.1", @@ -73,7 +78,7 @@ notebook-dependencies = [ "pylatexenc", ] docs = [ - "qiskit-addon-utils[doctest]", + {include-group = "doctest"}, "qiskit-sphinx-theme~=2.0.0", "jupyter-sphinx", "sphinx-design", diff --git a/tox.ini b/tox.ini index b87fbaa..3be182b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -minversion = 4.4.3 +minversion = 4.22.0 envlist = py{310,311,312,313}{,-notebook}, lint, coverage, docs, doctest isolated_build = True @@ -7,13 +7,13 @@ isolated_build = True package = wheel wheel_build_env = .pkg parallel_show_output = True -extras = +dependency_groups = test commands = pytest {posargs} [testenv:style] -extras = +dependency_groups = style commands = ruff format qiskit_addon_utils/ docs/ test/ @@ -25,7 +25,7 @@ image-tester-commit = 7ae965ccf21c39e5170334ec7f4882756883860a deps = git+https://github.com/Qiskit/documentation.git@{[testenv:lint]image-tester-commit}\#egg=sphinx-alt-text-validator&subdirectory=scripts/image-tester basepython = python3.10 -extras = +dependency_groups = lint commands = ruff format --check qiskit_addon_utils/ docs/ test/ @@ -39,14 +39,14 @@ commands = reno lint [testenv:{,py-,py3-,py310-,py311-,py312-,py313-}notebook] -extras = +dependency_groups = nbtest notebook-dependencies commands = pytest --nbmake --nbmake-timeout=3000 {posargs} docs/ [testenv:{,py-,py3-,py310-,py311-,py312-,py313-}doctest] -extras = +dependency_groups = test doctest commands = @@ -56,7 +56,7 @@ commands = basepython = python3.11 deps = coverage>=7.4.1 -extras = +dependency_groups = test doctest commands = @@ -64,7 +64,7 @@ commands = [testenv:docs] basepython = python3.10 -extras = +dependency_groups = docs commands = sphinx-build -j auto -W -T --keep-going -b html {posargs} {toxinidir}/docs/ {toxinidir}/docs/_build/html From f459cb34d9f09bce850f5d00b4b1eef0514dc5b2 Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Thu, 14 May 2026 11:05:50 -0400 Subject: [PATCH 2/4] Bump extremal-python-dependencies version Version 0.2.0 has a fix for the issue at https://github.com/IBM/extremal-python-dependencies/issues/68 --- .github/workflows/test_development_versions.yml | 2 +- .github/workflows/test_minimum_versions.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_development_versions.yml b/.github/workflows/test_development_versions.yml index 656074f..f1daf71 100644 --- a/.github/workflows/test_development_versions.yml +++ b/.github/workflows/test_development_versions.yml @@ -33,7 +33,7 @@ jobs: python -m pip install --upgrade pip - name: Install tools from pypi run: | - python -m pip install tox build extremal-python-dependencies~=0.0.5 + python -m pip install tox build extremal-python-dependencies~=0.2.0 - name: Build Qiskit SDK development wheel run: | git clone https://github.com/Qiskit/qiskit diff --git a/.github/workflows/test_minimum_versions.yml b/.github/workflows/test_minimum_versions.yml index e9fd908..f6d0c16 100644 --- a/.github/workflows/test_minimum_versions.yml +++ b/.github/workflows/test_minimum_versions.yml @@ -30,7 +30,7 @@ jobs: shell: bash run: | python -m pip install --upgrade pip - python -m pip install extremal-python-dependencies~=0.0.5 + python -m pip install extremal-python-dependencies~=0.2.0 pip install "tox==$(extremal-python-dependencies get-tox-minversion)" extremal-python-dependencies pin-dependencies-to-minimum --inplace - name: Test using tox environment From e08e7049c1d41d9cfbaef01b0ef2a69a711c204d Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Thu, 14 May 2026 11:27:22 -0400 Subject: [PATCH 3/4] Try branch of extremal-python-dependencies with candidate bugfix --- .github/workflows/test_development_versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_development_versions.yml b/.github/workflows/test_development_versions.yml index f1daf71..73377f5 100644 --- a/.github/workflows/test_development_versions.yml +++ b/.github/workflows/test_development_versions.yml @@ -33,7 +33,7 @@ jobs: python -m pip install --upgrade pip - name: Install tools from pypi run: | - python -m pip install tox build extremal-python-dependencies~=0.2.0 + python -m pip install tox build git+https://github.com/IBM/extremal-python-dependencies.git@fix-depgroup-replacements - name: Build Qiskit SDK development wheel run: | git clone https://github.com/Qiskit/qiskit From 51c31c993c3460c4261c8d9684939bbd2210f85d Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Thu, 14 May 2026 11:41:21 -0400 Subject: [PATCH 4/4] Bump to extremal-python-dependencies version with bugfix --- .github/workflows/test_development_versions.yml | 2 +- .github/workflows/test_minimum_versions.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_development_versions.yml b/.github/workflows/test_development_versions.yml index 73377f5..ab8883e 100644 --- a/.github/workflows/test_development_versions.yml +++ b/.github/workflows/test_development_versions.yml @@ -33,7 +33,7 @@ jobs: python -m pip install --upgrade pip - name: Install tools from pypi run: | - python -m pip install tox build git+https://github.com/IBM/extremal-python-dependencies.git@fix-depgroup-replacements + python -m pip install tox build extremal-python-dependencies~=0.2.1 - name: Build Qiskit SDK development wheel run: | git clone https://github.com/Qiskit/qiskit diff --git a/.github/workflows/test_minimum_versions.yml b/.github/workflows/test_minimum_versions.yml index f6d0c16..5c2ef2c 100644 --- a/.github/workflows/test_minimum_versions.yml +++ b/.github/workflows/test_minimum_versions.yml @@ -30,7 +30,7 @@ jobs: shell: bash run: | python -m pip install --upgrade pip - python -m pip install extremal-python-dependencies~=0.2.0 + python -m pip install extremal-python-dependencies~=0.2.1 pip install "tox==$(extremal-python-dependencies get-tox-minversion)" extremal-python-dependencies pin-dependencies-to-minimum --inplace - name: Test using tox environment