From 0584cf1bc01a02fd12f56f628585557084cca347 Mon Sep 17 00:00:00 2001 From: Joostlek Date: Tue, 29 Oct 2024 12:14:17 +0100 Subject: [PATCH 1/2] Switch to UV --- Dockerfile | 10 +++++++--- builder/pip.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c9fc00ce..a070dd0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,13 @@ ARG \ QEMU_CPU \ AUDITWHEEL_VERSION=5.1.2 \ PIP_EXTRA_INDEX_URL=https://wheels.home-assistant.io/musllinux-index/ \ + UV_EXTRA_INDEX_URL=https://wheels.home-assistant.io/musllinux-index/ \ WORKDIR /usr/src +# Install uv +RUN pip3 install uv==0.4.28 + SHELL ["/bin/bash", "-exo", "pipefail", "-c"] COPY rootfs / @@ -41,7 +45,7 @@ RUN \ apk add --no-cache --virtual .build-dependencies2 \ openblas-dev; \ fi \ - && pip3 install \ + && uv pip install \ -r /usr/src/requirements.txt \ -r /usr/src/requirements_${CPYTHON_ABI}.txt \ && rm -rf /usr/src/* @@ -54,14 +58,14 @@ RUN \ https://github.com/pypa/auditwheel \ && cd auditwheel \ && git apply /usr/src/0001-Support-musllinux-armv6l.patch \ - && pip install . \ + && uv pip install . \ && rm -rf /usr/src/* # Install builder COPY . /usr/src/builder/ RUN \ set -x \ - && pip3 install /usr/src/builder/ \ + && uv pip install /usr/src/builder/ \ && rm -rf /usr/src/* # Set build environment information diff --git a/builder/pip.py b/builder/pip.py index 41bc5bcd..687fcd74 100644 --- a/builder/pip.py +++ b/builder/pip.py @@ -121,5 +121,5 @@ def install_pips(index: str, pips: str) -> None: packages = " ".join(pips.split(";")) run_command( - f"pip install --upgrade --extra-index-url {index} {packages}", + f"uv pip install --upgrade --extra-index-url {index} {packages}", ) From 95327d036ae2d5b82c66d75a5822b180f74c0e76 Mon Sep 17 00:00:00 2001 From: Joostlek Date: Tue, 29 Oct 2024 12:21:53 +0100 Subject: [PATCH 2/2] Switch to UV --- builder/pip.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builder/pip.py b/builder/pip.py index 687fcd74..97b557c3 100644 --- a/builder/pip.py +++ b/builder/pip.py @@ -51,6 +51,8 @@ def build_wheels_requirement( # Add constraint constraint_cmd = f"--constraint {constraint}" if constraint else "" + print("test") + run_command( f'pip3 wheel --no-clean --no-binary "{skip_binary}" --wheel-dir {output} --extra-index-url {index} {constraint_cmd} --requirement {requirement}', env=build_env,