From 71a1ba6f36ff5ec30f3cf4530171631e94712772 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 29 Jun 2026 11:42:48 +0000 Subject: [PATCH] [core] Fix CI: build_language_schema default, import budget, py312 ruff --- pyproject.toml | 4 ++++ script/build_language_schema.py | 6 ++++-- script/import_time_budget.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e9595785539..f80b07ce726 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -154,6 +154,10 @@ ignore = [ "PLW1641", # Object does not implement `__hash__` method "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable "PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target + # PEP 695 type-parameter syntax, newly flagged by the 3.12 target. Adopting it + # repo-wide is out of scope for the validation-engine swap; revisit separately. + "UP046", # Generic class uses `Generic` subclass instead of type parameters + "UP047", # Generic function should use type parameters ] [tool.ruff.lint.isort] diff --git a/script/build_language_schema.py b/script/build_language_schema.py index 95eebdd7c54..31b40c02599 100755 --- a/script/build_language_schema.py +++ b/script/build_language_schema.py @@ -1162,9 +1162,11 @@ def convert_keys(converted, schema, path): "value": str(default_value), "components": components, } - elif hasattr(k, "default") and str(k.default) != "...": + elif hasattr(k, "default") and not isinstance(k.default, probatio.Undefined): default_value = k.default() - if default_value is not None: + if default_value is not None and not isinstance( + default_value, probatio.Undefined + ): result["default"] = str(default_value) # UI hint from ``cv.Optional`` / ``cv.Required`` — surfaced diff --git a/script/import_time_budget.json b/script/import_time_budget.json index af3aa835113..0b4e3a56ce1 100644 --- a/script/import_time_budget.json +++ b/script/import_time_budget.json @@ -1,5 +1,5 @@ { "target_module": "esphome.__main__", "margin_pct": 15, - "cumulative_us": 91000 + "cumulative_us": 127000 }