Skip to content

Commit

Permalink
Adding chapter build
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenDowney committed Aug 9, 2024
1 parent 4192c80 commit b3be10d
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions chapters/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Build the notebook folder and zip file

# copy notebooks from soln

cp ../ThinkPythonSolutions/soln/chap[01][0-9]*.ipynb .
cp ../ThinkPythonSolutions/soln/jupyter_intro.ipynb .
cp ../ThinkPythonSolutions/soln/thinkpython.py .
cp ../ThinkPythonSolutions/soln/diagram.py .
cp ../ThinkPythonSolutions/soln/structshape.py .
cp ../ThinkPythonSolutions/soln/words.txt .
cp ../ThinkPythonSolutions/soln/photos.zip .

# remove the solutions
python prep_notebooks.py

# pip install pytest nbmake

# run nbmake
# TODO: can we get the %%expect magic to work?
# pytest --nbmake chap*.ipynb

# commit the changes
git add jupyter_intro.ipynb
git add chap*.ipynb
git commit -m "Updating the notebooks"

# build the zip file
cd ../..; zip -r ThinkPythonNotebooks.zip \
ThinkPython/chapters/jupyter_intro.ipynb \
ThinkPython/chapters/chap*.ipynb \
ThinkPython/thinkpython.py \
ThinkPython/diagram.py \
ThinkPython/structshape.py \
ThinkPython/words.txt \
ThinkPython/photos.zip

# add and commit it
mv ThinkPythonNotebooks.zip ThinkPython
cd ThinkPython

git add ThinkPythonNotebooks.zip
git commit -m "Updating the zip file"

git push

0 comments on commit b3be10d

Please sign in to comment.