{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/tox-dev/tox/main/src/tox/tox.schema.json", "title": "tox configuration", "description": "tox configuration file (tox.toml or [tool.tox] in pyproject.toml)", "x-taplo": { "links": { "key": "https://tox.wiki/en/stable/config.html" } }, "type": "object", "properties": { "tox_root": { "type": "string", "description": "the root directory (where the configuration file is found)" }, "toxinidir": { "$ref": "#/properties/tox_root", "description": "Deprecated: use 'tox_root' instead", "deprecated": true }, "work_dir": { "type": "string", "description": "working directory" }, "toxworkdir": { "$ref": "#/properties/work_dir", "description": "Deprecated: use 'work_dir' instead", "deprecated": true }, "temp_dir": { "type": "string", "description": "a folder for temporary files (is not cleaned at start)" }, "venv_redirect": { "type": "boolean", "description": "(provisional) point a PEP-832 .venv redirect file at a tox environment, so editors can discover it; unset means on unless a tox environment lives at .venv" }, "venv_redirect_env": { "type": "string", "description": "(provisional) the tox environment the .venv redirect file points at, picked automatically when unset" }, "env_list": { "type": "array", "items": { "$ref": "#/definitions/env_list_item" }, "description": "define environments to automatically run" }, "envlist": { "$ref": "#/properties/env_list", "description": "Deprecated: use 'env_list' instead", "deprecated": true }, "base": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "inherit missing keys from these sections" }, "min_version": { "type": "string", "description": "Define the minimal tox version required to run" }, "minversion": { "$ref": "#/properties/min_version", "description": "Deprecated: use 'min_version' instead", "deprecated": true }, "provision_tox_env": { "type": "string", "description": "Name of the virtual environment used to provision a tox." }, "requires": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "Dependencies the Python environment hosting tox must satisfy, provisioned when missing" }, "labels": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/env_list_item" } }, "description": "core labels" }, "ignore_base_python_conflict": { "type": "boolean", "description": "do not raise error if the environment name conflicts with base python" }, "ignore_basepython_conflict": { "$ref": "#/properties/ignore_base_python_conflict", "description": "Deprecated: use 'ignore_base_python_conflict' instead", "deprecated": true }, "skip_missing_interpreters": { "type": "boolean", "description": "skip running missing interpreters" }, "no_package": { "type": "boolean", "description": "is there any packaging involved in this project" }, "skipsdist": { "$ref": "#/properties/no_package", "description": "Deprecated: use 'no_package' instead", "deprecated": true }, "package_env": { "type": "string", "description": "tox environment used to package" }, "isolated_build_env": { "$ref": "#/properties/package_env", "description": "Deprecated: use 'package_env' instead", "deprecated": true }, "package_root": { "type": "string", "description": "indicates where the packaging root file exists (historically setup.py file or pyproject.toml now)" }, "setupdir": { "$ref": "#/properties/package_root", "description": "Deprecated: use 'package_root' instead", "deprecated": true }, "env_run_base": { "type": "object", "description": "base configuration for run environments", "x-taplo": { "links": { "key": "https://tox.wiki/en/stable/config.html#run-environment" } }, "properties": { "set_env": { "type": "object", "additionalProperties": { "$ref": "#/definitions/subs" }, "description": "environment variables to set when running commands in the tox environment" }, "setenv": { "$ref": "#/properties/env_run_base/properties/set_env", "description": "Deprecated: use 'set_env' instead", "deprecated": true }, "base": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "inherit missing keys from these sections" }, "runner": { "type": "string", "description": "the tox execute used to evaluate this environment" }, "description": { "type": "string", "description": "description attached to the tox environment" }, "depends": { "type": "array", "items": { "$ref": "#/definitions/env_list_item" }, "description": "tox environments that this environment depends on (must be run after those)" }, "labels": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "labels attached to the tox environment" }, "env_dir": { "type": "string", "description": "directory assigned to the tox environment" }, "envdir": { "$ref": "#/properties/env_run_base/properties/env_dir", "description": "Deprecated: use 'env_dir' instead", "deprecated": true }, "env_tmp_dir": { "type": "string", "description": "a folder that is always reset at the start of the run" }, "envtmpdir": { "$ref": "#/properties/env_run_base/properties/env_tmp_dir", "description": "Deprecated: use 'env_tmp_dir' instead", "deprecated": true }, "env_log_dir": { "type": "string", "description": "a folder for logging where tox will put logs of tool invocation" }, "envlogdir": { "$ref": "#/properties/env_run_base/properties/env_log_dir", "description": "Deprecated: use 'env_log_dir' instead", "deprecated": true }, "suicide_timeout": { "type": "number", "description": "timeout to allow process to exit before sending SIGINT" }, "interrupt_timeout": { "type": "number", "description": "timeout before sending SIGTERM after SIGINT" }, "terminate_timeout": { "type": "number", "description": "timeout before sending SIGKILL after SIGTERM" }, "platform": { "type": "string", "description": "run on platforms that match this regular expression (empty means any platform)" }, "pass_env": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "environment variables to pass on to the tox environment" }, "passenv": { "$ref": "#/properties/env_run_base/properties/pass_env", "description": "Deprecated: use 'pass_env' instead", "deprecated": true }, "disallow_pass_env": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "environment variable patterns to exclude after pass_env glob expansion" }, "parallel_show_output": { "type": "boolean", "description": "if set to True the content of the output will always be shown when running in parallel mode" }, "recreate": { "type": "boolean", "description": "always recreate virtual environment if this option is true, otherwise leave it up to tox" }, "allowlist_externals": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "external command glob to allow calling" }, "list_dependencies_command": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "command used to list installed packages" }, "pip_pre": { "type": "boolean", "description": "install the latest available pre-release (alpha/beta/rc) of dependencies without a specified version" }, "install_command": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "command used to install packages" }, "constraints": { "type": "string", "description": "constraints to apply to installed python dependencies" }, "constrain_package_deps": { "type": "boolean", "description": "If true, apply constraints during install_package_deps." }, "use_frozen_constraints": { "type": "boolean", "description": "Use the exact versions of installed deps as constraints, otherwise use the listed deps." }, "commands_pre": { "type": "array", "items": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/subs" } }, { "$ref": "#/definitions/replace_object" } ] }, "description": "the commands to be called before testing" }, "commands": { "type": "array", "items": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/subs" } }, { "$ref": "#/definitions/replace_object" } ] }, "description": "the commands to be called for testing" }, "commands_post": { "type": "array", "items": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/subs" } }, { "$ref": "#/definitions/replace_object" } ] }, "description": "the commands to be called after testing" }, "interrupt_post_commands": { "type": "boolean", "description": "run commands_post even after interrupt (SIGINT), allow second interrupt to cancel" }, "recreate_commands": { "type": "array", "items": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/subs" } }, { "$ref": "#/definitions/replace_object" } ] }, "description": "commands to run before the environment is removed during recreation (e.g. cache cleanup)" }, "change_dir": { "type": "string", "description": "change to this working directory when executing the test command" }, "changedir": { "$ref": "#/properties/env_run_base/properties/change_dir", "description": "Deprecated: use 'change_dir' instead", "deprecated": true }, "args_are_paths": { "type": "boolean", "description": "if True rewrite relative posargs paths from cwd to change_dir" }, "ignore_errors": { "type": "boolean", "description": "when executing the commands keep going even if a sub-command exits with non-zero exit code" }, "commands_retry": { "type": "integer", "minimum": 0, "description": "number of times to retry a failed command (0 means no retries)" }, "ignore_outcome": { "type": "boolean", "description": "if set to true a failing result of this testenv will not make tox fail (instead just warn)" }, "fail_fast": { "type": "boolean", "description": "if set to true, tox will stop executing remaining environments when this environment fails" }, "default_base_python": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/subs" } }, { "type": "string" } ], "description": "fallback python interpreter used when no factor or explicit base_python is defined" }, "base_python_file": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/subs" } }, { "type": "string" } ], "description": "file(s) containing the Python version to use (e.g. .python-version), first one found wins; used when base_python is not explicitly set and the env name has no Python factor" }, "base_python": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/subs" } }, { "type": "string" } ], "description": "environment identifier for python, first one found wins" }, "basepython": { "$ref": "#/properties/env_run_base/properties/base_python", "description": "Deprecated: use 'base_python' instead", "deprecated": true }, "deps": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/definitions/subs" } } ], "description": "python dependencies with optional version specifiers, as specified by PEP-440" }, "dependency_groups": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "dependency groups to install of the target package" }, "extras": { "type": "array", "items": { "$ref": "#/definitions/subs" }, "description": "extras to install of the target package" }, "pylock": { "type": "string", "description": "PEP 751 pylock.toml lock file path to install locked dependencies from" }, "extra_setup_commands": { "type": "array", "items": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/subs" } }, { "$ref": "#/definitions/replace_object" } ] }, "description": "commands to execute after setup (deps and package install) but before test commands" }, "skip_missing_interpreters": { "type": "boolean", "description": "override core skip_missing_interpreters for this environment" }, "system_site_packages": { "type": "boolean", "description": "create virtual environments that also have access to globally installed packages." }, "sitepackages": { "$ref": "#/properties/env_run_base/properties/system_site_packages", "description": "Deprecated: use 'system_site_packages' instead", "deprecated": true }, "always_copy": { "type": "boolean", "description": "force virtualenv to always copy rather than symlink" }, "alwayscopy": { "$ref": "#/properties/env_run_base/properties/always_copy", "description": "Deprecated: use 'always_copy' instead", "deprecated": true }, "download": { "type": "boolean", "description": "true if you want virtualenv to upgrade pip/wheel/setuptools to the latest version" }, "virtualenv_spec": { "type": "string", "description": "PEP 440 version spec for virtualenv (e.g. virtualenv<20.22.0). When set, tox bootstraps this version in an isolated environment and runs it via subprocess, enabling Python versions incompatible with the installed virtualenv. Left empty it is derived automatically: tox pins an older virtualenv only when the installed one can no longer create the targeted Python version." }, "skip_install": { "type": "boolean", "description": "skip installation" }, "use_develop": { "type": "boolean", "description": "use develop mode" }, "usedevelop": { "$ref": "#/properties/env_run_base/properties/use_develop", "description": "Deprecated: use 'use_develop' instead", "deprecated": true }, "package": { "type": "string", "description": "package installation mode - wheel | sdist | sdist-wheel | editable | editable-legacy | deps-only | skip | external " }, "package_env": { "type": "string", "description": "tox environment used to package" } }, "additionalProperties": true }, "env_pkg_base": { "type": "object", "$ref": "#/properties/env_run_base", "description": "base configuration for packaging environments", "x-taplo": { "links": { "key": "https://tox.wiki/en/stable/config.html#packaging-environment" } }, "additionalProperties": true }, "env": { "type": "object", "description": "per-environment overrides (keyed by environment name)", "x-taplo": { "links": { "key": "https://tox.wiki/en/stable/config.html#run-environment" } }, "patternProperties": { "^.*$": { "$ref": "#/properties/env_run_base" } } }, "legacy_tox_ini": { "type": "string", "description": "tox configuration in INI format embedded in a TOML file", "x-taplo": { "links": { "key": "https://tox.wiki/en/stable/config.html#pyproject-toml-ini" } } } }, "additionalProperties": true, "definitions": { "subs": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/replace_env" }, { "$ref": "#/definitions/replace_ref" }, { "$ref": "#/definitions/replace_posargs" }, { "$ref": "#/definitions/replace_glob" }, { "$ref": "#/definitions/replace_if" } ] }, "replace_env": { "type": "object", "description": "substitute the value of an environment variable", "properties": { "replace": { "const": "env" }, "name": { "type": "string" }, "default": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/definitions/subs" } } ] }, "extend": { "type": "boolean" }, "marker": { "type": "string" } }, "required": ["replace", "name"], "additionalProperties": false }, "replace_ref": { "type": "object", "description": "substitute the value of another configuration key", "properties": { "replace": { "const": "ref" }, "of": { "type": "array", "items": { "type": "string" } }, "env": { "type": "string" }, "key": { "type": "string" }, "default": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/definitions/subs" } } ] }, "extend": { "type": "boolean" }, "marker": { "type": "string" } }, "required": ["replace"], "additionalProperties": false }, "replace_posargs": { "type": "object", "description": "substitute the positional arguments passed to tox", "properties": { "replace": { "const": "posargs" }, "default": { "type": "array", "items": { "$ref": "#/definitions/subs" } }, "substitute": { "type": "boolean", "default": false }, "extend": { "type": "boolean" }, "marker": { "type": "string" } }, "required": ["replace"], "additionalProperties": false }, "replace_glob": { "type": "object", "description": "substitute matches of a filesystem glob pattern", "properties": { "replace": { "const": "glob" }, "pattern": { "type": "string" }, "default": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/definitions/subs" } } ] }, "extend": { "type": "boolean" }, "marker": { "type": "string" } }, "required": ["replace", "pattern"], "additionalProperties": false }, "replace_if": { "type": "object", "description": "conditional substitution based on env vars, factors, or env_name", "properties": { "replace": { "const": "if" }, "condition": { "type": "string" }, "then": true, "else": true, "extend": { "type": "boolean" }, "marker": { "type": "string" } }, "required": ["replace", "condition", "then"], "additionalProperties": false }, "replace_object": { "description": "any of the table-form replacements; usable wherever a list item can be a replacement", "anyOf": [ { "$ref": "#/definitions/replace_env" }, { "$ref": "#/definitions/replace_ref" }, { "$ref": "#/definitions/replace_posargs" }, { "$ref": "#/definitions/replace_glob" }, { "$ref": "#/definitions/replace_if" } ] }, "factor_range_dict": { "type": "object", "required": ["prefix"], "properties": { "prefix": { "type": "string" }, "start": { "type": "integer" }, "stop": { "type": "integer" }, "default": { "type": "string" } }, "additionalProperties": false, "description": "range factor group: expands to prefix+N for N in [start, stop]" }, "factor_values_dict": { "type": "object", "required": ["values"], "properties": { "values": { "type": "array", "items": { "type": "string" } }, "default": { "type": "string" } }, "additionalProperties": false, "description": "factor group with an explicit list and a default used when none of it is active" }, "factor_labeled_dict": { "type": "object", "minProperties": 1, "maxProperties": 1, "not": { "properties": { "prefix": {} }, "required": ["prefix"] }, "additionalProperties": { "oneOf": [ { "type": "array", "items": { "type": "string" } }, { "$ref": "#/definitions/factor_range_dict" }, { "$ref": "#/definitions/factor_values_dict" } ] }, "description": "labeled factor group for {factor:label} substitution" }, "product_factor_group": { "oneOf": [ { "type": "array", "items": { "type": "string" } }, { "$ref": "#/definitions/factor_range_dict" }, { "$ref": "#/definitions/factor_labeled_dict" } ] }, "env_list_item": { "oneOf": [ { "$ref": "#/definitions/subs" }, { "type": "object", "required": ["product"], "properties": { "product": { "type": "array", "items": { "$ref": "#/definitions/product_factor_group" }, "description": "factor groups for cartesian product expansion" }, "exclude": { "type": "array", "items": { "type": "string" }, "description": "environment names to exclude from product" } }, "additionalProperties": false }, { "$ref": "#/definitions/factor_range_dict" }, { "$ref": "#/definitions/factor_labeled_dict" } ] } } }