@@ -54,6 +54,21 @@ def _plugin_active(option):
54
54
return option .current_env or option .print_deps_to or option .print_extras_to
55
55
56
56
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
+
57
72
@tox .hookimpl
58
73
def tox_configure (config ):
59
74
"""Stores options in the config. Makes all commands external and skips sdist"""
@@ -72,8 +87,8 @@ def tox_configure(config):
72
87
if _plugin_active (config .option ):
73
88
config .skipsdist = True
74
89
for testenv in config .envconfigs :
75
- config .envconfigs [testenv ].whitelist_externals = "*"
76
90
config .envconfigs [testenv ].usedevelop = False
91
+ _allow_all_externals (config .envconfigs [testenv ])
77
92
78
93
if (getattr (config .option .print_deps_to , "name" , object ()) ==
79
94
getattr (config .option .print_extras_to , "name" , object ())):
0 commit comments