Repository navigation
Commit 3c1124a
authored
chore(scripts): add reusable notebook_setup sparse-checkout helper (#14768)
Add a reusable, standard-library bootstrap utility in scripts/notebook-setup/
for tutorials and sample notebooks that depend on sibling Python modules when
opened standalone in Google Colab or Colab Enterprise.
- Sparse-clones only the target sample subdirectory into a managed cache folder,
self-heals interrupted non-git directories, fetches and checks out FETCH_HEAD
on persistent runtimes, installs requirements.txt, and reloads imported sibling
sample modules.
- Preserves existing local developer and CI repository checkouts without running
git fetch or git checkout -f.
- Includes unit tests in scripts/notebook-setup/tests/notebook_setup_test.py.1 parent 6d6d315 commit 3c1124a
8 files changed
Lines changed: 779 additions & 0 deletions
File tree
- scripts/notebook-setup
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments