mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-31 04:37:57 +00:00
✨(agents) use uv for dependency management
Change from pip to uv for dependancy management in src/agents.
This commit is contained in:
@@ -150,13 +150,14 @@ jobs:
|
|||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
cache: "pip"
|
- name: Install uv
|
||||||
- name: Install development dependencies
|
uses: astral-sh/setup-uv@v7
|
||||||
run: pip install --user .[dev]
|
- name: Install the project
|
||||||
|
run: uv sync --locked --all-extras
|
||||||
- name: Check code formatting with ruff
|
- name: Check code formatting with ruff
|
||||||
run: ~/.local/bin/ruff format . --diff
|
run: uv run ruff format . --diff
|
||||||
- name: Lint code with ruff
|
- name: Lint code with ruff
|
||||||
run: ~/.local/bin/ruff check .
|
run: uv run ruff check .
|
||||||
|
|
||||||
lint-summary:
|
lint-summary:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ and this project adheres to
|
|||||||
- ♻️(summary) change tasks endpoint signature
|
- ♻️(summary) change tasks endpoint signature
|
||||||
- ⬆️(dependencies) update urllib3 to v2.7.0 [SECURITY]
|
- ⬆️(dependencies) update urllib3 to v2.7.0 [SECURITY]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 🧑💻(agents) use `uv` for package management
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- ♻(frontend) standardize role terminology across localizations
|
- ♻(frontend) standardize role terminology across localizations
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ services:
|
|||||||
metadata-collector-dev:
|
metadata-collector-dev:
|
||||||
build:
|
build:
|
||||||
context: ./src/agents
|
context: ./src/agents
|
||||||
|
target: development
|
||||||
command: ["python", "metadata_collector.py", "dev"]
|
command: ["python", "metadata_collector.py", "dev"]
|
||||||
environment:
|
environment:
|
||||||
- LIVEKIT_URL=ws://livekit:7880
|
- LIVEKIT_URL=ws://livekit:7880
|
||||||
@@ -261,6 +262,7 @@ services:
|
|||||||
- AWS_S3_SECURE_ACCESS=False
|
- AWS_S3_SECURE_ACCESS=False
|
||||||
volumes:
|
volumes:
|
||||||
- ./src/agents:/app
|
- ./src/agents:/app
|
||||||
|
- /app/.venv
|
||||||
depends_on:
|
depends_on:
|
||||||
- livekit
|
- livekit
|
||||||
- minio
|
- minio
|
||||||
@@ -333,10 +335,12 @@ services:
|
|||||||
multi-user-transcriber:
|
multi-user-transcriber:
|
||||||
build:
|
build:
|
||||||
context: ./src/agents
|
context: ./src/agents
|
||||||
|
target: development
|
||||||
env_file:
|
env_file:
|
||||||
- env.d/development/multi_user_transcriber
|
- env.d/development/multi_user_transcriber
|
||||||
volumes:
|
volumes:
|
||||||
- ./src/agents:/app
|
- ./src/agents:/app
|
||||||
|
- /app/.venv
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Python
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
**/__pycache__
|
||||||
|
**/*.pyc
|
||||||
|
venv
|
||||||
|
**/.venv
|
||||||
|
|
||||||
|
# System-specific files
|
||||||
|
.DS_Store
|
||||||
|
**/.DS_Store
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
compose.*
|
||||||
|
env.d
|
||||||
|
|
||||||
|
# Docs
|
||||||
|
docs
|
||||||
|
*.md
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Development/test cache & configurations
|
||||||
|
data
|
||||||
|
.cache
|
||||||
|
.circleci
|
||||||
|
.git
|
||||||
|
.iml
|
||||||
|
db.sqlite3
|
||||||
|
.pylint.d
|
||||||
|
|
||||||
|
**/.idea
|
||||||
|
**/.vscode
|
||||||
|
**/.pytest_cache
|
||||||
|
**/.mypy_cache
|
||||||
|
**/.ruff_cache
|
||||||
|
|
||||||
|
# Env
|
||||||
|
.env
|
||||||
+41
-13
@@ -6,31 +6,61 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libgobject-2.0-0 \
|
libgobject-2.0-0 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
|
# ---- Builder image ----
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
|
|
||||||
WORKDIR /builder
|
ENV UV_COMPILE_BYTECODE=1 \
|
||||||
|
UV_LINK_MODE=copy \
|
||||||
|
UV_PYTHON_DOWNLOADS=0
|
||||||
|
|
||||||
COPY pyproject.toml .
|
# Install uv
|
||||||
|
COPY --from=ghcr.io/astral-sh/uv:0.10.9 /uv /uvx /bin/
|
||||||
RUN mkdir /install && \
|
|
||||||
pip install --prefix=/install .
|
|
||||||
|
|
||||||
FROM base AS development
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY pyproject.toml .
|
# Install production dependencies without the project itself (cacheable layer)
|
||||||
RUN pip install --no-cache-dir ".[dev]"
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
|
--mount=type=bind,source=uv.lock,target=uv.lock \
|
||||||
|
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
||||||
|
uv sync --locked --no-install-project --no-dev
|
||||||
|
|
||||||
COPY . .
|
# Install the project
|
||||||
|
COPY . /app
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
|
uv sync --locked --no-dev
|
||||||
|
|
||||||
|
|
||||||
|
# ---- Development image ----
|
||||||
|
FROM base AS development
|
||||||
|
|
||||||
|
ENV UV_COMPILE_BYTECODE=1 \
|
||||||
|
UV_LINK_MODE=copy \
|
||||||
|
UV_PYTHON_DOWNLOADS=0
|
||||||
|
|
||||||
|
COPY --from=ghcr.io/astral-sh/uv:0.10.9 /uv /uvx /bin/
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
|
uv sync --locked --all-extras
|
||||||
|
|
||||||
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
CMD ["python", "metadata_collector.py", "dev"]
|
CMD ["python", "metadata_collector.py", "dev"]
|
||||||
|
|
||||||
|
|
||||||
|
# ---- Production image ----
|
||||||
FROM base AS production
|
FROM base AS production
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=builder /install /usr/local
|
# Copy the pre-built virtualenv and application source
|
||||||
|
COPY --from=builder /app /app
|
||||||
|
|
||||||
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
# Remove pip to reduce attack surface in production
|
# Remove pip to reduce attack surface in production
|
||||||
RUN pip uninstall -y pip
|
RUN pip uninstall -y pip
|
||||||
@@ -39,6 +69,4 @@ RUN pip uninstall -y pip
|
|||||||
ARG DOCKER_USER
|
ARG DOCKER_USER
|
||||||
USER ${DOCKER_USER}
|
USER ${DOCKER_USER}
|
||||||
|
|
||||||
COPY ./*.py /app/
|
|
||||||
|
|
||||||
CMD ["python", "multi_user_transcriber.py", "start"]
|
CMD ["python", "multi_user_transcriber.py", "start"]
|
||||||
|
|||||||
@@ -18,12 +18,8 @@ dev = [
|
|||||||
"ruff==0.15.6",
|
"ruff==0.15.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.uv]
|
||||||
py-modules = ["multi_user_transcriber", "metadata_collector", "exceptions"]
|
package = false
|
||||||
|
|
||||||
[build-system]
|
|
||||||
requires = ["setuptools>=61.0"]
|
|
||||||
build-backend = "setuptools.build_meta"
|
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
target-version = "py313"
|
target-version = "py313"
|
||||||
|
|||||||
Generated
+1963
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user