Migration to uv, added instructions and fixed workflows by cristian-tamblay · Pull Request #756 · DashAISoftware/dashAI · GitHub
Skip to content

Migration to uv, added instructions and fixed workflows#756

Open
cristian-tamblay wants to merge 2 commits into
developfrom
feat/migrate-to-uv
Open

Migration to uv, added instructions and fixed workflows#756
cristian-tamblay wants to merge 2 commits into
developfrom
feat/migrate-to-uv

Conversation

@cristian-tamblay

@cristian-tamblay cristian-tamblay commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Migrates Python packaging and dependency management from setup.py + requirements*.txt to a standard PEP 621 pyproject.toml managed with uv, adding a uv.lock for reproducible installs across dev, CI, and Docker.

Key points:

  • End users are unaffected: the published wheel is standard, so pip install dashai keeps working exactly as before.
  • The CPU/CUDA requirements variants are now extras: uv sync --extra cpu / --extra cuda pick the right PyTorch index automatically via [tool.uv.sources] — this solves the torch-index problem that made us abandon pip-compile in the past (see the old note in requirements.txt).
  • CI now installs from the lockfile (uv sync --locked), so builds are reproducible and dependency caching is handled by setup-uv.
  • Fixes a packaging bug: the published wheel included the whole tests/ package (find_packages() had no filter); packages are now scoped to DashAI*.

Type of Change

  • Backend change
  • Frontend change
  • CI / Workflow change
  • Build / Packaging change
  • Bug fix
  • Documentation

Changes (by file)

  • pyproject.toml: full PEP 621 metadata (moved from setup.p requirements*.txt), cpu/cuda extras with per-extraPyTorch/llama-cpp indexes, dev dependency group. Setuptools reANIFEST.in keeps bundling the frontend.
  • uv.lock (new): universal lockfile (288 packages, all platf
  • setup.py, requirements{,-dev,-cpu,-cuda,-plugins}.txt: d.txt` was unreferenced and pinned torch 1.13 from 2022).
  • .github/workflows/build-test.yaml, db-migrations.yaml: `` + uv run ....- `.github/workflows/publish.yml`: `uv build` + `uvx twine`; P--extra cpu --no-dev` and `uv run --no-sync`; release version isnow extracted from `pyproject.toml`.- `.github/workflows/docs.yaml`, `pre-commit.yaml`: install inpip install --system` (the Docusaurus build and a `language:system` hook invoke `python` directly).
  • Dockerfile, Dockerfile.cuda: install with uv sync --locDA image builds llama-cpp with CMAKE_ARGS="-DGGML_CUDA=on"` as
    before.
  • update-server.sh: uses uv when available, falls back to pi
  • README.rst, docs/**/dev-setup.md (en/es), CLAUDE.md, uv is the recommended path (including uv tool install dashai`),
    pip instructions kept.

Testing

  • Full backend suite passes with the new environment: uv run pytest tests/ → 541 passed. - Wheel built with uv build passes twine check; verified i, DashAI/alembic, seeds and static images, and no longerships tests/`.
  • Smoke test: server boots from the uv-managed venv and `/api/mponent registry.
  • uv sync --locked --extra cpu and --extra cuda resolve coend locally; the CUDA llama-cpp compilation is only exercised by
    Dockerfile.cuda, same as before).

Notes

  • pip survives on purpose in three places — please don't " installer (DashAI/back/plugins/utils.py) runs in the enduser's env where pip is guaranteed; the AppImage job uses pythupdate-server.sh` falls back to pip if the server lacks uv.
  • The PyTorch index selection in the extras lives in [tool.uval and not published to PyPI — pip users still follow the manual --index-url` instructions in the README (unchanged).
  • Gotcha for contributors: uv run re-syncs the env to the deuv sync --extra cpu, use uv run --no-sync or re-run thesync.
  • Contributors now need uv installed (one-liner, see README); e watched on its first run against production.

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