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

View File

@ -62,12 +62,11 @@ FROM base_host AS ov-converter
ARG DEBIAN_FRONTEND ARG DEBIAN_FRONTEND
# Install OpenVino Runtime and Dev library # 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 COPY docker/main/requirements-ov.txt /requirements-ov.txt
RUN apt-get -qq update \ RUN apt-get -qq update \
&& apt-get -qq install -y wget python3 python3-dev python3-distutils gcc pkg-config libhdf5-dev \ && 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 \ && uv pip install --system -r /requirements-ov.txt
&& python3 get-pip.py "pip" \
&& pip install -r /requirements-ov.txt
# Get OpenVino Model # Get OpenVino Model
RUN --mount=type=bind,source=docker/main/build_ov_model.py,target=/build_ov_model.py \ 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 ENV LIBAVFORMAT_VERSION_MAJOR=60
# Install dependencies # 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 \ RUN --mount=type=bind,source=docker/main/install_deps.sh,target=/deps/install_deps.sh \
/deps/install_deps.sh /deps/install_deps.sh
RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \ RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \
python3 -m pip install --upgrade pip && \ uv pip install --system -U /deps/wheels/*.whl
pip3 install -U /deps/wheels/*.whl
COPY --from=deps-rootfs / / COPY --from=deps-rootfs / /

View File

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