Skip to content

Commit 362b607

Browse files
Your Namealphatownsman
authored andcommitted
remove requirements.lock and use uv in docker build
1 parent e5bc083 commit 362b607

File tree

3 files changed

+8
-130
lines changed

3 files changed

+8
-130
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ repos:
2828
rev: 0.8.8
2929
hooks:
3030
- id: uv-lock
31-
- id: pip-compile
32-
name: requirements.lock
33-
files: ^(pyproject\.toml|uv\.lock)$
34-
args: [pyproject.toml, --no-annotate, --no-header, -q, -o, requirements.lock]
3531

3632
- repo: https://github.com/astral-sh/ruff-pre-commit
3733
rev: v0.12.8

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ ENV PYTHONUNBUFFERED=1
66
RUN --mount=type=cache,sharing=locked,target=/var/cache/apt apt-get update \
77
&& apt-get install -y --no-install-recommends build-essential libpq-dev python3-venv git
88

9+
COPY --from=ghcr.io/astral-sh/uv:0.8.8 /uv /uvx /bin/
10+
911
COPY . /neodb
1012

1113
RUN echo `cd /neodb && git rev-parse --short HEAD`-`cd /neodb/neodb-takahe && git rev-parse --short HEAD`-`date -u +%Y%m%d%H%M%S` > /neodb/build_version
@@ -14,14 +16,16 @@ RUN rm -rf /neodb/.git /neodb/neodb-takahe/.git
1416
RUN mv /neodb/neodb-takahe /takahe
1517

1618
WORKDIR /neodb
17-
RUN python -m venv /neodb-venv
19+
RUN uv venv /neodb-venv
20+
ENV VIRTUAL_ENV=/neodb-venv
1821
RUN find misc/wheels-cache -type f | xargs -n 1 /neodb-venv/bin/python3 -m pip install || echo incompatible wheel ignored
1922
RUN rm -rf misc/wheels-cache
20-
RUN --mount=type=cache,sharing=locked,target=/root/.cache /neodb-venv/bin/python3 -m pip install --upgrade -r requirements.lock
23+
RUN --mount=type=cache,sharing=locked,target=/root/.cache uv sync --active --no-dev
2124

2225
WORKDIR /takahe
23-
RUN python -m venv /takahe-venv
24-
RUN --mount=type=cache,sharing=locked,target=/root/.cache /takahe-venv/bin/python3 -m pip install --upgrade -r requirements.lock
26+
RUN uv venv /takahe-venv
27+
ENV VIRTUAL_ENV=/takahe-venv
28+
RUN --mount=type=cache,sharing=locked,target=/root/.cache uv sync --active --no-dev
2529

2630
# runtime stage
2731
FROM python:3.13-slim AS runtime

requirements.lock

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)