Skip to content

Commit b313397

Browse files
committed
chore: improve Dockerfile for ci tests
1 parent fa6bd2c commit b313397

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

.github/workflows/rw-collect-changes.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ jobs:
4242
- 'packages/**'
4343
- '*.mk'
4444
- 'Makefile'
45+
- Dockerfile
46+
- pyproject.toml

Dockerfile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,29 @@ RUN set -x \
2626
&& rm -rf /var/lib/apt/lists/* \
2727
&& true
2828

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
29+
# install uv from Astral's Docker image
30+
# UV_VERSION should match pyproject.toml [tool.uv] required-version (currently 0.9.5)
31+
ARG UV_VERSION=0.9.5
32+
COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /usr/local/bin/uv
33+
RUN chmod +x /usr/local/bin/uv
34+
35+
# Set working directory before copying files
36+
WORKDIR /data
37+
38+
# copy dependency files - these will be available at build time
39+
# At runtime, the directory will be mounted, but uv will use the lock file
40+
# to ensure consistent dependencies
41+
COPY pyproject.toml uv.lock ./
42+
43+
# Install tox and tox-uv as system packages so they're available globally
44+
# This matches the original behavior where tox was installed via pip
45+
# We use uv pip install to install packages from the tox dependency group in pyproject.toml
46+
# by reading from the lock file which ensures consistent versions
3447
RUN set -x \
35-
&& pip3 install uv==${PYTHON_UV_VERSION} tox==${PYTHON_TOX_VERSION} tox-uv==${PYTHON_TOX_UV_VERSION}\
48+
&& uv pip install --system --only-group tox \
3649
&& true
3750

3851
COPY .docker/entrypoint.sh /entrypoint.sh
39-
WORKDIR /data
4052

4153
LABEL image_name="GoodData Python SDK test image with python, tox and make"
4254
# LABEL maintainer="TigerTeam <tiger@gooddata.com>"

0 commit comments

Comments
 (0)