11# (C) 2021 GoodData Corporation
22ARG PY_TAG
3+ FROM ghcr.io/astral-sh/uv:0.10 AS uv
34FROM python:${PY_TAG}
45
56ARG PY_TAG
67ARG ENV_TAG
7- ARG UV_VERSION=0.10.0
88
99# tox defines all python targets, makefile recognizes TEST_ENVS and forces
1010# tox to execute only tests for installed python
1111ENV TEST_ENVS=${ENV_TAG}
1212
13+ # copy uv binary from official image; version is guarded by required-version in pyproject.toml
14+ COPY --from=uv /uv /usr/local/bin/uv
15+
1316# install make and gosu
14- # install uv using pip
15- # UV_VERSION should match pyproject.toml [tool.uv] required-version (currently ~=0.10.0)
1617ENV GOSU_VERSION=1.14
1718RUN set -x \
1819 && apt-get update \
1920 && apt-get install -y --no-install-recommends make curl gnupg \
20- && pip install --no-cache-dir "uv==${UV_VERSION}" \
2121 && curl -sSLo /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
2222 && curl -sSLo /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
2323 && export GNUPGHOME="$(mktemp -d)" \
@@ -40,14 +40,11 @@ WORKDIR /data
4040COPY pyproject.toml uv.lock ./
4141
4242# Install tox and tox-uv as system packages so they're available globally
43- # This matches the original behavior where tox was installed via pip
4443# We use uv pip install to install packages from the tox dependency group in pyproject.toml
4544# by reading from the lock file which ensures consistent versions
46- # Reinstall uv after pip install to ensure correct version (uv pip install may install a different version)
4745# Clean up dependency files after installation to reduce image size
4846RUN set -x \
4947 && uv pip install --system --group tox \
50- && pip install --no-cache-dir --force-reinstall "uv==${UV_VERSION}" \
5148 && rm -f pyproject.toml uv.lock \
5249 && true
5350
0 commit comments