diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b0e17411..42b54ba0a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -67,7 +67,7 @@ jobs: pip freeze pip check - - name: Run tests with coverage + - name: Run tests on MacOS if: ${{ startsWith(runner.os, 'macos') }} shell: bash -l {0} run: | @@ -76,15 +76,14 @@ jobs: pip install -U websockets python -m pytest --cov nbconvert -vv - - name: Run tests on pypy and Windows + - name: Run tests on Linux if: ${{ startsWith(runner.os, 'linux') }} shell: bash -l {0} run: | conda activate nbconvert # See https://github.com/pyppeteer/pyppeteer/pull/321 pip install -U websockets - #python -m pytest -vv - xvfb-run --auto-servernum `which coverage` run -m pytest -vv + NBFORMAT_VALIDATOR=jsonschema xvfb-run --auto-servernum `which coverage` run -m pytest -vv - name: Run tests on pypy and Windows if: ${{ startsWith(runner.os, 'Windows') }} @@ -136,6 +135,7 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1 - name: Run the unit tests run: | + export NBFORMAT_VALIDATOR=jsonschema pytest -vv -W default || pytest -vv -W default --lf test_prereleases: @@ -156,7 +156,7 @@ jobs: pip check - name: Run the tests run: | - pytest -vv || pytest -vv --lf + pytest -vv -W default || pytest -vv -W default --lf make_sdist: name: Make SDist diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index d07bbc07f..2bf2ea22d 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -9,7 +9,7 @@ Changes in nbconvert * Fix markdown table not render bug by @Neutree in :ghpull:`1853` * Replace lxml.html.clean_html with bleach; drop lxml dependency by @akx in :ghpull:`1854` * Remove CircleCI badge from README by @akx in :ghpull:`1857` -* Added support for section (slide) "data-*" attributes by @bouzidanas in :ghpull:`1861` +* Added support for section (slide) ``"data-*"`` attributes by @bouzidanas in :ghpull:`1861` 7.0.0 ----- diff --git a/nbconvert/exporters/tests/test_latex.py b/nbconvert/exporters/tests/test_latex.py index 0a6c23c22..c4cbb2fb1 100644 --- a/nbconvert/exporters/tests/test_latex.py +++ b/nbconvert/exporters/tests/test_latex.py @@ -160,6 +160,7 @@ def test_svg(self): Can a LatexExporter export when it recieves raw binary strings form svg? """ filename = os.path.join(current_dir, "files", "svg.ipynb") + (output, resources) = LatexExporter().from_filename(filename) assert len(output) > 0 diff --git a/nbconvert/exporters/tests/test_rst.py b/nbconvert/exporters/tests/test_rst.py index 2c1afcc39..fb27e57b0 100644 --- a/nbconvert/exporters/tests/test_rst.py +++ b/nbconvert/exporters/tests/test_rst.py @@ -40,11 +40,13 @@ def test_empty_code_cell(self): with open(nbname, encoding="utf8") as f: nb = nbformat.read(f, 4) + nb = v4.upgrade(nb) exporter = self.exporter_class() (output, resources) = exporter.from_notebook_node(nb) # add an empty code cell nb.cells.append(v4.new_code_cell(source="")) + (output2, resources) = exporter.from_notebook_node(nb) # adding an empty code cell shouldn't change output self.assertEqual(output.strip(), output2.strip()) diff --git a/nbconvert/preprocessors/execute.py b/nbconvert/preprocessors/execute.py index 1966d8265..2e810a103 100644 --- a/nbconvert/preprocessors/execute.py +++ b/nbconvert/preprocessors/execute.py @@ -1,6 +1,7 @@ """Module containing a preprocessor that executes the code cells and updates outputs""" +from jupyter_client.manager import KernelManager from nbclient import NotebookClient from nbclient import execute as _execute @@ -35,6 +36,7 @@ class ExecutePreprocessor(Preprocessor, NotebookClient): def __init__(self, **kw): nb = kw.get("nb") + kw.setdefault("kernel_manager_class", KernelManager) Preprocessor.__init__(self, nb=nb, **kw) NotebookClient.__init__(self, nb, **kw) diff --git a/nbconvert/preprocessors/svg2pdf.py b/nbconvert/preprocessors/svg2pdf.py index 7fddf33e1..94d7d2cab 100644 --- a/nbconvert/preprocessors/svg2pdf.py +++ b/nbconvert/preprocessors/svg2pdf.py @@ -148,6 +148,6 @@ def convert_figure(self, data_format, data): if os.path.isfile(output_filename): with open(output_filename, "rb") as f: # PDF is a nb supported binary, data type, so base64 encode. - return base64.encodebytes(f.read()) + return base64.encodebytes(f.read()).decode("utf-8") else: raise TypeError("Inkscape svg to pdf conversion failed")