Skip to content

Commit

Permalink
Fix notebook rules
Browse files Browse the repository at this point in the history
In #1384, I made it such that someone could run `make notebooks/py/xxxx.py` and run the notebook.  Unfortunately, that created a dependency between the rule that regenerated the .ipynb file and the notebook running rule.  This is not desirable, as regenerating the .ipynb files take forever now.

This PR breaks that dependency.  The idea is that the notebook regeneration process is so lightweight that we don't really need to examine the mtimes, and just do it blindly.

Test: make -j validate-ipynb does not run the notebooks
  • Loading branch information
Tony Tung committed Jul 30, 2019
1 parent 14b8a12 commit 236e1d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions notebooks/subdir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ $(ipynb_validate_targets): validate__notebooks/%.ipynb :
nbencdec encode notebooks/$*.ipynb $(TEMPFILE)
diff -q <(cat notebooks/py/$*.py | egrep -v '^# EPY: stripped_notebook: ') <(cat $(TEMPFILE) | egrep -v '# EPY: stripped_notebook: ')

$(ipynb_regenerate_targets): regenerate__notebooks/%.ipynb : notebooks/py/%.py
$(ipynb_regenerate_targets): regenerate__notebooks/%.ipynb :
nbencdec decode notebooks/py/$*.py notebooks/$*.ipynb

$(py_regenerate_targets): regenerate__notebooks/py/%.py : notebooks/%.ipynb
$(py_regenerate_targets): regenerate__notebooks/py/%.py :
nbencdec encode notebooks/$*.ipynb notebooks/py/$*.py

.PHONY : $(py_files)
.PHONY : $(py_files) $(ipynb_regenerate_targets) $(py_regenerate_targets)

0 comments on commit 236e1d3

Please sign in to comment.