1
0
mirror of https://github.com/fedora-python/tox-current-env.git synced 2025-11-26 03:59:53 +01:00

Do not run commands_pre or commands_post with --print-deps-to/--print-extras-to

Fixes https://github.com/fedora-python/tox-current-env/issues/58
This commit is contained in:
Miro Hrončok
2022-12-12 12:13:32 +01:00
committed by GitHub
parent 10f1d91d8f
commit 34bd41f2bd
2 changed files with 55 additions and 0 deletions

View File

@@ -90,6 +90,15 @@ def tox_configure(config):
config.envconfigs[testenv].usedevelop = False
_allow_all_externals(config.envconfigs[testenv])
# When printing dependencies/extras we don't run any commands.
# Unfortunately tox_runtest_pre/tox_runtest_post hooks don't use firstresult=True,
# so we cannot override running commands_pre/commands_post.
# We empty the lists of commands instead.
if config.option.print_deps_to or config.option.print_extras_to:
for testenv in config.envconfigs:
config.envconfigs[testenv].commands_pre = []
config.envconfigs[testenv].commands_post = []
if (getattr(config.option.print_deps_to, "name", object()) ==
getattr(config.option.print_extras_to, "name", object())):
raise tox.exception.ConfigError(