tox API reference
121 public APIs from tox (tox-dev/tox) — 50 classes, 23 functions, 48 methods. Signatures extracted by static analysis of the actual source.
Repository: tox-dev/tox
| Kind | Count |
|---|---|
| Classes | 50 |
| Functions | 23 |
| Methods | 48 |
API list
func
src.tox.config.cli.env_var.get_env_var(key:str, of_type:type[Any]) -> tuple[Any, str] | NoneGet the environment variable option.
class
src.tox.config.cli.parser.ParsedCLI options.
method
src.tox.config.cli.parser.Parsed.is_colored() -> bool:returns: flag indicating if the output is colored or not
method
src.tox.config.cli.parser.Parsed.verbosity() -> int:returns: reporting verbosity
class
src.tox.config.cli.parser.ToxParserArgument parser for tox.
class
src.tox.config.loader.api.ConfigLoadArgsArguments that help loading a configuration value.
method
src.tox.config.loader.api.ConfigLoadArgs.copy() -> ConfigLoadArgs:returns: create a copy of the object
class
src.tox.config.loader.api.LoaderLoader loads configuration values and converts it.
method
src.tox.config.loader.api.Loader.load(key:str, of_type:type[V] | UnionType, factory:Factory[V], conf:Config | None, args:ConfigLoadArgs, all_keys:Iterable[str]=()) -> VLoad a value (raw and then convert).
method
src.tox.config.loader.api.Loader.load_raw(key:str, conf:Config | None, env_name:str | None) -> TLoad the raw object from the config store.
class
src.tox.config.loader.api.OverrideAn override for config definitions.
method
src.tox.config.loader.convert.Convert.to(raw:T, of_type:type[V] | UnionType, factory:Factory[V]) -> VConvert given raw type to python type.
method
src.tox.config.loader.convert.Convert.to_bool(value:T) -> boolConvert to boolean.
method
src.tox.config.loader.convert.Convert.to_command(value:T) -> Command | NoneConvert to a command to execute.
method
src.tox.config.loader.convert.Convert.to_dict(value:T, of_type:tuple[type[Any], type[Any]]) -> Iterator[tuple[T, T]]Convert to dictionary.
method
src.tox.config.loader.convert.Convert.to_env_list(value:T) -> EnvListConvert to a tox EnvList.
method
src.tox.config.loader.convert.Convert.to_list(value:T, of_type:type[Any]) -> Iterator[T]Convert to list.
method
src.tox.config.loader.convert.Convert.to_path(value:T) -> PathConvert to path.
method
src.tox.config.loader.convert.Convert.to_set(value:T, of_type:type[Any]) -> Iterator[T]Convert to set.
method
src.tox.config.loader.convert.Convert.to_str(value:T) -> strConvert to string.
func
src.tox.config.loader.ini.factor.expand_ranges(value:str) -> strExpand ranges in env expressions.
class
src.tox.config.loader.memory.MemoryLoaderLoads configuration directly from data in memory.
class
src.tox.config.loader.replacer.MatchErrorCouldn't find end terminator in MatchExpression.
class
src.tox.config.loader.replacer.MatchExpressionAn expression that is handled specially by the Replacer.
method
src.tox.config.loader.replacer.MatchExpression.parse_and_split_to_terminator(value:str, terminator:str='', split:str | None=None) -> tuple[Sequence[MatchArg], int]Tokenize `value` to up `terminator` character.
class
src.tox.config.loader.replacer.MatchRecursionErrorCould not stabilize on replacement value.
func
src.tox.config.loader.replacer.find_replace_expr(value:str) -> MatchArgFind all replaceable tokens within value.
class
src.tox.config.loader.section.Sectiontox configuration section.
method
src.tox.config.loader.section.Section.from_key(key:str) -> SelfCreate a section from a section key.
method
src.tox.config.loader.section.Section.key() -> str:returns: the section key
method
src.tox.config.loader.section.Section.name() -> str:returns: the name of the section
method
src.tox.config.loader.section.Section.prefix() -> str | None:returns: the prefix of the section
class
src.tox.config.loader.str_convert.StrConvertA class converting string values to tox types.
func
src.tox.config.loader.stringify.stringify(value:Any) -> tuple[str, bool]Transform a value into a string representation.
class
src.tox.config.loader.toml.TomlLoaderLoad configuration from a pyproject.toml file.
func
src.tox.config.loader.toml._product.expand_product(value:dict[str, Any]) -> list[str]Expand a product dict into a flat list of environment names.
class
src.tox.config.main.ConfigMain configuration object for tox.
method
src.tox.config.main.Config.core() -> CoreConfigSet:returns: the core configuration
method
src.tox.config.main.Config.make(parsed:Parsed, pos_args:Sequence[str] | None, source:Source, extra_envs:Iterable[str]) -> ConfigMake a tox configuration object.
method
src.tox.config.main.Config.src_path() -> Path:returns: the location of the tox configuration source
method
src.tox.config.main.Config.work_dir() -> Path:returns: working directory for this project
class
src.tox.config.of_type.ConfigDefinitionAbstract base class for configuration definitions.
class
src.tox.config.sets.CoreConfigSetConfiguration set for the core tox config.
class
src.tox.config.sets.EnvConfigSetConfiguration set for a tox environment.
method
src.tox.config.source.api.Source.get_core_section() -> Section:returns: the core section
method
src.tox.config.source.api.Source.get_tox_env_section(item:str) -> tuple[Section, list[str], list[str]]:returns: the section for a tox environment
method
src.tox.config.source.api.Source.sections() -> Iterator[Section]Return a loader that loads the core configuration values.
func
src.tox.config.source.discover.discover_source(config_file:Path | None, root_dir:Path | None) -> SourceDiscover a source for configuration.
class
src.tox.config.source.ini.IniSourceConfiguration sourced from a ini file (such as tox.ini).
class
src.tox.config.source.setup_cfg.SetupCfgConfiguration sourced from a setup.cfg file.
class
src.tox.config.source.toml_pyproject.TomlPyProjectConfiguration sourced from a pyproject.toml files.
class
src.tox.config.source.toml_tox.TomlToxConfiguration sourced from a pyproject.toml files.
class
src.tox.config.source.tox_ini.ToxIniConfiguration sourced from a tox.ini file.
class
src.tox.config.types.CircularChainErrorcircular chain in config
class
src.tox.config.types.CommandA command to execute.
class
src.tox.config.types.EnvListA tox environment list.
class
src.tox.execute.api.ExecuteAbstract API for execution of a tox environment.
class
src.tox.execute.api.ExecuteInstanceAn instance of a command execution.
class
src.tox.execute.api.OutcomeResult of a command execution.
method
src.tox.execute.api.Outcome.assert_failure() -> NoneAssert that the execution failed.
method
src.tox.execute.api.Outcome.assert_success() -> NoneAssert that the execution succeeded.
method
src.tox.execute.api.Outcome.elapsed() -> float:returns: time the execution took in seconds
method
src.tox.execute.api.Outcome.log_run_done(lvl:int) -> NoneLog that the run was done.
class
src.tox.execute.pep517_backend.LocalSubProcessPep517ExecuteInstanceA backend invocation.
class
src.tox.execute.pep517_backend.LocalSubProcessPep517ExecutorExecutor holding the backend process.
class
src.tox.execute.request.ExecuteRequestDefines a commands execution request.
method
src.tox.execute.request.ExecuteRequest.shell_cmd() -> str:returns: the command to run as a shell command
func
src.tox.execute.util.shebang(exe:str) -> list[str] | None:param exe: the executable :returns: the shebang interpreter arguments
class
src.tox.journal.env.EnvJournalReport the status of a tox environment.
method
src.tox.journal.env.EnvJournal.add_execute(outcome:Outcome, run_id:str) -> NoneAdd a command execution to the journal.
class
src.tox.journal.main.JournalThe result of a tox session.
method
src.tox.journal.main.Journal.get_env_journal(name:str) -> EnvJournalReturn the env log of an environment (create on first call).
func
src.tox.plugin.spec.tox_add_core_config(core_conf:ConfigSet, state:State) -> NoneCalled when the core configuration is built for a tox environment.
func
src.tox.plugin.spec.tox_add_env_config(env_conf:EnvConfigSet, state:State) -> NoneCalled when configuration is built for a tox environment.
func
src.tox.plugin.spec.tox_add_option(parser:ToxParser) -> NoneAdd a command line argument.
func
src.tox.plugin.spec.tox_after_run_commands(tox_env:ToxEnv, exit_code:int, outcomes:list[Outcome]) -> NoneCalled after the commands set is executed.
func
src.tox.plugin.spec.tox_before_run_commands(tox_env:ToxEnv) -> NoneCalled before the commands set is executed.
func
src.tox.plugin.spec.tox_env_teardown(tox_env:ToxEnv) -> NoneCalled after a tox environment has been teared down.
func
src.tox.plugin.spec.tox_extend_envs() -> Iterable[str]Declare additional environment names.
func
src.tox.plugin.spec.tox_on_install(tox_env:ToxEnv, arguments:Any, section:str, of_type:str) -> NoneCalled before executing an installation command.
func
src.tox.plugin.spec.tox_register_tox_env(register:ToxEnvRegister) -> NoneRegister new tox environment type.
class
src.tox.report.HandledErrorError that has been handled so no need for stack trace.
func
src.tox.run.setup_state(args:Sequence[str]) -> StateSetup the state object of this run.
func
src.tox.session.cmd.run.common.ready_to_run_envs(state:State, to_run:list[str], completed:set[str]) -> Iterator[list[str]]Generate tox environments ready to run.
func
src.tox.session.cmd.run.parallel.run_parallel(state:State) -> intHere we'll just start parallel sub-processes.
func
src.tox.session.env_select.register_env_select_flags(parser:ArgumentParser, default:CliEnv | None, multiple:bool=True, group_only:bool=False) -> argparse._ActionsContainerRegister environment selection flags.
class
src.tox.session.state.StateRuntime state holder.
method
src.tox.session.state.State.envs() -> EnvSelector:returns: provides access to the tox environments
class
src.tox.tox_env.api.ToxEnvA tox environment.
method
src.tox.tox_env.api.ToxEnv.env_dir() -> Path:returns: the tox environments environment folder
method
src.tox.tox_env.api.ToxEnv.env_log_dir() -> Path:returns: the tox environments log folder
method
src.tox.tox_env.api.ToxEnv.env_tmp_dir() -> Path:returns: the tox environments temp folder
method
src.tox.tox_env.api.ToxEnv.interrupt() -> NoneInterrupt the execution of a tox environment.
class
src.tox.tox_env.api.ToxEnvCreateArgsArguments to pass on when creating a tox environment.
class
src.tox.tox_env.errors.FailFailed creating env.
class
src.tox.tox_env.errors.RecreateRecreate the tox environment.
class
src.tox.tox_env.errors.RunnerUnavailableRunner for this environment is not available.
class
src.tox.tox_env.errors.SkipSkip this tox environment.
class
src.tox.tox_env.info.InfoStores metadata about the tox environment.
class
src.tox.tox_env.package.Packagepackage.
class
src.tox.tox_env.python.api.NoInterpretercould not find interpreter.
method
src.tox.tox_env.python.api.Python.base_python() -> PythonInfoResolve base python.
method
src.tox.tox_env.python.api.Python.env_bin_dir() -> PathThe binary folder within the tox environment.
method
src.tox.tox_env.python.api.Python.env_python() -> PathThe python executable within the tox environment.
method
src.tox.tox_env.python.api.Python.python_spec_for_path(path:Path) -> PythonSpecGet the spec for an absolute path to a Python executable.
class
src.tox.tox_env.python.package.EditableLegacyPackagelegacy editable package.
class
src.tox.tox_env.python.package.EditablePackagePEP-660 editable package.
class
src.tox.tox_env.python.package.PythonPackagepython package.
class
src.tox.tox_env.python.package.SdistPackagesdist package.
class
src.tox.tox_env.python.package.WheelPackagewheel package.
class
src.tox.tox_env.python.virtual_env.package.pyproject.BuildEditableNotSupportedErrorraised when build editable is not supported.
func
src.tox.tox_env.python.virtual_env.package.util.extract_extra_markers(deps:list[Requirement]) -> list[tuple[Requirement, set[str | None]]]Extract extra markers from dependencies.
class
src.tox.tox_env.register.ToxEnvRegistertox environment registry.
method
src.tox.tox_env.register.ToxEnvRegister.add_package_env(of_type:type[PackageToxEnv]) -> NoneDefine a new packaging tox environment type.
method
src.tox.tox_env.register.ToxEnvRegister.add_run_env(of_type:type[RunToxEnv]) -> NoneDefine a new run tox environment type.
method
src.tox.tox_env.register.ToxEnvRegister.default_env_runner() -> str:returns: the default run environment type
method
src.tox.tox_env.register.ToxEnvRegister.env_runners() -> Iterable[str]:returns: run environment types currently defined
method
src.tox.tox_env.register.ToxEnvRegister.package(name:str) -> type[PackageToxEnv]Lookup a packaging tox environment type by name.
method
src.tox.tox_env.register.ToxEnvRegister.runner(name:str) -> type[RunToxEnv]Lookup a run tox environment type by name.
func
src.tox.util.ci.is_ci() -> bool:returns: a flag indicating if running inside a CI env or not
func
src.tox.util.redact.redact_value(name:str, value:str) -> strMask ``value`` if ``name`` looks like it identifies a secret.
About this data
These signatures were extracted from the public source of tox-dev/tox
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.