Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set custom docs-dependencies. #210

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 override
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