Skip to content

Fix: book build — configure mkdocstrings paths=[src] (no editable install) - #556

Merged
tschm merged 1 commit into
mainfrom
fix/book-mkdocstrings-paths
Jun 17, 2026
Merged

Fix: book build — configure mkdocstrings paths=[src] (no editable install)#556
tschm merged 1 commit into
mainfrom
fix/book-mkdocstrings-paths

Conversation

@tschm

@tschm tschm commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

After the v0.19.3 Rhiza sync (#555), the book build broke:

```
mkdocstrings: accessing 'basanos' raises ModuleNotFoundError: No module named 'basanos'
PluginError: Could not collect 'basanos.BasanosError'
make: *** [.rhiza/make.d/book.mk:52: book] Error 1
```

Root cause

The sync dropped `--with-editable .` from `MKDOCS_EXTRA_PACKAGES` because the Rhiza smoke test `test_default_book_command_does_not_use_editable_install` forbids it. The book's API reference is generated by mkdocstrings, which then could no longer import the src-layout `basanos` package from the `uvx`-isolated build environment — the editable install was the only thing making it importable.

Fix

Set `paths: [src]` on the mkdocstrings python handler in `mkdocs.yml`. This is the canonical src-layout configuration: griffe resolves the package by source path (static analysis, no import/install needed). Satisfies both constraints — the book builds and the no-editable-install smoke test stays green.

Verification

  • `uvx --with 'mkdocstrings[python]' zensical build` → exit 0, no `Could not collect` errors; `_book/api/exceptions/index.html` documents `BasanosError` and friends (37 symbol references).
  • `.rhiza/tests/integration/test_docs_targets.py` → 3 passed (including the no-editable-install assertion).
  • Only `mkdocs.yml` changed; build artifacts are gitignored.

Note: the marimo-notebook `ImportError: _DEFAULT_COND_THRESHOLD` reported earlier was a separate cvx-linalg API rename, already fixed in #555 (version-robust import).

🤖 Generated with Claude Code

…itable install

The v0.19.3 sync dropped `--with-editable .` from the book command (the Rhiza
smoke test test_default_book_command_does_not_use_editable_install forbids it).
But the book's API reference is generated by mkdocstrings, which then could no
longer import the src-layout `basanos` package from the uvx-isolated build env:

  mkdocstrings: accessing 'basanos' raises ModuleNotFoundError: No module named 'basanos'
  PluginError: Could not collect 'basanos.BasanosError'

Set `paths: [src]` on the python handler so griffe resolves the package by
source path — the canonical src-layout configuration. The book now builds with
the API docs fully collected and no editable install, satisfying both the book
and the Rhiza no-editable smoke test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 17, 2026 09:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the docs “book” build failure introduced after the Rhiza v0.19.3 sync by making mkdocstrings/griffe resolve the basanos package via source-path discovery (src-layout) instead of requiring an editable install in the isolated build environment.

Changes:

  • Configure the mkdocstrings Python handler with paths: [src] so API reference generation works without installing the package (and without --with-editable .).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tschm
tschm merged commit 700922a into main Jun 17, 2026
63 checks passed
@tschm
tschm deleted the fix/book-mkdocstrings-paths branch June 17, 2026 09:28
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.

2 participants