Move build system from setuptools to uv, wire uv into CI/CD
Convert both pyproject.toml files to the uv_build backend and turn the repo into a proper uv workspace (plotstyle moved to src layout, since uv_build requires the module in its own subdirectory). Dev tooling moves from an optional-dependencies extra to a dependency-group, and plotstyle's matplotlib dependency is now its own rather than a gallery "plotting" extra. Gitea Actions workflows and the Dockerfile now use astral-sh/setup-uv, uv sync, uv run, uv build, and uv publish throughout instead of pip, build, and twine. Also fixes .dockerignore, which was excluding uv.lock, deploy/, and README.md and would have broken even the previous Dockerfile's COPY of deploy/entrypoint.sh. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+14
-4
@@ -1,3 +1,15 @@
|
||||
FROM python:3.11-slim AS builder
|
||||
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml uv.lock README.md ./
|
||||
COPY plotstyle/pyproject.toml plotstyle/README.md plotstyle/
|
||||
COPY gallery/ gallery/
|
||||
|
||||
RUN uv build --package gallery -o dist
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
RUN apt-get update \
|
||||
@@ -6,12 +18,10 @@ RUN apt-get update \
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml .
|
||||
COPY gallery/ gallery/
|
||||
COPY tests/ tests/
|
||||
COPY --from=builder /app/dist/*.whl /tmp/
|
||||
COPY deploy/entrypoint.sh deploy/entrypoint.sh
|
||||
|
||||
RUN pip install --no-cache-dir ".[dev]"
|
||||
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
|
||||
|
||||
RUN useradd -r -s /bin/false gallery
|
||||
USER gallery
|
||||
|
||||
Reference in New Issue
Block a user