Compare commits

...

2 Commits

Author SHA1 Message Date
Robert Resch
97fb03a1fa Merge remote-tracking branch 'origin/dev' into edenhaus/hassfest-python 2026-04-16 12:41:32 +00:00
Robert Resch
2cc1e74b87 Use the python version from .pyton-version file for hassfest image 2026-04-16 11:40:37 +00:00
2 changed files with 10 additions and 3 deletions

View File

@@ -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",
),
]

View File

@@ -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 \