Skip to content

Commit

Permalink
Add ability to set custom docs-dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Sep 26, 2023
1 parent 47bae5a commit 8918606
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
13 changes: 11 additions & 2 deletions config/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,16 @@ updated. Example:
]
coverage-basepython = "python3.9"
coverage-command = [
"coverage run {envbindir}/test_with_gs []"
"coverage run {envbindir}/test_with_gs []",
]
coverage-setenv = [
"COVERAGE_HOME={toxinidir}",
]
coverage-additional = [
"depends = py37,docs"
"depends = py37,docs",
]
docs-deps = [
"urllib3 < 2",
]
use-flake8 = true
Expand Down Expand Up @@ -483,6 +486,12 @@ coverage-additional
This option allows to add additional lines below ``[testenv:coverage]`` in
``tox.ini``. This option has to be a list of strings.

docs-deps
This option allows to add additional install dependencies for
``[testenv:docs]`` in ``tox.ini``. This option has to be a list of strings
and is empty by default. Caution: The values set for this option overwrite
the ones set in ``[testenv]``.

use-flake8
Whether to add the ``flake8`` and ``isort`` linting steps to the section
``[testenv:lint]``. By default these steps are run. On an older code base it
Expand Down
3 changes: 2 additions & 1 deletion config/config-package.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ def tox(self):
use_flake8 = self.tox_option('use-flake8', default=True)
else:
use_flake8 = self.args.use_flake8
docs_deps = self.tox_option('docs-deps', default=[])
self.meta_cfg['tox']['use-flake8'] = use_flake8
self.copy_with_meta(
'tox.ini.j2',
Expand All @@ -458,7 +459,7 @@ def tox(self):
with_future_python=self.with_future_python,
with_pypy=self.with_pypy,
with_sphinx_doctests=self.with_sphinx_doctests,
with_config_type=self.config_type,
docs_deps=docs_deps,
)

def tests_yml(self):
Expand Down
6 changes: 6 additions & 0 deletions config/default/tox-docs.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
[testenv:docs]
basepython = python3
skip_install = false
{% if docs_deps %}
deps =
{% for line in docs_deps %}
%(line)s
{% endfor %}
{% endif %}
{% if not with_sphinx_doctests %}
extras =
docs
Expand Down
2 changes: 1 addition & 1 deletion config/default/tox-testenv.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[testenv]
usedevelop = true
{% if with_config_type == "pure-python" %}
{% if config_type == "pure-python" %}
package = wheel
wheel_build_env = .pkg
{% endif %}
Expand Down

0 comments on commit 8918606

Please sign in to comment.