Files
oopt-gnpy/tox.ini
Jan Kundrát 2d68b94a46 build: specify dependencies directly in setup.cfg
In tox v4, "reuse of environments" was disabled [1]. This is then later
explained [2] to refer to exactly that thing which we were using for
inheriting the dependencies from the top-level testenv all the way to
the docs build. That's why the docs build in GitHub CI started failing.

IMHO, The Correct Way™ of specifying what dependencies are used for
which feature are the so-called "extra dependencies". Once they are in
place, it is be possible to install gnpy via, e.g., `pip install
oopt-gnpy[docs]`. However, this process is (as far as I can tell)
incompatible with `requirements.txt`; all my attempts at using the
standard dependency syntax in that file have failed for me.

So, in order to make this happen, let's move all the dependencies from a
more-or-less ad-hoc collection of files to this declarative approach
right in setup.cfg. That way, the deps are listed on a single place, in
a declarative manner, and as a result, the installation is now a trivial
pip oneliner.

As a result, one can also remove that duplication of dependencies in
docs requirements.

[1] https://tox.wiki/en/4.11.4/upgrading.html#reuse-of-environments
[2] https://tox.wiki/en/4.11.4/upgrading.html#packaging-configuration-and-inheritance

Change-Id: I34aa0c71e993b39e2b805a7de40e133b4d290318
Fixes: 47c89626 fix docs requirements
2024-03-13 21:28:01 +01:00

45 lines
968 B
INI

[tox]
skipsdist = True
[testenv]
extras = tests
deps =
cover: pytest-cov
linters: flake8
linters: pep8-naming
linters: mccabe
linters: flake8-noqa
linters-diff-ci: flake8-html
changedir = {toxinidir}
usedevelop = True
setenv =
cover: CI_COVERAGE_OPTS=--cov=gnpy --cov=tests --cov-report=
commands =
pytest {env:CI_COVERAGE_OPTS:} -vv {posargs}
cover: coverage html -d cover
cover: coverage xml -o cover/coverage.xml
python -m build
[testenv:docs]
extras = docs
allowlist_externals =
/bin/sh
commands =
sphinx-build -E -W --keep-going -q -b html docs/ doc/build/html
/bin/sh -c "rstcheck --ignore-roles cite *.rst"
[testenv:linters]
commands =
flake8 {posargs}
[testenv:linters-diff-ci]
allowlist_externals = bash
commands =
flake8 {posargs} --format html --htmldir linters --exit-zero
bash -c "git diff -U0 origin/$(git rev-parse --abbrev-ref HEAD) | flake8 --diff {posargs}"
[flake8]
max-line-length = 120
max-complexity = 15
ignore = N806 W503