Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: clean notebooks #12

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ci: clean notebooks
ReenigneArcher committed Aug 21, 2024
commit f1b8af966324394889b4d1f3685382c683faee0f
10 changes: 10 additions & 0 deletions .github/workflows/update-pages.yml
Original file line number Diff line number Diff line change
@@ -40,6 +40,16 @@ jobs:
--verbose \
.

- name: nb-clean
run: |
output=$(find . -name '*.ipynb' -exec nb-clean check {} \;)

# fail if there are any issues
if [ -n "$output" ]; then
echo "$output"
exit 1
fi

update_pages:
runs-on: ubuntu-latest
steps:
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ A Jupyter notebook that creates a dashboard for viewing LizardByte repository da

1. Notebooks should be committed with the output cleared.
```bash
jupyter nbconvert --to notebook --ClearOutputPreprocessor.enabled=True --inplace ./notebook/dashboard.ipynb
find . -name '*.ipynb' -exec nb-clean clean {} \;
```

2. You can create a preview of the notebook in html by running the following commands:
@@ -22,3 +22,11 @@ A Jupyter notebook that creates a dashboard for viewing LizardByte repository da
--output=index \
./notebook/dashboard.ipynb
```

### Reviewing PRs
Notebook diffs are difficult to read. To make reviewing easier, you can enable the
[Rich Jupyter Notebook Diff](https://github.blog/changelog/2023-03-01-feature-preview-rich-jupyter-notebook-diffs/)
feature in your GitHub account settings.

Local options are also available. See [this](https://www.reviewnb.com/git-jupyter-notebook-ultimate-guide)
for more information.
2,659 changes: 88 additions & 2,571 deletions notebook/dashboard.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nb-clean==3.3.0
nbqa[toolchain]==1.8.7