mirror of
https://github.com/Ar9av/obsidian-wiki.git
synced 2026-09-14 20:36:34 +08:00
fix(deps): make uv lock/sync/run work, and declare pytest for tests (#214)
Every `uv lock`, `uv sync`, and `uv run` in this repo failed outright:
No solution found when resolving dependencies for split
(markers: python_full_version == '3.9.*')
... mcp>=2.0.0 depends on Python>=3.10 ...
uv resolves every Python version covered by `requires-python` (>=3.9), not
just the active interpreter, and the `server` extra pulled in `mcp>=2.0`,
which requires >=3.10. The 3.9 split therefore had no solution and the whole
lock was unusable.
Two changes:
- Mark mcp as 3.10+ inside the `server` extra:
`"mcp>=2.0; python_version >= '3.10'"`. This states what is already true
rather than adding a new constraint: the memory server is a 3.10+ surface
(server.py imports mcp at module scope, and the Dockerfile ships
python:3.12-slim). The pure-stdlib CLI keeps its 3.9 support, so the CI
matrix is unchanged.
- Declare pytest in a `[dependency-groups] dev` group so the suite runs
through uv with no extra flags (`uv sync && uv run pytest tests/ -q`).
CI previously pip-installed pytest ad hoc.
uv.lock is regenerated. It predated the `server` extra entirely — no
fastapi/uvicorn/mcp entries — so uv re-resolved from scratch on every run.
Verified: `uv sync && uv run pytest tests/ -q` -> 701 passed, 5 skipped.
`uv sync --extra server` pulls mcp 2.2.0 / fastapi 0.141.1 / uvicorn 0.52.4,
and `import obsidian_wiki.server` yields `app = FastAPI`.
This commit is contained in:
+10
-1
@@ -39,7 +39,12 @@ ast = ["tree-sitter>=0.21", "tree-sitter-languages>=1.10"]
|
||||
# Higher-fidelity community detection (Leiden algorithm; greedy label propagation is the default fallback).
|
||||
graph = ["leidenalg>=0.10", "igraph>=0.11"]
|
||||
# HTTP + MCP memory server (obsidian_wiki/server.py). The core wheel stays dependency-free.
|
||||
server = ["fastapi>=0.115", "uvicorn[standard]>=0.30", "mcp>=2.0"]
|
||||
# mcp needs Python >=3.10; the marker keeps uv's cross-version resolver solvable.
|
||||
server = [
|
||||
"fastapi>=0.115",
|
||||
"uvicorn[standard]>=0.30",
|
||||
"mcp>=2.0; python_version >= '3.10'",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/Ar9av/obsidian-wiki"
|
||||
@@ -49,6 +54,10 @@ Issues = "https://github.com/Ar9av/obsidian-wiki/issues"
|
||||
[project.scripts]
|
||||
obsidian-wiki = "obsidian_wiki.cli:main"
|
||||
|
||||
# Test-only; `uv sync` installs it, so `uv run pytest tests/ -q` needs no extra flags.
|
||||
[dependency-groups]
|
||||
dev = ["pytest"]
|
||||
|
||||
# Version is derived from the git tag (CalVer, e.g. v2026.05.2 -> 2026.5.2),
|
||||
# matching the repo's release tags. Tagging a release is the version bump.
|
||||
[tool.hatch.version]
|
||||
|
||||
Reference in New Issue
Block a user