@@ -4,39 +4,52 @@ FROM python:${PY_TAG}
44
55ARG PY_TAG
66ARG ENV_TAG
7+ ARG UV_VERSION=0.9.5
8+
79# tox defines all python targets, makefile recognizes TEST_ENVS and forces
810# tox to execute only tests for installed python
911ENV TEST_ENVS=${ENV_TAG}
1012
1113# install make and gosu
14+ # install uv using pip
15+ # UV_VERSION should match pyproject.toml [tool.uv] required-version (currently 0.9.5)
1216ENV GOSU_VERSION=1.14
1317RUN set -x \
1418 && apt-get update \
15- && apt-get install -y --no-install-recommends make curl gnupg \
16- && curl -sSLo /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
17- && curl -sSLo /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
19+ && apt-get install -y --no-install-recommends make gnupg wget \
20+ && pip install --no-cache-dir "uv==${UV_VERSION}" \
21+ && wget -qO /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
22+ && wget -qO /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
1823 && export GNUPGHOME="$(mktemp -d)" \
1924 && gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
2025 && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
2126 && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \
2227 && chmod +x /usr/local/bin/gosu \
2328 && gosu nobody true \
24- && apt-get -y remove curl gnupg \
29+ && apt-get -y remove gnupg \
2530 && apt-get -y auto-remove \
2631 && rm -rf /var/lib/apt/lists/* \
2732 && true
2833
29- # install tox
30- ENV PYTHON_TOX_VERSION=4.30.0
31- ENV PYTHON_TOX_UV_VERSION=1.28.0
32- # install uv
33- ENV PYTHON_UV_VERSION=0.9.5
34+ # Set working directory before copying files
35+ WORKDIR /data
36+
37+ # copy dependency files - these will be available at build time
38+ # At runtime, the directory will be mounted, but uv will use the lock file
39+ # to ensure consistent dependencies
40+ COPY pyproject.toml uv.lock ./
41+
42+ # 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
44+ # We use uv pip install to install packages from the tox dependency group in pyproject.toml
45+ # 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)
3447RUN set -x \
35- && pip3 install uv==${PYTHON_UV_VERSION} tox==${PYTHON_TOX_VERSION} tox-uv==${PYTHON_TOX_UV_VERSION}\
48+ && uv pip install --system --group tox \
49+ && pip install --no-cache-dir --force-reinstall "uv==${UV_VERSION}" \
3650 && true
3751
3852COPY .docker/entrypoint.sh /entrypoint.sh
39- WORKDIR /data
4053
4154LABEL image_name="GoodData Python SDK test image with python, tox and make"
4255# LABEL maintainer="TigerTeam <tiger@gooddata.com>"
0 commit comments