Skip to content

Custom Loader Plugin #2882

Answered by gaborbernat
greg-hellings asked this question in Q&A
Jan 18, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

I'm not aware of similar plugins but the advice from discord is the way to go 🙂 Here's a quick demonstration via an inline plugin seeded via toxfile.py.

❯ lsd --tree .
 .
├──  tox.ini
└──  toxfile.py
# toxfile.py
from tox.config.loader.memory import MemoryLoader
from tox.config.sets import CoreConfigSet, EnvConfigSet
from tox.config.types import EnvList
from tox.plugin import impl
from tox.session.state import State


@impl
def tox_add_core_config(core_conf: CoreConfigSet, state: State) -> None:
    # override env list
    core_conf.loaders.insert(0, MemoryLoader(env_list=EnvList(["a", "b"])))
	# extend env list
	env_list = cast(EnvList, core_conf["env_list"])
    env_list.envs.extend([

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@greg-hellings
Comment options

@gaborbernat
Comment options

@greg-hellings
Comment options

@gaborbernat
Comment options

Answer selected by gaborbernat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants