Skip to content

chore: migrate backend from pip to uv#4

Open
randroid88 wants to merge 1 commit into
DataAnts-AI:mainfrom
Randroids-Dojo:upstream/uv-migration
Open

chore: migrate backend from pip to uv#4
randroid88 wants to merge 1 commit into
DataAnts-AI:mainfrom
Randroids-Dojo:upstream/uv-migration

Conversation

@randroid88

Copy link
Copy Markdown

Summary

  • Replace requirements.txt with pyproject.toml + uv.lock for reproducible backend dependency management
  • A single uv sync command handles Python 3.11 download, venv creation, and dependency installation
  • Resolve deepfilternet/numpy version conflict automatically via [tool.uv] override

Why uv?

uv is a fast Python package manager from Astral. Key benefits:

  1. One command setup: cd backend && uv sync replaces the manual venv + pip install workflow
  2. Reproducible builds: uv.lock pins every transitive dependency (no more "works on my machine")
  3. Auto Python management: If Python 3.11 isn't installed, uv downloads it automatically
  4. Resolves numpy conflict: deepfilternet declares numpy<2.0 in its metadata but works fine with numpy 2.x at runtime. whisperx requires numpy>=2.1. The [tool.uv] override-dependencies setting resolves this automatically — previously required manual --force installs

Files changed

  • backend/pyproject.toml — New: project metadata + dependencies + uv override
  • backend/uv.lock — New: locked dependency graph (2377 lines)
  • backend/requirements.txt — Deleted (replaced by pyproject.toml)
  • .gitignore — Add .venv/ (uv uses .venv by default)
  • package.json — Update dev:backend script to use uv run
  • README.md — Update install instructions

Test plan

  • Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh
  • cd backend && uv sync — should create .venv/ and install all dependencies
  • uv run uvicorn main:app --reload --port 8642 — backend starts successfully
  • npm run dev — full dev workflow still works end-to-end

Replace requirements.txt with pyproject.toml + uv.lock for reproducible
backend dependency management. A single `uv sync` handles Python 3.11
download, venv creation, and dependency installation.

The deepfilternet package declares numpy<2.0 but works fine at runtime
with numpy 2.x. Since whisperx requires numpy>=2.1, pyproject.toml uses
a [tool.uv] override to resolve the conflict automatically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant