Skip to content

Commit

Permalink
fix(hass): pip is slow - uv is brr
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <devin@buhl.casa>
  • Loading branch information
onedr0p committed Apr 4, 2024
1 parent c7819ca commit 0142e8d
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions apps/home-assistant/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,17 @@ RUN \
python3-dev \
unixodbc-dev \
&& \
pip install --upgrade \
pip install --upgrade pip uv \
&& \
uv pip install --system --upgrade \
cython \
pip \
pyparsing \
setuptools \
wheel \
&& \
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'; \
Expand All @@ -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 \
Expand Down

0 comments on commit 0142e8d

Please sign in to comment.