commit python-nbconvert for openSUSE:Factory
Hello community, here is the log from the commit of package python-nbconvert for openSUSE:Factory checked in at 2019-11-29 15:56:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-nbconvert (Old) and /work/SRC/openSUSE:Factory/.python-nbconvert.new.26869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-nbconvert" Fri Nov 29 15:56:11 2019 rev:3 rq:747936 version:5.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-nbconvert/python-nbconvert.changes 2019-08-13 20:33:32.639247978 +0200 +++ /work/SRC/openSUSE:Factory/.python-nbconvert.new.26869/python-nbconvert.changes 2019-11-29 15:56:36.456982333 +0100 @@ -1,0 +2,19 @@ +Tue Nov 12 15:32:59 UTC 2019 - Todd R <toddrme2178@gmail.com> + +- Update to 5.6.1 + + New Features + * Add support for alt tags for jpeg and png images + * Allow HTML header anchor text to be HTML + * Change RegExRemove to remove code cells with output + * Added cell tag data attributes to HTML exporter + + Fixing Problems + * Update svg2pdf.py to search the PATH for inkscape + * Fix latex dependencies installation command for Ubuntu systems + + Testing, Docs, and Builds + * Added Circle CI builds for documentation + * Fix typo in argument name in docstring (TagRemovePreprocessor) + * Changelog typo fix + * Updated API page for TagRemovePreprocessor and TemplateExporter + * Added remove_input_tag traitlet to the docstring + +------------------------------------------------------------------- Old: ---- nbconvert-5.6.0.tar.gz New: ---- nbconvert-5.6.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-nbconvert.spec ++++++ --- /var/tmp/diff_new_pack.GR8njy/_old 2019-11-29 15:56:37.752981590 +0100 +++ /var/tmp/diff_new_pack.GR8njy/_new 2019-11-29 15:56:37.752981590 +0100 @@ -17,9 +17,9 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define doc_ver 5.6.0 +%define doc_ver 5.6.1 Name: python-nbconvert -Version: 5.6.0 +Version: 5.6.1 Release: 0 Summary: Conversion of Jupyter Notebooks License: BSD-3-Clause @@ -41,8 +41,8 @@ BuildRequires: %{python_module entrypoints >= 0.2.2} BuildRequires: %{python_module ipykernel} BuildRequires: %{python_module ipywidgets} -BuildRequires: %{python_module jupyter_client >= 5.3.1} -BuildRequires: %{python_module jupyter_core} +BuildRequires: %{python_module jupyter-client >= 5.3.1} +BuildRequires: %{python_module jupyter-core} BuildRequires: %{python_module mistune >= 0.7.4} BuildRequires: %{python_module mock} BuildRequires: %{python_module nbformat >= 4.4} @@ -59,8 +59,8 @@ Requires: python-bleach Requires: python-defusedxml Requires: python-entrypoints >= 0.2.2 -Requires: python-jupyter_core -Requires: python-jupyter_client >= 5.3.1 +Requires: python-jupyter-core +Requires: python-jupyter-client >= 5.3.1 Requires: python-mistune >= 0.7.4 Requires: python-nbformat >= 4.4 Requires: python-pandocfilters >= 1.4.1 @@ -83,8 +83,8 @@ %package -n jupyter-nbconvert Summary: Conversion of Jupyter Notebooks Requires: jupyter-ipykernel -Requires: jupyter-jupyter_client >= 4.2 -Requires: jupyter-jupyter_core +Requires: jupyter-jupyter-client >= 4.2 +Requires: jupyter-jupyter-core Requires: jupyter-nbformat >= 4.4 Requires: python3-nbconvert = %{version} Conflicts: python3-jupyter_nbconvert < 5.5.0 ++++++ nbconvert-5.6.0.tar.gz -> nbconvert-5.6.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/PKG-INFO new/nbconvert-5.6.1/PKG-INFO --- old/nbconvert-5.6.0/PKG-INFO 2019-08-09 05:57:11.000000000 +0200 +++ new/nbconvert-5.6.1/PKG-INFO 2019-10-25 02:36:50.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: nbconvert -Version: 5.6.0 +Version: 5.6.1 Summary: Converting Jupyter Notebooks Home-page: https://jupyter.org Author: Jupyter Development Team @@ -18,6 +18,7 @@ [![Documentation Status](https://readthedocs.org/projects/nbconvert/badge/?version=latest)](https://nbconvert.readthedocs.io/en/latest/?badge=latest) [![Documentation Status](https://readthedocs.org/projects/nbconvert/badge/?version=stable)](http://nbconvert.readthedocs.io/en/stable/?badge=stable) [![codecov.io](https://codecov.io/github/jupyter/nbconvert/coverage.svg?branch=master)](https://codecov.io/github/jupyter/nbconvert?branch=master) + [![CircleCI Docs Status](https://circleci.com/gh/jupyter/nbconvert/tree/master.svg?style=svg)](https://circleci.com/gh/jupyter/nbconvert/tree/master) The **nbconvert** tool, `jupyter nbconvert`, converts notebooks to various other @@ -110,8 +111,8 @@ Classifier: Programming Language :: Python :: 3.7 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* Description-Content-Type: text/markdown -Provides-Extra: all Provides-Extra: docs +Provides-Extra: test Provides-Extra: serve Provides-Extra: execute -Provides-Extra: test +Provides-Extra: all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/README.md new/nbconvert-5.6.1/README.md --- old/nbconvert-5.6.0/README.md 2019-05-05 19:12:56.000000000 +0200 +++ new/nbconvert-5.6.1/README.md 2019-10-25 02:34:40.000000000 +0200 @@ -6,6 +6,7 @@ [![Documentation Status](https://readthedocs.org/projects/nbconvert/badge/?version=latest)](https://nbconvert.readthedocs.io/en/latest/?badge=latest) [![Documentation Status](https://readthedocs.org/projects/nbconvert/badge/?version=stable)](http://nbconvert.readthedocs.io/en/stable/?badge=stable) [![codecov.io](https://codecov.io/github/jupyter/nbconvert/coverage.svg?branch=master)](https://codecov.io/github/jupyter/nbconvert?branch=master) +[![CircleCI Docs Status](https://circleci.com/gh/jupyter/nbconvert/tree/master.svg?style=svg)](https://circleci.com/gh/jupyter/nbconvert/tree/master) The **nbconvert** tool, `jupyter nbconvert`, converts notebooks to various other diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/docs/source/api/preprocessors.rst new/nbconvert-5.6.1/docs/source/api/preprocessors.rst --- old/nbconvert-5.6.0/docs/source/api/preprocessors.rst 2019-04-30 05:01:41.000000000 +0200 +++ new/nbconvert-5.6.1/docs/source/api/preprocessors.rst 2019-10-25 02:34:40.000000000 +0200 @@ -2,6 +2,7 @@ ============= .. module:: nbconvert.preprocessors + :noindex: .. seealso:: @@ -19,23 +20,42 @@ Specialized preprocessors ------------------------- +Converting and extracting figures +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .. autoclass:: ConvertFiguresPreprocessor .. autoclass:: SVG2PDFPreprocessor .. autoclass:: ExtractOutputPreprocessor +Converting text +~~~~~~~~~~~~~~~ + .. autoclass:: LatexPreprocessor +.. autoclass:: HighlightMagicsPreprocessor + +Metadata and header control +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autoclass:: ClearMetadataPreprocessor + .. autoclass:: CSSHTMLHeaderPreprocessor -.. autoclass:: HighlightMagicsPreprocessor +Removing cells, inputs, and outputs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autoclass:: ClearOutputPreprocessor .. autoclass:: RegexRemovePreprocessor +.. autoclass:: TagRemovePreprocessor + +Executing Notebooks +~~~~~~~~~~~~~~~~~~~ + .. autoclass:: ExecutePreprocessor :members: -.. autofunction:: coalesce_streams +.. autofunction:: coalesce_streams \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/docs/source/changelog.rst new/nbconvert-5.6.1/docs/source/changelog.rst --- old/nbconvert-5.6.0/docs/source/changelog.rst 2019-08-09 05:54:46.000000000 +0200 +++ new/nbconvert-5.6.1/docs/source/changelog.rst 2019-10-25 02:34:43.000000000 +0200 @@ -4,10 +4,59 @@ Changes in nbconvert ==================== +5.6.1 +----- + +The following authors and reviewers contributed the changes for this release -- Thanks you all! + +* Charles Frye +* Chris Holdgraf +* Felipe Rodrigues +* Gregor Sturm +* Jim +* Kerwin Sun +* Ryan Beesley +* Matthew Seal +* Matthias Geier +* thuy-van +* Tyler Makaro + +Significant Changes +~~~~~~~~~~~~~~~~~~~ + +RegExRemove applies to all cells +++++++++++++++++++++++++++++++++ + +RegExRemove preprocessor now removes cells regardless of cell outputs. Before this only cells that had outputs were filtered. + +Comprehensive notes +~~~~~~~~~~~~~~~~~~~ + +New Features +++++++++++++ +- Add support for alt tags for jpeg and png images :ghpull:`1112`: +- Allow HTML header anchor text to be HTML :ghpull:`1101`: +- Change RegExRemove to remove code cells with output :ghpull:`1095`: +- Added cell tag data attributes to HTML exporter :ghpull:`1090`: and :ghpull:`1089`: + +Fixing Problems ++++++++++++++++ +- Update svg2pdf.py to search the PATH for inkscape :ghpull:`1115`: +- Fix latex dependencies installation command for Ubuntu systems :ghpull:`1109`: + +Testing, Docs, and Builds ++++++++++++++++++++++++++ +- Added Circle CI builds for documentation :ghpull:`1114`: :ghpull:`1120`:, and :ghpull:`1116`: +- Fix typo in argument name in docstring (TagRemovePreprocessor) :ghpull:`1103`: +- Changelog typo fix :ghpull:`1100`: +- Updated API page for TagRemovePreprocessor and TemplateExporter :ghpull:`1088`: +- Added remove_input_tag traitlet to the docstring :ghpull:`1088`: + 5.6 --- The following 24 authors and reviewers contributed 224 commits -- Thank you all! + * 00Kai0 * Aidan Feldman * Alex Rudy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/docs/source/external_exporters.rst new/nbconvert-5.6.1/docs/source/external_exporters.rst --- old/nbconvert-5.6.0/docs/source/external_exporters.rst 2019-06-13 08:06:35.000000000 +0200 +++ new/nbconvert-5.6.1/docs/source/external_exporters.rst 2019-10-25 02:34:40.000000000 +0200 @@ -32,7 +32,7 @@ Registering a custom exporter as an entry point ----------------------------------------------- -Additional exporters may be registered as named `entry_points`_. +Additional exporters may be registered as named entry_points_. nbconvert uses the ``nbconvert.exporters`` entry point to find exporters from any package you may have installed. @@ -60,7 +60,8 @@ instead of having to specify the full import name of the custom exporter. -.. _entry_points: https://packaging.python.org/en/latest/distributing/#entry-points +.. _entry_points: https://packaging.python.org/guides/ + creating-and-discovering-plugins/#using-package-metadata Using a custom exporter without entrypoints diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/docs/source/index.rst new/nbconvert-5.6.1/docs/source/index.rst --- old/nbconvert-5.6.0/docs/source/index.rst 2019-04-30 05:01:41.000000000 +0200 +++ new/nbconvert-5.6.1/docs/source/index.rst 2019-10-25 02:34:40.000000000 +0200 @@ -38,6 +38,7 @@ usage nbconvert_library latex_citations + removing_cells execute_api .. toctree:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/docs/source/install.rst new/nbconvert-5.6.1/docs/source/install.rst --- old/nbconvert-5.6.0/docs/source/install.rst 2019-04-30 05:01:41.000000000 +0200 +++ new/nbconvert-5.6.1/docs/source/install.rst 2019-10-25 02:34:40.000000000 +0200 @@ -15,7 +15,7 @@ # OR conda install nbconvert -If you're new to Python, we recommend installing `Anaconda <https://www.continuum.io/downloads>`_, +If you're new to Python, we recommend installing `Anaconda <https://www.anaconda.com/distribution/>`_, a Python distribution which includes nbconvert and the other Jupyter components. .. important:: @@ -58,7 +58,7 @@ * Linux: `TeX Live <http://tug.org/texlive/>`_ - * E.g. on Debian or Ubuntu: ``sudo apt-get install texlive-xetex`` + * E.g. on Debian or Ubuntu: ``sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-generic-recommended`` * macOS (OS X): `MacTeX <http://tug.org/mactex/>`_. * Windows: `MikTex <http://www.miktex.org/>`_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/docs/source/nbconvert_library.ipynb new/nbconvert-5.6.1/docs/source/nbconvert_library.ipynb --- old/nbconvert-5.6.0/docs/source/nbconvert_library.ipynb 2019-08-07 00:51:31.000000000 +0200 +++ new/nbconvert-5.6.1/docs/source/nbconvert_library.ipynb 2019-10-25 02:34:40.000000000 +0200 @@ -657,7 +657,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "@damianavila wrote the Nikola Plugin to [write blog post as Notebooks](http://www.damian.oquanta.info/posts/one-line-deployment-of-your-site-to-gh-...) and is developing a js-extension to publish notebooks via one click from the web app." + "@damianavila wrote the Nikola Plugin to [write blog post as Notebooks](http://damianavila.github.io/blog/posts/one-line-deployment-of-your-site-to-...) and is developing a js-extension to publish notebooks via one click from the web app." ] }, { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/docs/source/removing_cells.rst new/nbconvert-5.6.1/docs/source/removing_cells.rst --- old/nbconvert-5.6.0/docs/source/removing_cells.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/nbconvert-5.6.1/docs/source/removing_cells.rst 2019-10-25 02:34:40.000000000 +0200 @@ -0,0 +1,66 @@ +Removing cells, inputs, or outputs +================================== + +.. module:: nbconvert.preprocessors + +When converting Notebooks into other formats, it is possible to +remove parts of a cell, or entire cells, using preprocessors. +The notebook will remain unchanged, but the outputs will have +certain pieces removed. Here are two primary ways to accomplish +this. + +Removing pieces of cells using cell tags +---------------------------------------- + +The most straightforward way to control which pieces of cells are +removed is to use **cell tags**. These are single-string snippets of +metadata that are stored in each cells "tag" field. The +:class:`TagRemovePreprocessor` can be used +to remove inputs, outputs, or entire cells. + +For example, here is a configuration that uses a different tag for +removing each part of a cell with the HTMLExporter. In this case, +we demonstrate using the nbconvert Python API. + +.. code-block:: python + + from traitlets.config import Config + import nbformat as nbf + from nbconvert.exporters import HTMLExporter + + c = Config() + + # Configure our tag removal + c.TagRemovePreprocessor.remove_cell_tags = ("remove_cell",) + c.TagRemovePreprocessor.remove_all_outputs_tags = ('remove_output',) + c.TagRemovePreprocessor.remove_input_tags = ('remove_input',) + + # Configure and run out exporter + c.HTMLExporter.preprocessors = ["TagRemovePreprocessor"] + HTMLExporter(config=c).from_filename("path/to/mynotebook.ipynb") + +Removing cells using Regular Expressions on cell content +-------------------------------------------------------- + +Sometimes you'd rather remove cells based on their _content_ rather +than their tags. In this case, you can use the :class:`RegexRemovePreprocessor`. + +You initalize this preprocessor with a single `patterns` configuration, which +is a list of strings. For each cell, this preprocessor checks whether +the cell contents match any of the strings provided in `patterns`. +If the contents match any of the patterns, the cell is removed from the notebook. + +For example, execute the following command to convert a notebook to html +and remove cells containing only whitespace: + +.. code-block:: bash + + jupyter nbconvert --RegexRemovePreprocessor.patterns="['\s*\Z']" mynotebook.ipynb + +The command line argument sets the list of patterns to '\s*\Z' which matches +an arbitrary number of whitespace characters followed by the end of the string. + +See https://regex101.com/ for an interactive guide to regular expressions +(make sure to select the python flavor). See https://docs.python.org/library/re.html +for the official regular expression documentation in python. + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/_version.py new/nbconvert-5.6.1/nbconvert/_version.py --- old/nbconvert-5.6.0/nbconvert/_version.py 2019-08-09 05:55:35.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/_version.py 2019-10-25 02:35:53.000000000 +0200 @@ -1,4 +1,4 @@ -version_info = (5, 6, 0) +version_info = (5, 6, 1) pre_info = '' dev_info = '' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/exporters/templateexporter.py new/nbconvert-5.6.1/nbconvert/exporters/templateexporter.py --- old/nbconvert-5.6.0/nbconvert/exporters/templateexporter.py 2019-08-07 00:51:31.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/exporters/templateexporter.py 2019-10-25 02:34:40.000000000 +0200 @@ -257,7 +257,7 @@ extra_loaders : list[of Jinja Loaders] ordered list of Jinja loader to find templates. Will be tried in order before the default FileSystem ones. - template : str (optional, kw arg) + template_file : str (optional, kw arg) Template to use when exporting. """ super(TemplateExporter, self).__init__(config=config, **kw) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/filters/strings.py new/nbconvert-5.6.1/nbconvert/filters/strings.py --- old/nbconvert-5.6.0/nbconvert/filters/strings.py 2019-08-08 04:36:06.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/filters/strings.py 2019-10-25 02:34:40.000000000 +0200 @@ -44,10 +44,10 @@ def wrap_text(text, width=100): - """ + """ Intelligently wrap text. Wrap text without breaking words if possible. - + Parameters ---------- text : str @@ -64,7 +64,7 @@ def html2text(element): """extract inner text from html - + Analog of jQuery's $(element).text() """ if isinstance(element, py3compat.string_types): @@ -73,7 +73,7 @@ except Exception: # failed to parse, just return it unmodified return element - + text = element.text or "" for child in element: text += html2text(child) @@ -83,16 +83,17 @@ def _convert_header_id(header_contents): """Convert header contents to valid id value. Takes string as input, returns string. - + Note: this may be subject to change in the case of changes to how we wish to generate ids. For use on markdown headings. """ return header_contents.replace(' ', '-') + def add_anchor(html, anchor_link_text=u'¶'): """Add an id and an anchor-link to an html header - + For use on markdown headings """ try: @@ -102,8 +103,13 @@ return html link = _convert_header_id(html2text(h)) h.set('id', link) - a = Element("a", {"class" : "anchor-link", "href" : "#" + link}) - a.text = anchor_link_text + a = Element("a", {"class": "anchor-link", "href": "#" + link}) + try: + # Test if the anchor link text is HTML (e.g. an image) + a.append(ElementTree.fromstring(anchor_link_text)) + except Exception: + # If we fail to parse, assume we've just got regular text + a.text = anchor_link_text h.append(a) # Known issue of Python3.x, ElementTree.tostring() returns a byte string @@ -121,11 +127,11 @@ new_code.append(cont + line) return '\n'.join(new_code) - + def strip_dollars(text): """ Remove all dollar symbols from text - + Parameters ---------- text : str @@ -142,7 +148,7 @@ """ Fix all fake URLs that start with `files/`, stripping out the `files/` prefix. Applies to both urls (for html) and relative paths (for markdown paths). - + Parameters ---------- text : str @@ -156,7 +162,7 @@ def comment_lines(text, prefix='# '): """ Build a Python comment line from input text. - + Parameters ---------- text : str @@ -164,18 +170,18 @@ prefix : str Character to append to the start of each line. """ - + #Replace line breaks with line breaks and comment symbols. #Also add a comment symbol at the beginning to comment out #the first line. - return prefix + ('\n'+prefix).join(text.split('\n')) + return prefix + ('\n'+prefix).join(text.split('\n')) def get_lines(text, start=None,end=None): """ - Split the input text into separate lines and then return the + Split the input text into separate lines and then return the lines that the caller is interested in. - + Parameters ---------- text : str @@ -185,10 +191,10 @@ end : int, optional Last line to grab from. """ - + # Split the input into lines. lines = text.split("\n") - + # Return the right lines. return "\n".join(lines[start:end]) #re-join @@ -215,7 +221,7 @@ def posix_path(path): """Turn a path into posix-style path/to/etc - + Mainly for use in latex on Windows, where native Windows paths are not allowed. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/preprocessors/regexremove.py new/nbconvert-5.6.1/nbconvert/preprocessors/regexremove.py --- old/nbconvert-5.6.0/nbconvert/preprocessors/regexremove.py 2019-04-30 05:01:41.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/preprocessors/regexremove.py 2019-10-25 02:34:40.000000000 +0200 @@ -40,8 +40,7 @@ def check_conditions(self, cell): """ - Checks that a cell matches the pattern and that (if a code cell) - it does not have any outputs. + Checks that a cell matches the pattern. Returns: Boolean. True means cell should *not* be removed. @@ -54,7 +53,7 @@ for pattern in self.patterns)) # Filter out cells that meet the pattern and have no outputs - return cell.get('outputs') or not pattern.match(cell.source) + return not pattern.match(cell.source) def preprocess(self, nb, resources): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/preprocessors/svg2pdf.py new/nbconvert-5.6.1/nbconvert/preprocessors/svg2pdf.py --- old/nbconvert-5.6.0/nbconvert/preprocessors/svg2pdf.py 2019-06-13 08:06:35.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/preprocessors/svg2pdf.py 2019-10-25 02:34:40.000000000 +0200 @@ -17,6 +17,12 @@ from .convertfigures import ConvertFiguresPreprocessor +if sys.version_info >= (3,3): + from shutil import which + get_inkscape_path = which('inkscape') +else: + get_inkscape_path = None + INKSCAPE_APP = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape' @@ -58,6 +64,8 @@ inkscape = Unicode(help="The path to Inkscape, if necessary").tag(config=True) @default('inkscape') def _inkscape_default(self): + if get_inkscape_path is not None: + return get_inkscape_path if sys.platform == "darwin": if os.path.isfile(INKSCAPE_APP): return INKSCAPE_APP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/preprocessors/tagremove.py new/nbconvert-5.6.1/nbconvert/preprocessors/tagremove.py --- old/nbconvert-5.6.0/nbconvert/preprocessors/tagremove.py 2019-04-30 05:01:41.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/preprocessors/tagremove.py 2019-10-25 02:34:40.000000000 +0200 @@ -12,16 +12,25 @@ class TagRemovePreprocessor(ClearOutputPreprocessor): """ - Removes cells from a notebook that have tags that designate they are to be - removed prior to exporting the notebook. + Removes inputs, outputs, or cells from a notebook that + have tags that designate they are to be removed prior to exporting + the notebook. - Traitlets: - ---------- - remove_cell_tags: removes cells tagged with these values - remove_all_output_tags: removes entire output areas on cells - tagged with these values - remove_single_output_tags: removes individual output objects on - outputs tagged with these values + Traitlets + --------- + remove_cell_tags + removes cells tagged with these values + + remove_all_outputs_tags + removes entire output areas on cells + tagged with these values + + remove_single_output_tags + removes individual output objects on + outputs tagged with these values + + remove_input_tags + removes inputs tagged with these values """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/preprocessors/tests/test_execute.py new/nbconvert-5.6.1/nbconvert/preprocessors/tests/test_execute.py --- old/nbconvert-5.6.0/nbconvert/preprocessors/tests/test_execute.py 2019-08-07 00:51:31.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/preprocessors/tests/test_execute.py 2019-10-25 02:34:40.000000000 +0200 @@ -266,7 +266,8 @@ input_nb, output_nb = run_notebook(input_file, opts, notebook_resources()) assert_notebooks_equal(input_nb, output_nb) - +@pytest.mark.skipif(not PY3, + reason = "Not tested for Python 2") def test_parallel_notebooks(capfd, tmpdir): """Two notebooks should be able to be run simultaneously without problems. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/preprocessors/tests/test_regexremove.py new/nbconvert-5.6.1/nbconvert/preprocessors/tests/test_regexremove.py --- old/nbconvert-5.6.0/nbconvert/preprocessors/tests/test_regexremove.py 2019-04-30 05:01:41.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/preprocessors/tests/test_regexremove.py 2019-10-25 02:34:40.000000000 +0200 @@ -69,24 +69,3 @@ for pattern in patterns: self.assertFalse(pattern.match(cell.source)) - def test_nosource_with_output(self): - """ - Test that the check_conditions returns true when given a code-cell - that has non-empty outputs but no source. - """ - - cell = { - 'cell_type': 'code', - 'execution_count': 2, - 'metadata': {}, - 'outputs': [{ - 'name': 'stdout', - 'output_type': 'stream', - 'text': 'I exist.\n' - }], - 'source': '' - } - preprocessor = self.build_preprocessor() - node = from_dict(cell) - assert preprocessor.check_conditions(node) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/templates/html/basic.tpl new/nbconvert-5.6.1/nbconvert/templates/html/basic.tpl --- old/nbconvert-5.6.0/nbconvert/templates/html/basic.tpl 2019-05-05 19:12:56.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/templates/html/basic.tpl 2019-10-25 02:34:40.000000000 +0200 @@ -1,8 +1,8 @@ {%- extends 'display_priority.tpl' -%} - +{% from 'celltags.tpl' import celltags %} {% block codecell %} -<div class="cell border-box-sizing code_cell rendered"> +<div class="cell border-box-sizing code_cell rendered{{ celltags(cell) }}"> {{ super() }} </div> {%- endblock codecell %} @@ -75,7 +75,7 @@ {% endblock output %} {% block markdowncell scoped %} -<div class="cell border-box-sizing text_cell rendered"> +<div class="cell border-box-sizing text_cell rendered{{ celltags(cell) }}"> {%- if resources.global_content_filter.include_input_prompt-%} {{ self.empty_in_prompt() }} {%- endif -%} @@ -155,6 +155,10 @@ {%- if output | get_metadata('unconfined', 'image/png') %} class="unconfined" {%- endif %} +{%- set alttext=(output | get_metadata('alt', 'image/png')) or (cell | get_metadata('alt')) -%} +{%- if alttext is not none %} +alt="{{ alttext }}" +{%- endif %}
</div> {%- endblock data_png %} @@ -177,6 +181,10 @@ {%- if output | get_metadata('unconfined', 'image/jpeg') %} class="unconfined" {%- endif %} +{%- set alttext=(output | get_metadata('alt', 'image/jpeg')) or (cell | get_metadata('alt')) -%} +{%- if alttext is not none %} +alt="{{ alttext }}" +{%- endif %}
</div> {%- endblock data_jpg %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/templates/html/celltags.tpl new/nbconvert-5.6.1/nbconvert/templates/html/celltags.tpl --- old/nbconvert-5.6.0/nbconvert/templates/html/celltags.tpl 1970-01-01 01:00:00.000000000 +0100 +++ new/nbconvert-5.6.1/nbconvert/templates/html/celltags.tpl 2019-10-25 02:34:40.000000000 +0200 @@ -0,0 +1,7 @@ +{%- macro celltags(cell) -%} + {% if cell.metadata.tags | length > 0 -%} + {% for tag in cell.metadata.tags -%} + {{ ' celltag_' ~ tag -}} + {%- endfor -%} + {%- endif %} +{%- endmacro %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/tests/files/notebook_tags.ipynb new/nbconvert-5.6.1/nbconvert/tests/files/notebook_tags.ipynb --- old/nbconvert-5.6.0/nbconvert/tests/files/notebook_tags.ipynb 1970-01-01 01:00:00.000000000 +0100 +++ new/nbconvert-5.6.1/nbconvert/tests/files/notebook_tags.ipynb 2019-10-25 02:34:40.000000000 +0200 @@ -0,0 +1,89 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "tags": [ + "mycelltag", + "mysecondcelltag" + ] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "this cell should have tags in html output\n" + ] + } + ], + "source": [ + "print(\"this cell should have tags in html output\")" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "this cell should NOT have tags in html output\n" + ] + } + ], + "source": [ + "print(\"this cell should NOT have tags in html output\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "tags": [ + "mymarkdowncelltag" + ] + }, + "source": [ + "This markdown cell should have tags in the html output" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This markdown cell should **not** have tags in the html output" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/nbconvert/tests/test_nbconvertapp.py new/nbconvert-5.6.1/nbconvert/tests/test_nbconvertapp.py --- old/nbconvert-5.6.0/nbconvert/tests/test_nbconvertapp.py 2019-06-09 22:03:31.000000000 +0200 +++ new/nbconvert-5.6.1/nbconvert/tests/test_nbconvertapp.py 2019-10-25 02:34:40.000000000 +0200 @@ -318,6 +318,21 @@ text2 = f.read() assert "In [" in text2 assert "Out[" in text2 + + def test_cell_tag_output(self): + """ + Verify that the html has tags in cell attributes if they exist. + """ + with self.create_temp_cwd(["notebook_tags.ipynb"]): + self.nbconvert('notebook_tags.ipynb --log-level 0 --to html') + assert os.path.isfile('notebook_tags.html') + with open("notebook_tags.html",'r') as f: + text = f.read() + assert 'code_cell rendered celltag_mycelltag celltag_mysecondcelltag">' in text + assert 'code_cell rendered">' in text + assert 'text_cell rendered celltag_mymarkdowncelltag">' in text + assert 'text_cell rendered">' in text + def test_no_input(self): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbconvert-5.6.0/setup.cfg new/nbconvert-5.6.1/setup.cfg --- old/nbconvert-5.6.0/setup.cfg 2019-04-30 05:01:41.000000000 +0200 +++ new/nbconvert-5.6.1/setup.cfg 2019-10-25 02:34:40.000000000 +0200 @@ -7,3 +7,4 @@ [check-manifest] ignore = nbconvert/resources/style.min.css + .circleci* ++++++ nbconvert.pdf ++++++ (binary differes) ++++++ nbconvert.zip ++++++ Binary files /var/tmp/diff_new_pack.GR8njy/_old and /var/tmp/diff_new_pack.GR8njy/_new differ
participants (1)
-
root