[packages] Add more information and deprecation deadline for "single package" includes (#12280)

This commit is contained in:
Javier Peletier
2025-12-09 16:04:10 +01:00
committed by GitHub
parent e1afd65fae
commit 88a2e75989
2 changed files with 11 additions and 5 deletions

View File

@@ -91,7 +91,16 @@ def validate_source_shorthand(value):
def deprecate_single_package(config):
_LOGGER.warning(
"Including a single package under `packages:` is deprecated. Use a list instead."
"""
Including a single package under `packages:`, i.e., `packages: !include mypackage.yaml` is deprecated.
This method for including packages will go away in 2026.7.0
Please use a list instead:
packages:
- !include mypackage.yaml
See https://github.com/esphome/esphome/pull/12116
"""
)
return config

View File

@@ -176,10 +176,7 @@ def test_single_package(
assert actual == expected
assert (
"Including a single package under `packages:` is deprecated. Use a list instead."
in caplog.text
)
assert "This method for including packages will go away in 2026.7.0" in caplog.text
def test_package_append(basic_wifi, basic_esphome):