chore(uv): Prefer --locked for dependency sync (#1852)

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
This commit is contained in:
Eugene Mwangi
2025-11-26 00:36:35 +03:00
committed by GitHub
parent db46aaac85
commit 9758f34d36
5 changed files with 8 additions and 8 deletions

View File

@@ -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