@@ -54,6 +54,21 @@ def _plugin_active(option):
5454 return option .current_env or option .print_deps_to or option .print_extras_to
5555
5656
57+ def _allow_all_externals (envconfig ):
58+ for option in ["allowlist_externals" , "whitelist_externals" ]:
59+ # If either is set, we change it, as we cannot have both set at the same time:
60+ if getattr (envconfig , option , None ):
61+ setattr (envconfig , option , "*" )
62+ break
63+ else :
64+ # If none was set, we set one of them, preferably the new one:
65+ if hasattr (envconfig , "allowlist_externals" ):
66+ envconfig .allowlist_externals = "*"
67+ else :
68+ # unless we need to fallback to the old and deprecated
69+ # TODO, drop this when we drop support for tox < 3.18
70+ envconfig .whitelist_externals = "*"
71+
5772@tox .hookimpl
5873def tox_configure (config ):
5974 """Stores options in the config. Makes all commands external and skips sdist"""
@@ -72,8 +87,8 @@ def tox_configure(config):
7287 if _plugin_active (config .option ):
7388 config .skipsdist = True
7489 for testenv in config .envconfigs :
75- config .envconfigs [testenv ].whitelist_externals = "*"
7690 config .envconfigs [testenv ].usedevelop = False
91+ _allow_all_externals (config .envconfigs [testenv ])
7792
7893 if (getattr (config .option .print_deps_to , "name" , object ()) ==
7994 getattr (config .option .print_extras_to , "name" , object ())):
0 commit comments