Skip to content

Sphinx build fails on .codespell/test_data/test_notebook.ipynb #698

@drbenvincent

Description

@drbenvincent

Summary

The .codespell/test_data/test_notebook.ipynb file inside docs/source/ is picked up by Sphinx during documentation builds, causing a build failure:

sphinx.errors.ThemeError: An error happened in rendering the page .codespell/test_data/test_notebook.
Reason: NotADirectoryError(20, 'Not a directory')

Steps to reproduce

  1. Clean the docs build cache: make cleandocs
  2. Build the docs: make html
  3. The build fails with the error above.

The issue may not always surface if there is a stale docs/_build cache, but it reliably reproduces on a clean build.

Root cause

The .codespell/test_data/ directory (added in commit 54ff563) lives inside docs/source/, which is the Sphinx source root. Sphinx discovers all .ipynb files under this directory via the myst-nb parser, including test fixtures that are not intended to be documentation pages.

The current exclude_patterns in docs/source/conf.py only excludes _build, Thumbs.db, and .DS_Store — it does not exclude .codespell.

Proposed fix

Add .codespell to the exclude_patterns list in docs/source/conf.py:

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".codespell"]

Alternatively, the .codespell/test_data/ directory could be moved outside of docs/source/ entirely (e.g. to tests/codespell/), but the exclude pattern is the minimal fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions