From 970e6fbcc49645dcac8a1ad90cd24c5ea70c70d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Tue, 12 May 2026 12:19:32 -0700 Subject: [PATCH 1/2] Update tox JSON Schema to 4.54.0 --- src/schemas/json/tox.json | 585 +++++++++++++++++++++----------------- 1 file changed, 330 insertions(+), 255 deletions(-) diff --git a/src/schemas/json/tox.json b/src/schemas/json/tox.json index dc59b9f71cc..5a49cbf3c26 100644 --- a/src/schemas/json/tox.json +++ b/src/schemas/json/tox.json @@ -35,70 +35,7 @@ "env_list": { "type": "array", "items": { - "oneOf": [ - { - "$ref": "#/definitions/subs" - }, - { - "type": "object", - "required": ["product"], - "properties": { - "product": { - "type": "array", - "items": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "object", - "required": ["prefix"], - "properties": { - "prefix": { - "type": "string" - }, - "start": { - "type": "integer" - }, - "stop": { - "type": "integer" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "minProperties": 1, - "maxProperties": 1, - "not": { - "required": ["prefix"] - }, - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "labeled factor group for {factor:label} substitution" - } - ] - }, - "description": "factor groups for cartesian product expansion" - }, - "exclude": { - "type": "array", - "items": { - "type": "string" - }, - "description": "environment names to exclude from product" - } - }, - "additionalProperties": false - } - ] + "$ref": "#/definitions/env_list_item" }, "description": "define environments to automatically run" }, @@ -139,70 +76,7 @@ "additionalProperties": { "type": "array", "items": { - "oneOf": [ - { - "$ref": "#/definitions/subs" - }, - { - "type": "object", - "required": ["product"], - "properties": { - "product": { - "type": "array", - "items": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "object", - "required": ["prefix"], - "properties": { - "prefix": { - "type": "string" - }, - "start": { - "type": "integer" - }, - "stop": { - "type": "integer" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "minProperties": 1, - "maxProperties": 1, - "not": { - "required": ["prefix"] - }, - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "labeled factor group for {factor:label} substitution" - } - ] - }, - "description": "factor groups for cartesian product expansion" - }, - "exclude": { - "type": "array", - "items": { - "type": "string" - }, - "description": "environment names to exclude from product" - } - }, - "additionalProperties": false - } - ] + "$ref": "#/definitions/env_list_item" } }, "description": "core labels" @@ -286,70 +160,7 @@ "depends": { "type": "array", "items": { - "oneOf": [ - { - "$ref": "#/definitions/subs" - }, - { - "type": "object", - "required": ["product"], - "properties": { - "product": { - "type": "array", - "items": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "object", - "required": ["prefix"], - "properties": { - "prefix": { - "type": "string" - }, - "start": { - "type": "integer" - }, - "stop": { - "type": "integer" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "minProperties": 1, - "maxProperties": 1, - "not": { - "required": ["prefix"] - }, - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "labeled factor group for {factor:label} substitution" - } - ] - }, - "description": "factor groups for cartesian product expansion" - }, - "exclude": { - "type": "array", - "items": { - "type": "string" - }, - "description": "environment names to exclude from product" - } - }, - "additionalProperties": false - } - ] + "$ref": "#/definitions/env_list_item" }, "description": "tox environments that this environment depends on (must be run after those)" }, @@ -470,30 +281,51 @@ "commands_pre": { "type": "array", "items": { - "type": "array", - "items": { - "$ref": "#/definitions/subs" - } + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/subs" + } + }, + { + "$ref": "#/definitions/replace_object" + } + ] }, "description": "the commands to be called before testing" }, "commands": { "type": "array", "items": { - "type": "array", - "items": { - "$ref": "#/definitions/subs" - } + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/subs" + } + }, + { + "$ref": "#/definitions/replace_object" + } + ] }, "description": "the commands to be called for testing" }, "commands_post": { "type": "array", "items": { - "type": "array", - "items": { - "$ref": "#/definitions/subs" - } + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/subs" + } + }, + { + "$ref": "#/definitions/replace_object" + } + ] }, "description": "the commands to be called after testing" }, @@ -504,10 +336,17 @@ "recreate_commands": { "type": "array", "items": { - "type": "array", - "items": { - "$ref": "#/definitions/subs" - } + "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)" }, @@ -623,10 +462,17 @@ "extra_setup_commands": { "type": "array", "items": { - "type": "array", - "items": { - "$ref": "#/definitions/subs" - } + "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" }, @@ -685,8 +531,8 @@ "additionalProperties": true }, "env_pkg_base": { - "$ref": "#/properties/env_run_base", "type": "object", + "$ref": "#/properties/env_run_base", "description": "base configuration for packaging environments", "x-taplo": { "links": { @@ -727,65 +573,294 @@ "type": "string" }, { - "type": "object", - "properties": { - "replace": { + "$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" }, - "name": { + { + "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" }, - "default": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/subs" - } - } - ] + { + "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" + } + }, + "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" }, - "extend": { - "type": "boolean" + { + "type": "array", + "items": { + "$ref": "#/definitions/subs" + } } - }, - "required": ["replace"], - "additionalProperties": false + ] + }, + "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" + } + }, + "additionalProperties": false, + "description": "range factor group: expands to prefix+N for N in [start, stop]" + }, + "factor_labeled_dict": { + "type": "object", + "minProperties": 1, + "maxProperties": 1, + "not": { + "required": [ + "prefix" + ] + }, + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "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": { - "replace": { - "type": "string" + "product": { + "type": "array", + "items": { + "$ref": "#/definitions/product_factor_group" + }, + "description": "factor groups for cartesian product expansion" }, - "of": { + "exclude": { "type": "array", "items": { "type": "string" - } - }, - "default": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/subs" - } - } - ] - }, - "extend": { - "type": "boolean" + }, + "description": "environment names to exclude from product" } }, - "required": ["replace", "of"], "additionalProperties": false + }, + { + "$ref": "#/definitions/factor_range_dict" + }, + { + "$ref": "#/definitions/factor_labeled_dict" } ] } From d4a0a303ab366f54e0ff82d5cfc96e836321f9af Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 19:21:58 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/schemas/json/tox.json | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/src/schemas/json/tox.json b/src/schemas/json/tox.json index 5a49cbf3c26..cefe1e3cd6a 100644 --- a/src/schemas/json/tox.json +++ b/src/schemas/json/tox.json @@ -531,8 +531,8 @@ "additionalProperties": true }, "env_pkg_base": { - "type": "object", "$ref": "#/properties/env_run_base", + "type": "object", "description": "base configuration for packaging environments", "x-taplo": { "links": { @@ -619,10 +619,7 @@ "type": "string" } }, - "required": [ - "replace", - "name" - ], + "required": ["replace", "name"], "additionalProperties": false }, "replace_ref": { @@ -664,9 +661,7 @@ "type": "string" } }, - "required": [ - "replace" - ], + "required": ["replace"], "additionalProperties": false }, "replace_posargs": { @@ -689,9 +684,7 @@ "type": "string" } }, - "required": [ - "replace" - ], + "required": ["replace"], "additionalProperties": false }, "replace_glob": { @@ -724,10 +717,7 @@ "type": "string" } }, - "required": [ - "replace", - "pattern" - ], + "required": ["replace", "pattern"], "additionalProperties": false }, "replace_if": { @@ -749,11 +739,7 @@ "type": "string" } }, - "required": [ - "replace", - "condition", - "then" - ], + "required": ["replace", "condition", "then"], "additionalProperties": false }, "replace_object": { @@ -778,9 +764,7 @@ }, "factor_range_dict": { "type": "object", - "required": [ - "prefix" - ], + "required": ["prefix"], "properties": { "prefix": { "type": "string" @@ -800,9 +784,7 @@ "minProperties": 1, "maxProperties": 1, "not": { - "required": [ - "prefix" - ] + "required": ["prefix"] }, "additionalProperties": { "type": "array", @@ -835,9 +817,7 @@ }, { "type": "object", - "required": [ - "product" - ], + "required": ["product"], "properties": { "product": { "type": "array",