Skip to content

Commit e51b436

Browse files
Copilotharupy
andauthored
Migrate tests/db Dockerfiles to uv (#20186)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
1 parent 9828bad commit e51b436

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

tests/db/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
FROM python:3.10
22

3+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
4+
35
ARG DEPENDENCIES
46

5-
RUN pip install psycopg2 pymysql mysqlclient pytest pytest-cov pytest-asyncio
6-
RUN echo "${DEPENDENCIES}" > /tmp/requirements.txt && pip install -r /tmp/requirements.txt
7-
RUN pip list
7+
RUN uv pip install --system psycopg2 pymysql mysqlclient pytest pytest-cov pytest-asyncio
8+
RUN echo "${DEPENDENCIES}" > /tmp/requirements.txt && \
9+
uv pip install --system -r /tmp/requirements.txt
10+
11+
RUN uv pip list

tests/db/Dockerfile.mssql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# The --platform flag ensures consistent behavior across environments
44
FROM --platform=linux/amd64 python:3.10
55

6+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
7+
68
ARG DEPENDENCIES
79

810
# apt-get and system utilities
@@ -18,6 +20,8 @@ RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt
1820
# install SQL Server drivers and tools
1921
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev
2022

21-
RUN pip install pyodbc pytest pytest-cov pytest-asyncio
22-
RUN echo "${DEPENDENCIES}" > /tmp/requirements.txt && pip install -r /tmp/requirements.txt
23-
RUN pip list
23+
RUN uv pip install --system pyodbc pytest pytest-cov pytest-asyncio
24+
RUN echo "${DEPENDENCIES}" > /tmp/requirements.txt && \
25+
uv pip install --system -r /tmp/requirements.txt
26+
27+
RUN uv pip list

0 commit comments

Comments
 (0)