Use uv instead of pip

This commit is contained in:
Nicolas Mowen 2024-11-03 08:51:23 -07:00
parent 1fc4af9c86
commit 60e4ec6f74
3 changed files with 10 additions and 11 deletions

View File

@ -3,7 +3,7 @@ name: On pull request
on:
pull_request:
paths-ignore:
- 'docs/**'
- "docs/**"
env:
DEFAULT_PYTHON: 3.9
@ -73,8 +73,8 @@ jobs:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
run: |
python3 -m pip install -U pip
python3 -m pip install -r docker/main/requirements-dev.txt
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install --system -r docker/main/requirements-dev.txt
- name: Check formatting
run: |
ruff format --check --diff frigate migrations docker *.py

View File

@ -62,12 +62,11 @@ FROM base_host AS ov-converter
ARG DEBIAN_FRONTEND
# Install OpenVino Runtime and Dev library
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY docker/main/requirements-ov.txt /requirements-ov.txt
RUN apt-get -qq update \
&& apt-get -qq install -y wget python3 python3-dev python3-distutils gcc pkg-config libhdf5-dev \
&& wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
&& python3 get-pip.py "pip" \
&& pip install -r /requirements-ov.txt
&& uv pip install --system -r /requirements-ov.txt
# Get OpenVino Model
RUN --mount=type=bind,source=docker/main/build_ov_model.py,target=/build_ov_model.py \
@ -218,12 +217,12 @@ ENV PATH="/usr/local/go2rtc/bin:/usr/local/tempio/bin:/usr/local/nginx/sbin:${PA
ENV LIBAVFORMAT_VERSION_MAJOR=60
# Install dependencies
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN --mount=type=bind,source=docker/main/install_deps.sh,target=/deps/install_deps.sh \
/deps/install_deps.sh
RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \
python3 -m pip install --upgrade pip && \
pip3 install -U /deps/wheels/*.whl
uv pip install --system -U /deps/wheels/*.whl
COPY --from=deps-rootfs / /

View File

@ -70,10 +70,10 @@ RUN apt-get -y install libnuma1
WORKDIR /opt/frigate/
COPY --from=rootfs / /
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY docker/rocm/requirements-wheels-rocm.txt /requirements.txt
RUN python3 -m pip install --upgrade pip \
&& pip3 uninstall -y onnxruntime-openvino \
&& pip3 install -r /requirements.txt
RUN uv pip uninstall --system -y onnxruntime-openvino \
&& uv pip install --system -r /requirements.txt
#######################################################################
FROM scratch AS rocm-dist