mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Use the python version from .pyton-version file for hassfest image (#168368)
This commit is contained in:
@@ -127,7 +127,7 @@ def _generate_machine_dockerfile(
|
||||
_HASSFEST_TEMPLATE = r"""# Automatically generated by hassfest.
|
||||
#
|
||||
# To update, run python3 -m script.hassfest -p docker
|
||||
FROM python:3.14-alpine
|
||||
FROM python:{python_version}-alpine
|
||||
|
||||
ENV \
|
||||
UV_SYSTEM_PYTHON=true \
|
||||
@@ -166,6 +166,11 @@ LABEL "com.github.actions.color"="gray-dark"
|
||||
"""
|
||||
|
||||
|
||||
def _get_python_version(root: Path) -> str:
|
||||
"""Extract the Python version from .python-version."""
|
||||
return (root / ".python-version").read_text(encoding="UTF-8").strip()
|
||||
|
||||
|
||||
@dataclass
|
||||
class File:
|
||||
"""File."""
|
||||
@@ -194,7 +199,9 @@ def _generate_files(config: Config) -> list[File]:
|
||||
config.root / "Dockerfile",
|
||||
),
|
||||
File(
|
||||
_HASSFEST_TEMPLATE.format(),
|
||||
_HASSFEST_TEMPLATE.format(
|
||||
python_version=_get_python_version(config.root),
|
||||
),
|
||||
config.root / "script/hassfest/docker/Dockerfile",
|
||||
),
|
||||
]
|
||||
|
||||
Generated
+1
-1
@@ -1,7 +1,7 @@
|
||||
# Automatically generated by hassfest.
|
||||
#
|
||||
# To update, run python3 -m script.hassfest -p docker
|
||||
FROM python:3.14-alpine
|
||||
FROM python:3.14.2-alpine
|
||||
|
||||
ENV \
|
||||
UV_SYSTEM_PYTHON=true \
|
||||
|
||||
Reference in New Issue
Block a user