File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ #
4+ # 1) Initialization - `git pull` + create-new-branch
5+ #
6+ echo " ======= Init ======="
7+ cd " $( git rev-parse --show-toplevel) "
8+
9+ git checkout main
10+ git pull
11+
12+ echo
13+ git checkout -b " my_pr_$( date ' +%Y.%m.%d_%H.%M' ) "
14+ echo
15+
16+ echo " Updating pip"
17+ python -m pip install -U -r requirements.txt -r requirements_tests.txt
18+
19+ #
20+ # 2) Update the notebooks
21+ #
22+ echo
23+ echo
24+ echo " ======= Updating notebooks ======="
25+ # test all bernstein-vazirani notebooks
26+ find . -type f -name " *bernstein*.ipynb" | xargs -P2 -I{} jupyter nbconvert --to notebook --execute --inplace {}
27+ # # test all algorithms
28+ # find algorithms/ -type f -name "*.ipynb" | xargs -P8 -I{} jupyter nbconvert --to notebook --execute --inplace {}
29+ # # test 3 notebooks
30+ # find . -type f -name "*.ipynb" | head -n 3 | xargs -P8 -I{} jupyter nbconvert --to notebook --execute --inplace {}
31+ # # test all notebooks
32+ # find algorithms applications tutorials -type f -name "*.ipynb" | xargs -P8 -I{} jupyter nbconvert --to notebook --execute --inplace {}
33+
34+ #
35+ # 3) Commit the changes + open PR
36+ #
37+ echo
38+ echo
39+ echo " ======= Creating PR ======="
40+ # running twice so that we'd include the pre-commit updates
41+ git commit -a -m " Updating notebooks output" || git commit -a -m " Updating notebooks output"
42+ # # running once, so that failure on pre-commit would fail this script
43+ # git commit -a -m "Updating notebooks output" || echo "pre-commit failed. please fix manually"
44+
45+ gh pr create --fill
46+ gh pr view --web
You can’t perform that action at this time.
0 commit comments