mirror of
https://github.com/linuxserver/docker-homeassistant.git
synced 2026-02-20 08:40:45 +08:00
Merge pull request #108 from linuxserver/uv
switch to uv instead of pip
This commit is contained in:
commit
d02ff9e9f2
16
Dockerfile
16
Dockerfile
@ -10,7 +10,9 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
|
||||
LABEL maintainer="saarg, roxedus"
|
||||
|
||||
ENV \
|
||||
S6_SERVICES_GRACETIME=240000
|
||||
S6_SERVICES_GRACETIME=240000 \
|
||||
UV_SYSTEM_PYTHON=true \
|
||||
UV_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/"
|
||||
|
||||
COPY root/etc/pip.conf /etc/
|
||||
|
||||
@ -133,6 +135,7 @@ RUN \
|
||||
HA_PIP_VERSION=$(cat /tmp/ha-docker-base/python/${HA_PY_MAJOR}/build.yaml \
|
||||
| grep 'PIP_VERSION: ' \
|
||||
| sed 's|.*PIP_VERSION: ||') && \
|
||||
HA_UV_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/Dockerfile" | grep 'install uv==' | sed 's|RUN pip3 install uv==||') && \
|
||||
echo "**** install jemalloc ****" && \
|
||||
git clone --branch ${HA_JEMALLOC_VER} \
|
||||
--depth 1 "https://github.com/jemalloc/jemalloc" \
|
||||
@ -211,18 +214,17 @@ RUN \
|
||||
fi && \
|
||||
echo "**** install homeassistant ****" && \
|
||||
cd /tmp/core && \
|
||||
pip3 install --only-binary=:all: \
|
||||
pip3 install uv==${HA_UV_VERSION} && \
|
||||
uv pip install --no-build \
|
||||
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
|
||||
pip3 install --only-binary=:all: \
|
||||
uv pip install --no-build \
|
||||
-r requirements.txt && \
|
||||
PYCUPS_VER=$(grep "pycups" requirements_all.txt | sed 's|.*==||') && \
|
||||
LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \
|
||||
MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \
|
||||
pip3 install --only-binary=:all: \
|
||||
uv pip install --no-build \
|
||||
-r requirements_all.txt \
|
||||
isal \
|
||||
pycups==${PYCUPS_VER} && \
|
||||
pip3 install \
|
||||
uv pip install \
|
||||
homeassistant==${HASS_RELEASE} && \
|
||||
for cleanfiles in *.pyc *.pyo; do \
|
||||
find /usr/local/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + ; \
|
||||
|
||||
@ -10,7 +10,9 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
|
||||
LABEL maintainer="saarg, roxedus"
|
||||
|
||||
ENV \
|
||||
S6_SERVICES_GRACETIME=240000
|
||||
S6_SERVICES_GRACETIME=240000 \
|
||||
UV_SYSTEM_PYTHON=true \
|
||||
UV_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/"
|
||||
|
||||
COPY root/etc/pip.conf /etc/
|
||||
|
||||
@ -133,6 +135,7 @@ RUN \
|
||||
HA_PIP_VERSION=$(cat /tmp/ha-docker-base/python/${HA_PY_MAJOR}/build.yaml \
|
||||
| grep 'PIP_VERSION: ' \
|
||||
| sed 's|.*PIP_VERSION: ||') && \
|
||||
HA_UV_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/Dockerfile" | grep 'install uv==' | sed 's|RUN pip3 install uv==||') && \
|
||||
echo "**** install jemalloc ****" && \
|
||||
git clone --branch ${HA_JEMALLOC_VER} \
|
||||
--depth 1 "https://github.com/jemalloc/jemalloc" \
|
||||
@ -211,18 +214,17 @@ RUN \
|
||||
fi && \
|
||||
echo "**** install homeassistant ****" && \
|
||||
cd /tmp/core && \
|
||||
pip3 install --only-binary=:all: \
|
||||
pip3 install uv==${HA_UV_VERSION} && \
|
||||
uv pip install --no-build \
|
||||
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
|
||||
pip3 install --only-binary=:all: \
|
||||
uv pip install --no-build \
|
||||
-r requirements.txt && \
|
||||
PYCUPS_VER=$(grep "pycups" requirements_all.txt | sed 's|.*==||') && \
|
||||
LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \
|
||||
MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \
|
||||
pip3 install --only-binary=:all: \
|
||||
uv pip install --no-build \
|
||||
-r requirements_all.txt \
|
||||
isal \
|
||||
pycups==${PYCUPS_VER} && \
|
||||
pip3 install \
|
||||
uv pip install \
|
||||
homeassistant==${HASS_RELEASE} && \
|
||||
for cleanfiles in *.pyc *.pyo; do \
|
||||
find /usr/local/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + ; \
|
||||
|
||||
@ -316,6 +316,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
|
||||
|
||||
## Versions
|
||||
|
||||
* **07.10.24:** - Switch to `uv` instead of `pip`.
|
||||
* **03.07.24:** - Rebase to alpine 3.20.
|
||||
* **05.03.24:** - Add mime.types to help with detection of certain media files.
|
||||
* **13.02.24:** - Rebase to alpine 3.19, upgrade to python 3.12. Restructure python packages so all packages are internal (no more venv in /config). Use upstream project's wheels. Due to an upstream issue, on first start of the newly updated container, some custom integrations may be disabled in HA due to missing dependencies. A subsequent container restart should fix that and the integrations should be re-enabled.
|
||||
|
||||
@ -74,6 +74,7 @@ app_setup_block: |
|
||||
unraid_template_sync: false
|
||||
# changelog
|
||||
changelogs:
|
||||
- {date: "07.10.24:", desc: "Switch to `uv` instead of `pip`."}
|
||||
- {date: "03.07.24:", desc: "Rebase to alpine 3.20."}
|
||||
- {date: "05.03.24:", desc: "Add mime.types to help with detection of certain media files."}
|
||||
- {date: "13.02.24:", desc: "Rebase to alpine 3.19, upgrade to python 3.12. Restructure python packages so all packages are internal (no more venv in /config). Use upstream project's wheels. Due to an upstream issue, on first start of the newly updated container, some custom integrations may be disabled in HA due to missing dependencies. A subsequent container restart should fix that and the integrations should be re-enabled."}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user