Skip to content

Commit 7b1cd5b

Browse files
committed
Migrate from pip to uv
1 parent 3244fc8 commit 7b1cd5b

4 files changed

Lines changed: 1762 additions & 245 deletions

File tree

Dockerfile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@
22
# https://snyk.io/blog/best-practices-containerizing-python-docker/
33
FROM python:3.13-slim AS build
44

5-
WORKDIR /app
5+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
66

7-
RUN python -m venv /app/venv
8-
ENV PATH="/app/venv/bin:$PATH"
7+
WORKDIR /app
98

10-
RUN apt-get update && apt-get install -y --no-install-recommends git
11-
RUN apt-get install -y --no-install-recommends build-essential gcc
9+
RUN apt-get update && apt-get install -y --no-install-recommends git build-essential gcc \
10+
&& rm -rf /var/lib/apt/lists/*
1211

13-
COPY requirements.txt .
14-
RUN pip install -r requirements.txt
12+
COPY pyproject.toml uv.lock ./
13+
RUN uv sync --frozen --no-dev --no-install-project
1514

1615
COPY . .
17-
RUN --mount=source=.git,target=.git,type=bind
18-
RUN pip install .
16+
RUN --mount=source=.git,target=.git,type=bind uv sync --frozen --no-dev
1917

2018
FROM python:3.13-slim
2119
WORKDIR /app
22-
COPY --from=build /app/venv /app/venv
23-
ENV PATH="/app/venv/bin:$PATH"
20+
COPY --from=build /app/.venv /app/.venv
21+
ENV PATH="/app/.venv/bin:$PATH"
2422

2523
EXPOSE 3000
2624

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "isar-robot"
77
authors = [{ name = "Equinor ASA", email = "fg_robots_dev@equinor.com" }]
88
description = "Integration and Supervisory control of Autonomous Robots - Open source robot implementation"
99
readme = "README.md"
10-
requires-python = ">=3.10"
10+
requires-python = ">=3.12"
1111
license = { file = "LICENSE" }
1212
classifiers = [
1313
"Intended Audience :: Developers",
@@ -34,7 +34,7 @@ isar = { path = "../isar", editable = true }
3434
repository = "https://github.com/equinor/isar-robot.git"
3535

3636
[project.optional-dependencies]
37-
dev = ["black", "mypy", "pip-tools", "pre-commit", "pytest", "ruff"]
37+
dev = ["black", "mypy", "pre-commit", "pytest", "ruff"]
3838

3939
[tool.setuptools_scm]
4040
version_file = "src/isar_robot/version.py"

requirements.txt

Lines changed: 0 additions & 232 deletions
This file was deleted.

0 commit comments

Comments
 (0)