From b024d88b3642fe68e482bad9dcae76386d633dc4 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 4 Oct 2021 23:58:20 -0700 Subject: [PATCH] Deprecate Python 3.8 (#57079) --- homeassistant/bootstrap.py | 12 +++++++++--- homeassistant/const.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index f2b3d5e6ec4..f111ff6a079 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -17,7 +17,10 @@ import yarl from homeassistant import config as conf_util, config_entries, core, loader from homeassistant.components import http -from homeassistant.const import REQUIRED_NEXT_PYTHON_DATE, REQUIRED_NEXT_PYTHON_VER +from homeassistant.const import ( + REQUIRED_NEXT_PYTHON_HA_RELEASE, + REQUIRED_NEXT_PYTHON_VER, +) from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import area_registry, device_registry, entity_registry from homeassistant.helpers.dispatcher import async_dispatcher_send @@ -240,11 +243,14 @@ async def async_from_config_dict( stop = monotonic() _LOGGER.info("Home Assistant initialized in %.2fs", stop - start) - if REQUIRED_NEXT_PYTHON_DATE and sys.version_info[:3] < REQUIRED_NEXT_PYTHON_VER: + if ( + REQUIRED_NEXT_PYTHON_HA_RELEASE + and sys.version_info[:3] < REQUIRED_NEXT_PYTHON_VER + ): msg = ( "Support for the running Python version " f"{'.'.join(str(x) for x in sys.version_info[:3])} is deprecated and will " - f"be removed in the first release after {REQUIRED_NEXT_PYTHON_DATE}. " + f"be removed in Home Assistant {REQUIRED_NEXT_PYTHON_HA_RELEASE}. " "Please upgrade Python to " f"{'.'.join(str(x) for x in REQUIRED_NEXT_PYTHON_VER)} or " "higher." diff --git a/homeassistant/const.py b/homeassistant/const.py index 2f408491d29..483109737ed 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -11,7 +11,7 @@ __version__: Final = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 8, 0) # Truthy date string triggers showing related deprecation warning messages. REQUIRED_NEXT_PYTHON_VER: Final[tuple[int, int, int]] = (3, 9, 0) -REQUIRED_NEXT_PYTHON_DATE: Final = "" +REQUIRED_NEXT_PYTHON_HA_RELEASE: Final = "2022.1" # Format for platform files PLATFORM_FORMAT: Final = "{platform}.{domain}"