qiskit/tox.ini

112 lines
3.7 KiB
INI

[tox]
minversion = 3.3.0
envlist = py38, py39, py310, py311, lint-incr
isolated_build = true
[testenv]
# We pretend that we're not actually installing the package, because we need tox to let us have two
# packages ('qiskit' and 'qiskit-terra') under test at the same time. For that, we have to stuff
# them into 'deps'.
skip_install = true
install_command = pip install -c{toxinidir}/constraints.txt -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
ARGS="-V"
QISKIT_SUPRESS_PACKAGING_WARNINGS=Y
QISKIT_TEST_CAPTURE_STREAMS=1
QISKIT_PARALLEL=FALSE
passenv = RAYON_NUM_THREADS, OMP_NUM_THREADS, QISKIT_PARALLEL, RUST_BACKTRACE, SETUPTOOLS_ENABLE_FEATURES, QISKIT_TESTS, QISKIT_IN_PARALLEL
deps =
setuptools_rust # This is work around for the bug of tox 3 (see #8606 for more details.)
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
-e .
-e ./qiskit_pkg
commands =
stestr run {posargs}
[testenv:lint]
basepython = python3
commands =
ruff check qiskit test tools examples setup.py qiskit_pkg
black --check {posargs} qiskit test tools examples setup.py qiskit_pkg
pylint -rn qiskit test tools
# This line is commented out until #6649 merges. We can't run this currently
# via tox because tox doesn't support globbing
# pylint -rn --disable='invalid-name,missing-module-docstring,redefined-outer-name' examples/python/*.py
python {toxinidir}/tools/verify_headers.py qiskit test tools examples
python {toxinidir}/tools/find_optional_imports.py
python {toxinidir}/tools/find_stray_release_notes.py
reno lint
[testenv:lint-incr]
basepython = python3
allowlist_externals = git
commands =
ruff check qiskit test tools examples setup.py qiskit_pkg
black --check {posargs} qiskit test tools examples setup.py qiskit_pkg
-git fetch -q https://github.com/Qiskit/qiskit-terra.git :lint_incr_latest
python {toxinidir}/tools/pylint_incr.py -rn -j4 -sn --paths :/qiskit/*.py :/test/*.py :/tools/*.py
python {toxinidir}/tools/pylint_incr.py -rn -j4 -sn --disable='invalid-name,missing-module-docstring,redefined-outer-name' --paths :(glob,top)examples/python/*.py
python {toxinidir}/tools/verify_headers.py qiskit test tools examples
python {toxinidir}/tools/find_optional_imports.py
python {toxinidir}/tools/find_stray_release_notes.py
reno lint
[testenv:black]
skip_install = true
deps =
-r requirements-dev.txt
commands = black {posargs} qiskit test tools examples setup.py qiskit_pkg
[testenv:coverage]
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage3 run --source qiskit --parallel-mode
deps =
{[testenv]deps}
-r{toxinidir}/requirements-optional.txt
commands =
stestr run {posargs}
coverage3 combine
coverage3 report
[testenv:docs]
basepython = python3
setenv =
{[testenv]setenv}
QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
RUST_DEBUG=1 # Faster to compile.
passenv = {[testenv]passenv}, QISKIT_DOCS_BUILD_TUTORIALS, QISKIT_CELL_TIMEOUT, DOCS_PROD_BUILD
deps =
{[testenv]deps}
-r{toxinidir}/requirements-optional.txt
-r{toxinidir}/requirements-tutorials.txt
commands =
sphinx-build -W -j auto -T --keep-going -b html docs/ docs/_build/html {posargs}
[testenv:docs-clean]
skip_install = true
deps =
allowlist_externals =
rm
commands =
rm -rf {toxinidir}/docs/stubs/ {toxinidir}/docs/_build {toxinidir}/docs/locale
[testenv:tutorials]
base = docs
commands =
python tools/execute_tutorials.py {toxinidir}/docs/tutorials --out={toxinidir}/executed_tutorials {posargs}
[testenv:gettext]
base = docs
deps =
{[testenv:docs]deps}
sphinx-intl
commands =
sphinx-build -b gettext docs docs/_build/gettext {posargs}
sphinx-intl -c docs/conf.py update -p docs/_build/gettext -l en -d docs/locale