1
0
mirror of https://github.com/fedora-python/tox-current-env.git synced 2025-01-11 17:06:13 +01:00

Make tox_dependencies() a generator

This commit is contained in:
Petr Viktorin 2021-03-16 14:43:29 +01:00 committed by Miro Hrončok
parent beda06ad5e
commit 2cbcf96a70

View File

@ -199,11 +199,10 @@ def tox_testenv_install_deps(venv, action):
def tox_dependencies(config): def tox_dependencies(config):
"""Get dependencies of tox itself, 'minversion' and 'requires' config options""" """Get dependencies of tox itself, 'minversion' and 'requires' config options"""
# config does not have this attribute until tox 3.22:
deps = getattr(config, "requires", [])
if config.minversion is not None: if config.minversion is not None:
deps.insert(0, f"tox >= {config.minversion}") yield f"tox >= {config.minversion}"
return deps # config does not have the "requires" attribute until tox 3.22:
yield from getattr(config, "requires", [])
@tox.hookimpl @tox.hookimpl