FEAT: hook to run notebooks
See original GitHub issueRequest
A pre-commit hook that ensures notebooks have valid code and will run without error.
Motivation
We may push notebooks to remote repos and later discover that users experience errors caused from typos or insufficient kernels/python versions. Using a pre-push hook to defensively “validate” notebooks can guard against simple errors and reduce calls to CI.
Approaches
There may be some approaches to this:
- use nbconvert to run all notebooks
- parse the ast based on the notebook’s kernel (potentially faster)
Examples
Pre-commit hook
repos:
- repo: https://github.com/nbQA-dev/nbQA/issues/new
rev: <latest>
hooks:
- id: nbqa-valid-nb
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
File save hooks — Jupyter Notebook 6.5.2 documentation
You can configure functions that are run whenever a file is saved. There are two hooks available: ContentsManager.pre_save_hook runs on the API path...
Read more >Git-Friendly Jupyter - nbdev
It provides a set of hooks which enable git-friendly Jupyter notebooks in any git repo, including those that don't use the broader nbdev...
Read more >CircuitPython with Jupyter Notebooks
When you launch notebooks using the CircuitPython-Kernel, it'll search the serial ports on your computer and connect to your Adafruit CircuitPython board.
Read more >Example Notebooks: Use Your Own Algorithm or Model
The following Jupyter notebooks show how to use your own algorithms or pretrained models from an Amazon SageMaker notebook instance.
Read more >nbstripout: strip output from Jupyter and IPython notebooks
Opens a notebook, strips its output, and writes the outputless version to the original file. Useful mainly as a git filter or pre-commit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m stunned. Fastest, most helpful response on GitHub I’ve experienced yet. Wow. Thank you all.
@pylang this’ll be in the next release, but in the meantime, you can use it as
if you like - please do let us know if you run into any issues