From 2cbcf96a70d630dba18c00e86731be388b251fca Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 16 Mar 2021 14:43:29 +0100 Subject: [PATCH] Make tox_dependencies() a generator --- src/tox_current_env/hooks.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tox_current_env/hooks.py b/src/tox_current_env/hooks.py index 842517b..80de07d 100644 --- a/src/tox_current_env/hooks.py +++ b/src/tox_current_env/hooks.py @@ -199,11 +199,10 @@ def tox_testenv_install_deps(venv, action): def tox_dependencies(config): """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: - deps.insert(0, f"tox >= {config.minversion}") - return deps + yield f"tox >= {config.minversion}" + # config does not have the "requires" attribute until tox 3.22: + yield from getattr(config, "requires", []) @tox.hookimpl