Skip to content

Commit 03dd5bc

Browse files
committed
✨(agents) use uv for dependency management
Change from pip to uv for dependancy management.
1 parent 0c0ce87 commit 03dd5bc

7 files changed

Lines changed: 2057 additions & 16 deletions

File tree

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ venv
1111
**/.DS_Store
1212

1313
# Docker
14-
docker compose.*
14+
compose.*
1515
env.d
1616

1717
# Docs

.github/workflows/meet.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,14 @@ jobs:
150150
uses: actions/setup-python@v6
151151
with:
152152
python-version: "3.13"
153-
cache: "pip"
154-
- name: Install development dependencies
155-
run: pip install --user .[dev]
153+
- name: Install uv
154+
uses: astral-sh/setup-uv@v7
155+
- name: Install the project
156+
run: uv sync --locked --all-extras
156157
- name: Check code formatting with ruff
157-
run: ~/.local/bin/ruff format . --diff
158+
run: uv run ruff format . --diff
158159
- name: Lint code with ruff
159-
run: ~/.local/bin/ruff check .
160+
run: uv run ruff check .
160161

161162
lint-summary:
162163
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to
1212

1313
- 🔒️(backend) add validation of Room.configuration
1414

15+
### Changed
16+
17+
- 🧑‍💻(agents) use `uv` for package management
18+
1519
## [1.15.0] - 2026-04-30
1620

1721
### Added

compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ services:
249249
metadata-collector-dev:
250250
build:
251251
context: ./src/agents
252+
target: development
252253
command: ["python", "metadata_collector.py", "dev"]
253254
environment:
254255
- LIVEKIT_URL=ws://livekit:7880
@@ -261,6 +262,7 @@ services:
261262
- AWS_S3_SECURE_ACCESS=False
262263
volumes:
263264
- ./src/agents:/app
265+
- /app/.venv
264266
depends_on:
265267
- livekit
266268
- minio
@@ -333,10 +335,12 @@ services:
333335
multi-user-transcriber:
334336
build:
335337
context: ./src/agents
338+
target: development
336339
env_file:
337340
- env.d/development/multi_user_transcriber
338341
volumes:
339342
- ./src/agents:/app
343+
- /app/.venv
340344

341345
networks:
342346
default:

src/agents/.dockerignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Python
2+
__pycache__
3+
*.pyc
4+
**/__pycache__
5+
**/*.pyc
6+
venv
7+
**/.venv
8+
9+
# System-specific files
10+
.DS_Store
11+
**/.DS_Store
12+
13+
# Docker
14+
docker compose.*
15+
env.d
16+
17+
# Docs
18+
docs
19+
*.md
20+
*.log
21+
22+
# Development/test cache & configurations
23+
data
24+
.cache
25+
.circleci
26+
.git
27+
.iml
28+
db.sqlite3
29+
.pylint.d
30+
31+
**/.idea
32+
**/.vscode
33+
**/.pytest_cache
34+
**/.mypy_cache
35+
**/.ruff_cache
36+
37+
# Frontend
38+
**/node_modules
39+
40+
# Env
41+
.env

src/agents/Dockerfile

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,61 @@ RUN apt-get update && apt-get install -y \
66
libgobject-2.0-0 \
77
&& rm -rf /var/lib/apt/lists/*
88

9+
10+
# ---- Builder image ----
911
FROM base AS builder
1012

11-
WORKDIR /builder
13+
ENV UV_COMPILE_BYTECODE=1 \
14+
UV_LINK_MODE=copy \
15+
UV_PYTHON_DOWNLOADS=0
16+
17+
# Install uv
18+
COPY --from=ghcr.io/astral-sh/uv:0.10.9 /uv /uvx /bin/
19+
20+
WORKDIR /app
21+
22+
# Install production dependencies without the project itself (cacheable layer)
23+
RUN --mount=type=cache,target=/root/.cache/uv \
24+
--mount=type=bind,source=uv.lock,target=uv.lock \
25+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
26+
uv sync --locked --no-install-project --no-dev
1227

13-
COPY pyproject.toml .
28+
# Install the project
29+
COPY . /app
30+
RUN --mount=type=cache,target=/root/.cache/uv \
31+
uv sync --locked --no-dev
1432

15-
RUN mkdir /install && \
16-
pip install --prefix=/install .
1733

34+
# ---- Development image ----
1835
FROM base AS development
1936

37+
ENV UV_COMPILE_BYTECODE=1 \
38+
UV_LINK_MODE=copy \
39+
UV_PYTHON_DOWNLOADS=0
40+
41+
COPY --from=ghcr.io/astral-sh/uv:0.10.9 /uv /uvx /bin/
42+
2043
WORKDIR /app
2144

22-
COPY pyproject.toml .
23-
RUN pip install --no-cache-dir ".[dev]"
45+
COPY . /app
46+
47+
RUN --mount=type=cache,target=/root/.cache/uv \
48+
uv sync --locked --all-extras
2449

25-
COPY . .
50+
ENV PATH="/app/.venv/bin:$PATH"
2651

2752
CMD ["python", "metadata_collector.py", "dev"]
2853

54+
55+
# ---- Production image ----
2956
FROM base AS production
3057

3158
WORKDIR /app
3259

33-
COPY --from=builder /install /usr/local
60+
# Copy the pre-built virtualenv and application source
61+
COPY --from=builder /app /app
62+
63+
ENV PATH="/app/.venv/bin:$PATH"
3464

3565
# Remove pip to reduce attack surface in production
3666
RUN pip uninstall -y pip
@@ -39,6 +69,4 @@ RUN pip uninstall -y pip
3969
ARG DOCKER_USER
4070
USER ${DOCKER_USER}
4171

42-
COPY ./*.py /app/
43-
4472
CMD ["python", "multi_user_transcriber.py", "start"]

0 commit comments

Comments
 (0)