05 — Add graph runtime dependencies
- Priority: P1
- Depends on: none
- Size: S (15–30 min)
- Files:
pyproject.toml,tests/test_graphify_bridge.py - PR title:
fix: include graph runtime dependencies in extras
Read first
pyproject.toml, sections[project.optional-dependencies], keysgraph(around line 60) andall(around line 80)tests/test_graphify_bridge.py, functiontest_pyproject_has_graph_extra(around line 92)
Problem
The graph extra contains only:
graph = ["graphifyy>=0.4.20"]
But the graph pipeline needs two packages that graphifyy does not
declare:
matplotlib— report and HTML rendering. Without it the graph crashes withImportError: matplotlib not installed.scipy— community detection and analysis. Without it the graph crashes withModuleNotFoundError: No module named 'scipy'.
Both were installed manually in this environment. A fresh
pip install sessionwiki[graph] leaves sessionwiki graph broken: it falls
back to the builtin engine with a warning.
Required change
In pyproject.toml update both extras:
graph = [
"graphifyy>=0.4.20",
"matplotlib>=3.8",
"scipy>=1.11",
]
all = [
"graphifyy>=0.4.20",
"matplotlib>=3.8",
"scipy>=1.11",
]
Keep the existing formatting style of the file. Do not add a version pin tighter than the minimums above unless the repository already pins those packages elsewhere.
Test
Update tests/test_graphify_bridge.py::test_pyproject_has_graph_extra:
def test_pyproject_has_graph_extra():
from sessionwiki import REPO_ROOT
content = (REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8")
assert 'graph = [' in content
assert "graphifyy" in content
assert "matplotlib" in content
assert "scipy" in content
The all extra uses the same packages; the test can also assert that
the string matplotlib appears at least twice, but a simple presence
check is enough.
Verification
.venv/bin/pip install -e '.[graph]'
.venv/bin/python -c "import matplotlib, scipy; print(matplotlib.__version__, scipy.__version__)"
.venv/bin/python -m pytest tests/test_graphify_bridge.py -q
.venv/bin/python -m sessionwiki graph
Expected:
- Both imports succeed.
- The graph command completes without
ModuleNotFoundError. graphify-out/graph.jsonis written.
If pip install -e '.[graph]' changes installed versions, record the
diff in the PR body. Do not commit a lock file.
Acceptance criteria
- [ ]
graphextra listsmatplotlibandscipy. - [ ]
allextra listsmatplotlibandscipy. - [ ] The updated test passes.
- [ ]
sessionwiki graphcompletes without a missing-module fallback. - [ ]
CHANGELOG.mdupdated.
Out of scope
- Updating
README.mdanddocs/configuration.md. The repository rule says new runtime deps need docs; add one line there only if the installation instructions mention thegraphextra. If they do, update the same PR. - Changing graphify itself.
- Adding
numpyor other transitive dependencies;graphifyyalready declares them.
Rollback
Revert pyproject.toml and the test.