Anchor the 4.x rejection to the framework version line, isolate the ccache env test

The installer's EsphomeError becomes cv.Invalid at the config
validator, and test_ccache_env clears the ambient environment so a
developer's exported CCACHE_DIR cannot fail it.
This commit is contained in:
J. Nick Koston
2026-08-21 12:51:09 -05:00
parent 85335de839
commit 1f1cab9c37
2 changed files with 9 additions and 3 deletions
+6 -1
View File
@@ -138,7 +138,12 @@ def _format_framework_arduino_version(ver: cv.Version) -> str:
# version bump cannot drift between the two paths.
from esphome.arduino8266.framework import framework_package_version
return f"~{framework_package_version(ver)}"
try:
return f"~{framework_package_version(ver)}"
except EsphomeError as err:
# Anchor the 4.x rejection to the framework version line instead of
# aborting with a bare traceback-level error
raise cv.Invalid(str(err)) from err
# NOTE: Keep this in mind when updating the recommended version: