From 0142e8d46873c2a8bf7ff9eceaa793317b31a3d6 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Wed, 3 Apr 2024 21:18:02 -0400 Subject: [PATCH] fix(hass): pip is slow - uv is brr Signed-off-by: Devin Buhl --- apps/home-assistant/Dockerfile | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/apps/home-assistant/Dockerfile b/apps/home-assistant/Dockerfile index a82ad102e..e294be172 100644 --- a/apps/home-assistant/Dockerfile +++ b/apps/home-assistant/Dockerfile @@ -92,9 +92,10 @@ RUN \ python3-dev \ unixodbc-dev \ && \ - pip install --upgrade \ + pip install --upgrade pip uv \ + && \ + uv pip install --system --upgrade \ cython \ - pip \ pyparsing \ setuptools \ wheel \ @@ -102,18 +103,6 @@ RUN \ curl -fsSL "https://github.com/home-assistant/core/archive/${VERSION}.tar.gz" \ | tar xzf - -C /tmp --strip-components=1 \ && \ - mkdir -p /pip-packages \ - && \ - pip install \ - --upgrade \ - --target /pip-packages \ - distlib \ - && \ - NUMPY_VERSION=$(grep "numpy" requirements_all.txt) \ - && \ - pip install --find-links "${HOMEASSISTANT_WHEELS}" \ - "${NUMPY_VERSION}" \ - && \ case "${TARGETPLATFORM}" in \ 'linux/amd64') \ export ARCH='amd64'; \ @@ -125,18 +114,15 @@ RUN \ && \ HOME_ASSISTANT_BASE=$(curl -fsSL "https://raw.githubusercontent.com/home-assistant/core/${VERSION}/build.yaml" | grep "${ARCH}: " | cut -d ":" -f3) \ && \ - pip install --no-index --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ + uv pip install --system --no-index --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ --requirement "https://raw.githubusercontent.com/home-assistant/docker/${HOME_ASSISTANT_BASE}/requirements.txt" \ && \ - pip install --find-links "${HOMEASSISTANT_WHEELS}" \ + uv pip install --system --find-links "${HOMEASSISTANT_WHEELS}" \ --requirement requirements_all.txt \ && \ - pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ + uv pip install --system --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ homeassistant=="${VERSION}" \ && \ - pip install --find-links "${HOMEASSISTANT_WHEELS}" \ - pycups PySwitchbot \ - && \ apk del --purge .build-deps \ && \ rm -rf \