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

Always set passenv/pass_env to *

This commit is contained in:
Miro Hrončok
2022-12-14 13:48:10 +01:00
parent c3497d2b2a
commit 679fbc996e
6 changed files with 57 additions and 13 deletions

View File

@@ -85,6 +85,11 @@ def tox_configure(config):
for testenv in config.envconfigs:
config.envconfigs[testenv].usedevelop = False
_allow_all_externals(config.envconfigs[testenv])
# Because tox 4 no longer reads $TOX_TESTENV_PASSENV,
# this plugin always passes all environment variables by default,
# even on tox 3.
# Unfortunately at this point the set contains actual values, not globs:
config.envconfigs[testenv].passenv |= set(os.environ.keys())
# When printing dependencies/extras we don't run any commands.
# Unfortunately tox_runtest_pre/tox_runtest_post hooks don't use firstresult=True,

View File

@@ -87,11 +87,11 @@ def tox_add_core_config(core_conf, state):
def tox_add_env_config(env_conf, state):
opt = state.conf.options
# This allows all external commands.
# All of them are extenal for us.
# passenv is here because `TOX_TESTENV_PASSENV`
# no longer works in tox 4.
# All of them are external for us.
# Because tox 4 no longer reads $TOX_TESTENV_PASSENV,
# this plugin always passes all environment variables by default.
if opt.current_env:
allow_external_cmds = MemoryLoader(allowlist_externals=["*"], passenv=["*"])
allow_external_cmds = MemoryLoader(allowlist_externals=["*"], pass_env=["*"])
env_conf.loaders.insert(0, allow_external_cmds)
# For print-deps-to and print-extras-to, use empty
# list of commands so the tox does nothing.