Skip to content

Commit f20fec5

Browse files
authored
SCANPY-97 Migrate build container to use uv (#119)
1 parent 341e367 commit f20fec5

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

.cirrus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ analysis_task:
8383
name: "SC Analysis"
8484
analysis_script:
8585
- poetry run pytest --cov-report=xml:coverage.xml --cov-config=pyproject.toml --cov=src --cov-branch tests
86-
- python -m venv .venv
86+
- uv venv
8787
- source .venv/bin/activate
88-
- pip install .
88+
- uv pip install .
8989
- pysonar-scanner -Dsonar.organization=sonarsource -DbuildNumber=${CI_BUILD_NUMBER}
9090
always:
9191
pytest_artifacts:

.cirrus/poetry.Dockerfile

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
ARG CIRRUS_AWS_ACCOUNT=275878209202
22
FROM ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-latest
3-
43
USER root
5-
64
ARG PYTHON_VERSION=3.12.1
75
ENV POETRY_VERSION 2.0.1
86

9-
# install required dependencies to build Python from source see: https://devguide.python.org/getting-started/setup-building/#install-dependencies
10-
RUN apt-get update && apt-get install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev
11-
RUN curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz
12-
RUN tar -xf Python-${PYTHON_VERSION}.tar.xz
13-
RUN cd Python-${PYTHON_VERSION} && ./configure && make -s -j 4 && make altinstall
14-
RUN cd /usr/local/bin \
15-
&& ln -s python${PYTHON_VERSION%.*} python \
16-
&& ln -s python${PYTHON_VERSION%.*} python3 \
17-
&& ln -s pip${PYTHON_VERSION%.*} pip \
18-
&& ln -s pip${PYTHON_VERSION%.*} pip3
19-
7+
RUN apt-get update && \
8+
apt-get install -y pipx \
9+
&& rm -rf /var/lib/apt/lists/*
2010
USER sonarsource
21-
22-
RUN curl -sSL https://install.python-poetry.org | python3 -
23-
ENV PATH="${PATH}:/home/sonarsource/.local/bin"
24-
25-
ENV SONARCLOUD_ANALYSIS true
11+
RUN pipx install uv
12+
ENV PATH=${PATH}:/home/sonarsource/.local/bin
13+
WORKDIR /home/sonarsource
14+
RUN uv python install ${PYTHON_VERSION} --default --preview && \
15+
uv tool install poetry==${POETRY_VERSION}

0 commit comments

Comments
 (0)