Skip to content

Commit 62cb08b

Browse files
authored
Remove manual pip install commands from tox.ini (#16042)
Having manual calls to `pip` implies that `pip` is available. This is not universally true; if the current `venv` and/or `tox` installation is managed by a different tool that `tox` knows about (such as `uv`), it will use it to create its own `venv`s, which may not have `pip` available within them (like `uv`'s don't). Using the `dependency-groups` feature allows us to offload all the install work to `tox`, so it works regardless of `venv` manager. Technically this causes the dependency groups to install before the version of Qiskit under test, which will have the side effect of installing an _old_ version of Qiskit first. However, `tox` will then forcibly install the new version of Qiskit into the environment, which is what we really want.
1 parent 490fc27 commit 62cb08b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ basepython = python3
8787
setenv =
8888
{[testenv]setenv}
8989
PYTHON=coverage run --source qiskit --parallel-mode
90-
commands_pre =
91-
pip install -c {toxinidir}/constraints.txt --group optionals-all
90+
dependency_groups =
91+
{[testenv]dependency_groups}
92+
optionals-all
9293
commands =
9394
stestr run {posargs}
9495
coverage combine
@@ -102,10 +103,9 @@ allowlist_externals =
102103
setenv =
103104
{[testenv]setenv}
104105
QISKIT_BUILD_PROFILE=debug
105-
commands_pre =
106-
pip install -c {toxinidir}/constraints.txt --group optionals-all
107106
dependency_groups =
108107
doc
108+
optionals-all
109109
commands =
110110
make cheader
111111
doxygen docs/Doxyfile

0 commit comments

Comments
 (0)