From b2108fdd400248cd79bfe6925301d7f3779225b1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 2 Jul 2025 10:40:16 +0200 Subject: [PATCH] Update Dockerfile.dev to only use uv for Python (#147926) --- Dockerfile.dev | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index 5a3f1a2ae64..4c037799567 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,15 +1,7 @@ -FROM mcr.microsoft.com/devcontainers/python:1-3.13 +FROM mcr.microsoft.com/vscode/devcontainers/base:debian SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# Uninstall pre-installed formatting and linting tools -# They would conflict with our pinned versions -RUN \ - pipx uninstall pydocstyle \ - && pipx uninstall pycodestyle \ - && pipx uninstall mypy \ - && pipx uninstall pylint - RUN \ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ && apt-get update \ @@ -32,21 +24,18 @@ RUN \ libxml2 \ git \ cmake \ + autoconf \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Add go2rtc binary COPY --from=ghcr.io/alexxit/go2rtc:latest /usr/local/bin/go2rtc /bin/go2rtc -# Install uv -RUN pip3 install uv - WORKDIR /usr/src -# Setup hass-release -RUN git clone --depth 1 https://github.com/home-assistant/hass-release \ - && uv pip install --system -e hass-release/ \ - && chown -R vscode /usr/src/hass-release/data +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv + +RUN uv python install 3.13.2 USER vscode ENV VIRTUAL_ENV="/home/vscode/.local/ha-venv" @@ -55,6 +44,10 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH" WORKDIR /tmp +# Setup hass-release +RUN git clone --depth 1 https://github.com/home-assistant/hass-release ~/hass-release \ + && uv pip install -e ~/hass-release/ + # Install Python dependencies from requirements COPY requirements.txt ./ COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt @@ -65,4 +58,4 @@ RUN uv pip install -r requirements_test.txt WORKDIR /workspaces # Set the default shell to bash instead of sh -ENV SHELL /bin/bash +ENV SHELL=/bin/bash