From de93b23a9f2a4776f3563508ffc05cc24b2131e8 Mon Sep 17 00:00:00 2001 From: apexdev Date: Tue, 20 May 2025 12:10:52 +0300 Subject: [PATCH] chore(uv): Prefer `--locked` for dependency sync Adopt uv best practice for dependency synchronization. [Note] - (uv sync --frozen) proceeds with an out-dated lockfile. This could lead to inconsistencies. [Docs] See: https://docs.astral.sh/uv/concepts/projects/sync/#locking-and-syncing --- .github/workflows/python.yml | 2 +- .github/workflows/release.yml | 2 +- src/fetch/Dockerfile | 4 ++-- src/git/Dockerfile | 4 ++-- src/time/Dockerfile | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a1edc0c9ce..a8fd34cd3b 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -43,7 +43,7 @@ jobs: - name: Install dependencies working-directory: src/${{ matrix.package }} - run: uv sync --frozen --all-extras --dev + run: uv sync --locked --all-extras --dev - name: Run pyright working-directory: src/${{ matrix.package }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e0a657918..f980abc22a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -128,7 +128,7 @@ jobs: - name: Install dependencies working-directory: src/${{ matrix.package }} - run: uv sync --frozen --all-extras --dev + run: uv sync --locked --all-extras --dev - name: Run pyright working-directory: src/${{ matrix.package }} diff --git a/src/fetch/Dockerfile b/src/fetch/Dockerfile index 7e8824c471..e81610cb7f 100644 --- a/src/fetch/Dockerfile +++ b/src/fetch/Dockerfile @@ -14,13 +14,13 @@ ENV UV_LINK_MODE=copy RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ - uv sync --frozen --no-install-project --no-dev --no-editable + uv sync --locked --no-install-project --no-dev --no-editable # Then, add the rest of the project source code and install it # Installing separately from its dependencies allows optimal layer caching ADD . /app RUN --mount=type=cache,target=/root/.cache/uv \ - uv sync --frozen --no-dev --no-editable + uv sync --locked --no-dev --no-editable FROM python:3.12-slim-bookworm diff --git a/src/git/Dockerfile b/src/git/Dockerfile index 2746d63419..e420d2047d 100644 --- a/src/git/Dockerfile +++ b/src/git/Dockerfile @@ -14,13 +14,13 @@ ENV UV_LINK_MODE=copy RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ - uv sync --frozen --no-install-project --no-dev --no-editable + uv sync --locked --no-install-project --no-dev --no-editable # Then, add the rest of the project source code and install it # Installing separately from its dependencies allows optimal layer caching ADD . /app RUN --mount=type=cache,target=/root/.cache/uv \ - uv sync --frozen --no-dev --no-editable + uv sync --locked --no-dev --no-editable FROM python:3.12-slim-bookworm diff --git a/src/time/Dockerfile b/src/time/Dockerfile index bd62ea84a4..6cc5d4e8bd 100644 --- a/src/time/Dockerfile +++ b/src/time/Dockerfile @@ -14,13 +14,13 @@ ENV UV_LINK_MODE=copy RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ - uv sync --frozen --no-install-project --no-dev --no-editable + uv sync --locked --no-install-project --no-dev --no-editable # Then, add the rest of the project source code and install it # Installing separately from its dependencies allows optimal layer caching ADD . /app RUN --mount=type=cache,target=/root/.cache/uv \ - uv sync --frozen --no-dev --no-editable + uv sync --locked --no-dev --no-editable FROM python:3.12-slim-bookworm