Skip to content

Add a pre-commit hook to check that pre-executed notebooks are marked so #558

@hombit

Description

@hombit

It is tricky to run manual documentation builds on PPT-hydrated projects, because notebooks in pre_executed should be handled separately. To help people keep the notebooks in the right state, we can ensure that they contain metadata.nbsphinx.execute: "never":
https://nbsphinx.readthedocs.io/en/0.9.8/never-execute.html
https://raw.githubusercontent.com/spatialaudio/nbsphinx/refs/heads/master/doc/never-execute.ipynb

Here is an example of such a hook in the coniferest repo:
https://github.com/snad-space/coniferest/blob/eea28212644875ba2a50e7afed1ca27b49fab229/.pre-commit-config.yaml#L33-L38
https://github.com/snad-space/coniferest/blob/eea28212644875ba2a50e7afed1ca27b49fab229/.ci/pre_executed_nb.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions