Skip to content

Restore the api extra (fastapi, uvicorn, jinja2) and install it in CI - #35

Open
Nitjsefnie wants to merge 3 commits into
mienetic:mainfrom
Nitjsefnie-OSC:fix/api-extra
Open

Nitjsefnie wants to merge 3 commits into
mienetic:mainfrom
Nitjsefnie-OSC:fix/api-extra

Conversation

@Nitjsefnie

Copy link
Copy Markdown
Contributor

Summary

Defines the api extra that the CLI already recommends (mnema-mcp[api]) and installs it in CI, so the 15 REST-API tests stop skipping. The extra is not new β€” c17ff41 (#22) shipped it, and the cherry-pick af4bc31 rolled pyproject.toml back to an older revision and dropped it. This restores it.

Related issue

Closes #32
Relates to #34

Changes

  • packages/mnema-python/pyproject.toml β€” add api = ["fastapi>=0.115", "uvicorn>=0.30", "jinja2>=3.1"]
  • .github/workflows/python-ci.yml β€” install .[all,api,dev] instead of .[all,dev], so the REST-API tests actually run

Checklist

  • ruff check . is clean β€” ran CI's own invocation, ruff check src/ tests/ β†’ All checks passed!
  • pytest passes (with the relevant [extra] installed if you touched a backend) β€” 164 passed, 1 skipped on .[all,api,dev]; the skip is tests/test_backends.py:113, pgvector's MNEMA_PGVECTOR_TEST_DSN not being set. tests/test_api.py goes from 1 passed, 15 skipped to 16 passed, verified as a before/after in two fresh venvs rather than only after.
  • New public functions / classes have docstrings β€” n/a, this adds no code
  • Docs updated (README.md, SKILL.md, docs/) if user-facing behavior changed β€” n/a, and worth noting why: README.md:81 and docs/backends.md:45 already list api. The docs were never rolled back; only pyproject.toml was, which is why the docs and the package disagreed.
  • If this adds a backend or embedding provider β€” n/a, not a backend

Notes for reviewer

Why jinja2 is in the extra, since the original wasn't. src/mnema/cli.py:517 already tells the user the dashboard "requires the 'api' extra (fastapi + uvicorn + jinja2)". With api = [fastapi, uvicorn], that sentence is false in an unhelpful way: someone who installs .[api] and runs mnema dashboard gets that exact message, telling them to install the extra they already have. Adding jinja2 makes your existing sentence true rather than editing your prose. If you would rather api stay fastapi + uvicorn and the message change instead, say so and I will flip it.

python-multipart deliberately not added, even though the dashboard's Form(...) routes need it: mcp is a core dependency and hard-requires python-multipart>=0.0.9, so it is present in every install already. I checked this by registering a Form route in a venv without it (RuntimeError: Form data requires "python-multipart" to be installed.) and confirming it resolves in a plain .[all,dev] install.

Version floors. I used fastapi>=0.115 / uvicorn>=0.30 rather than the original >=0.110 / >=0.29 from c17ff41. Both match the file's uniform >=X.Y floor style; happy to restore the originals if you prefer minimal drift from what you had.

One honest caveat on #32's framing. "15 tests never run in CI" holds against today's index, where .[all,dev] resolves 148 packages with no fastapi. Older chromadb (<1.0) carried fastapi as a core dependency, so a past resolution would have pulled it in and those tests would have run. The missing extra is real either way; the CI symptom is resolution-dependent.

Still not fixed, and not bundled here. .[api] alone still cannot run mnema dashboard end to end, because no vector backend ships in it β€” the practical minimum is [api,chroma,local]. mnema serve has the same shape, since both construct MemoryService eagerly. Tell me if you would like the error message to say that and I will send a follow-up.

Bugs discovered

Generated by Claude Opus 5 (review), Kimi K3 (brief, implementation, verification)

Nitjsefnie and others added 3 commits August 1, 2026 14:55
The CLI already tells users to install 'mnema-mcp[api]' (cli.py) and
docs/backends.md documents the extra, but it did not exist in
pyproject.toml, so 15 REST-API tests were silently skipped. Add
api = ["fastapi>=0.115", "uvicorn>=0.30"] matching the lower-bound
pinning style of the existing extras.

Co-Authored-By: Kimi K3 <noreply@kimi.com>
The CI install step used '.[all,dev]' and 'all' deliberately excludes
the API-serving group, so tests/test_api.py skipped 15 tests on every
run. Install '.[all,api,dev]' instead.

Co-Authored-By: Kimi K3 <noreply@kimi.com>
cli.py's dashboard error message states the api extra is
'fastapi + uvicorn + jinja2', but the extra only carried fastapi and
uvicorn, so '.[api]' alone still hit that ImportError handler. Adding
jinja2 makes the repo's own description of the extra true.
python-multipart is deliberately not added: the core mcp dependency
already requires it (python-multipart>=0.0.9).

Co-Authored-By: Kimi K3 <noreply@kimi.com>
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.

No api extra exists, so mnema-mcp[api] (which the CLI recommends) fails and 15 REST-API tests never run in CI

1 participant