Skip to content

Switch to hatchling, uv sources, and from_artifact() APIs#8

Merged
vicentebolea merged 8 commits into
masterfrom
feature/uv-support-and-api-updates
May 15, 2026
Merged

Switch to hatchling, uv sources, and from_artifact() APIs#8
vicentebolea merged 8 commits into
masterfrom
feature/uv-support-and-api-updates

Conversation

@vicentebolea
Copy link
Copy Markdown
Member

Summary

  • Build backend: setuptools → hatchling with [tool.hatch.build.targets.wheel] (mirrors vtk-knowledge/vtk-index/vtk-validate)
  • uv support: [tool.uv.sources] maps vtk-knowledge, vtk-validate, and vtk-index to local sibling paths for development; when installed via uv add vtk-mcp from another project, uv resolves them from GitHub
  • Artifact-based init: knowledge_artifact_path is now Optional — when unset, VTKAPIIndex.from_artifact(vtk_version) downloads the JSONL from ghcr.io automatically; no local file required
  • Embedded Qdrant storage: qdrant_url is now Optional — when unset and retrieval is enabled, Retriever.from_artifact(vtk_version) downloads the pre-built embedded Qdrant storage; no server required
  • New CLI flag: --vtk-version / VTK_MCP_VTK_VERSION selects which VTK artifact to fetch
  • CI: migrated from pip+venv+black+flake8 to uv + ruff (matching sibling projects); installs vtk-knowledge and vtk-validate from GitHub in CI
  • Formatting: applied ruff to all src/vtk_mcp source files

Test plan

  • Unit tests pass (pytest -m unit)
  • Client tests pass (pytest tests/test_client_no_server.py)
  • ruff check src/ — no errors
  • ruff format --check src/ — clean
  • CI matrix (Python 3.10–3.12) via GitHub Actions

- Build backend: setuptools -> hatchling with [tool.hatch.build.targets.wheel]
- pyproject.toml: rename test -> dev extra, add ruff config, add pythonpath
  to pytest, add [tool.uv.sources] pointing to sibling vtk-* packages so
  `uv add vtk-mcp` resolves them from local paths during development
- config.py: knowledge_artifact_path is now Optional (None = auto-download
  via VTKAPIIndex.from_artifact); qdrant_url is Optional (None = use
  Retriever.from_artifact embedded storage); enable_retrieval defaults False
- composition.py: calls VTKAPIIndex.from_artifact(vtk_version) when no
  local path is given; calls Retriever.from_artifact when qdrant_url is
  unset, so no Qdrant server is needed for retrieval
- __main__.py: expose --vtk-version / VTK_MCP_VTK_VERSION CLI option
- ci.yml: replace pip+venv with uv, install sibling packages from GitHub,
  replace black/flake8 with ruff lint + format checks
- Apply ruff formatting across all src/vtk_mcp source files
…d time

- Use uv for fast dependency installation
- Install vtk-knowledge and vtk-validate from GitHub (not on PyPI)
- Install vtk-mcp[retrieval] to pull in vtk-index
- Pre-download VTKAPIIndex artifact and Retriever embedded Qdrant storage
  during image build so the container is fully ready without network access
- VTK_VERSION build arg selects which artifact version to cache (default 9.3.0)
setup-uv creates a venv; use `uv venv` + `uv pip install` (no --system)
and invoke binaries directly via .venv/bin/ as vtk-index does.
- pyproject.toml [tool.uv.sources]: switch from local path overrides to git
  URLs so `uv sync` works in CI without sibling projects checked out locally
- ci.yml: use `uv sync --extra dev` + `uv run` instead of separate uv pip
  install steps; revert docker-deploy back to deploy.Dockerfile
- deploy.Dockerfile: rewrite to use uv, install vtk-* from GitHub, and
  pre-cache the vtk-knowledge JSONL and vtk-index embedded Qdrant storage
  at image build time so the container serves requests without network access
- lint/test jobs: back to pip + setup-python (no uv dependency)
- new uv-smoke job: verifies `uv sync --extra dev` resolves correctly and
  the package imports, exercising the [tool.uv.sources] git URL entries
@vicentebolea vicentebolea merged commit 3b30c99 into master May 15, 2026
7 checks passed
@vicentebolea vicentebolea deleted the feature/uv-support-and-api-updates branch May 15, 2026 00:54
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