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

Install latest version of nbconvert to fix Jinja issue. #1141

Merged
merged 2 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,14 @@ RUN pip install bleach && \
pip install ipywidgets && \
pip install isoweek && \
pip install jedi && \
pip install Jinja2 && \
pip install jsonschema && \
pip install jupyter-client && \
pip install jupyter-console && \
pip install jupyter-core && \
pip install MarkupSafe && \
pip install mistune && \
pip install nbconvert && \
# b/227194111 install latest version of nbconvert until the base image includes nbconvert >= 6.4.5
pip install --upgrade nbconvert Jinja2 && \
pip install nbformat && \
pip install notebook && \
pip install papermill && \
Expand Down
20 changes: 18 additions & 2 deletions tests/test_jupyter_nbconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import subprocess

class TestJupyterNbconvert(unittest.TestCase):
def test_nbconvert(self):
def test_nbconvert_to_notebook(self):
result = subprocess.run([
'jupyter',
'nbconvert',
Expand All @@ -17,4 +17,20 @@ def test_nbconvert(self):
], stdout=subprocess.PIPE)

self.assertEqual(0, result.returncode)
self.assertTrue(b'999' in result.stdout)
self.assertTrue(b'999' in result.stdout)

def test_nbconvert_to_html(self):
result = subprocess.run([
'jupyter',
'nbconvert',
'--to',
'html',
'--template',
'/opt/kaggle/nbconvert-extensions.tpl',
'--execute',
'--stdout',
'/input/tests/data/notebook.ipynb',
], stdout=subprocess.PIPE)

self.assertEqual(0, result.returncode)
self.assertTrue(b'999' in result.stdout)