[gentoo-commits] repo/gentoo:master commit in: dev-python/nbconvert/files/
commit: 5cc1b10a626073823136d7ebf6a0aa760ea6bdcd Author: Michael Mair-Keimberger levelnine at> AuthorDate: Tue Nov 8 06:20:14 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue Nov 8 08:52:39 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cc1b10a dev-python/nbconvert: remove unused patch(es) Signed-off-by: Michael Mair-Keimberger levelnine.at> Closes: https://github.com/gentoo/gentoo/pull/28183 Signed-off-by: Andrew Ammerlaan gentoo.org> .../files/nbconvert-6.5.0-mistune-2.patch | 339 - 1 file changed, 339 deletions(-) diff --git a/dev-python/nbconvert/files/nbconvert-6.5.0-mistune-2.patch b/dev-python/nbconvert/files/nbconvert-6.5.0-mistune-2.patch deleted file mode 100644 index 4a3f4731b32d.. --- a/dev-python/nbconvert/files/nbconvert-6.5.0-mistune-2.patch +++ /dev/null @@ -1,339 +0,0 @@ -From 6e5ba41803cc8c3192f001b3ede9b74454220bda Mon Sep 17 00:00:00 2001 -From: Tiago de Paula -Date: Mon, 9 May 2022 09:39:31 -0300 -Subject: [PATCH] Update to Mistune 2.0.2 (#1764) - -Co-authored-by: Steven Silvester - nbconvert/filters/markdown_mistune.py | 212 ++ - setup.py | 2 +- - 2 files changed, 119 insertions(+), 95 deletions(-) - -diff --git a/nbconvert/filters/markdown_mistune.py b/nbconvert/filters/markdown_mistune.py -index 382a5388..636e1e8c 100644 a/nbconvert/filters/markdown_mistune.py -+++ b/nbconvert/filters/markdown_mistune.py -@@ -21,7 +21,7 @@ except ImportError: - from cgi import escape as html_escape - - import bs4 --import mistune -+from mistune import BlockParser, HTMLRenderer, InlineParser, Markdown - from pygments import highlight - from pygments.formatters import HtmlFormatter - from pygments.lexers import get_lexer_by_name -@@ -34,158 +34,183 @@ class InvalidNotebook(Exception): - pass - - --class MathBlockGrammar(mistune.BlockGrammar): --"""This defines a single regex comprised of the different patterns that --identify math content spanning multiple lines. These are used by the --MathBlockLexer. -+class MathBlockParser(BlockParser): -+"""This acts as a pass-through to the MathInlineParser. It is needed in -+order to avoid other block level rules splitting math sections apart. - """ - --multi_math_str = "|".join( --[r"^\$\$.*?\$\$", r"^\[.*?\]", r"^\\begin\{([a-z]*\*?)\}(.*?)\\end\{\1\}"] -+MULTILINE_MATH = re.compile( -+r"(?=2.0.0`, where the pattern is passed -+to the undocumented `re.Scanner`. - """ -- --inline_math = re.compile(r"^\$(.+?)\$|^\((.+?)\)", re.DOTALL) --block_math = re.compile(r"^\$\$(.*?)\$\$|^\[(.*?)\]", re.DOTALL) --latex_environment = re.compile(r"^\\begin\{([a-z]*\*?)\}(.*?)\\end\{\1\}", re.DOTALL) --text = re.compile(r"^[\s\S]+?(?=[\\%s\n" % mistune.escape(code) -+return super().block_code(code) - - formatter = HtmlFormatter() - return highlight(code, lexer, formatter) - - def block_html(self, html): --embed_images = self.options.get("embed_images", False) -- --if embed_images: -+if self.embed_images: - html = self._html_embed_images(html) - - return super().block_html(html) - - def inline_html(self, html): --embed_images = self.options.get("embed_images", False) -- --if embed_images: -+if self.embed_images: - html = self._html_embed_images(html) - - return super().inline_html(html) - --def header(self, text, level, raw=None): --html = super().header(text, level, raw=raw) --if self.options.get("exclude_anchor_links"): -+def heading(self, text, level): -+html = super().heading(text, level) -+if self.exclude_anchor_links: - return html --anchor_link_text = self.options.get("anchor_link_text", "¶") --return add_anchor(html, anchor_link_text=anchor_link_text) -+return add_anchor(html, anchor_link_text=self.anchor_link_text) - - def escape_html(self, text): - return html_escape(text) - -+def multiline_math(self, text): -+return text -+ - def block_math(self, text): --return "$$%s$$" % self.escape_html(text) -+return f"$${self.escape_html(text)}$$" - - def latex_environment(self, name, text): --name = self.escape_html(name) --text = self.escape_html(text) --return rf"\begin{{{name}}}{text}\end{{{name}}}" -+name, text = self.escape_html(name), self.escape_html(text) -+return f"\\begin{{{name}}}{text}\\end{{{name}}}" - - def inline_math(self, text): --return "$%s$" % self.escape_html(text) -+return f"${self.escape_html(text)}$" - --def image(self, src, title, text): -+def image(self, src, text, title): - """Rendering a image with title and text. - - :param
[gentoo-commits] repo/gentoo:master commit in: dev-python/nbconvert/files/, dev-python/nbconvert/
commit: fc7b6914b0aa80f0cb13a256a25936702a245813 Author: Michał Górny gentoo org> AuthorDate: Tue Jan 5 23:24:51 2021 + Commit: Michał Górny gentoo org> CommitDate: Tue Jan 5 23:26:40 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc7b6914 dev-python/nbconvert: Remove old Signed-off-by: Michał Górny gentoo.org> dev-python/nbconvert/Manifest | 1 - .../files/nbconvert-5.6.1-inkscape-1.patch | 159 - .../nbconvert/files/nbconvert-5.6.1-py39.patch | 27 dev-python/nbconvert/nbconvert-5.6.1.ebuild| 70 - 4 files changed, 257 deletions(-) diff --git a/dev-python/nbconvert/Manifest b/dev-python/nbconvert/Manifest index 5c7f2522953..88f54fefe08 100644 --- a/dev-python/nbconvert/Manifest +++ b/dev-python/nbconvert/Manifest @@ -1,2 +1 @@ -DIST nbconvert-5.6.1.tar.gz 703233 BLAKE2B e75d558aee6c66fe8e7455ecf22dbbcd2a0698380ffec80eff15aea6c70bc853daa9ab2fd1d114453bd5dfe7e75617afb9f5c1075704bfadbb59fef34bca88a9 SHA512 0c68adcb9f28ead9ec058fc2e02a9a1e6f65818709c99f7a006a59a7562b5f5ee74afe5287e41568c35542898dc1b43c4543d2386cc05a721b3f99d5cc789435 DIST nbconvert-6.0.7.tar.gz 896833 BLAKE2B 1b5b39144509aa9f61dc1e9675b112d69ed2e2f9859f3ce7ccfac517d89fff0010062c03ded1c3db571c84dd8d4f8ba12e4851245f370d2e671d24921dd50ab6 SHA512 3c78fa4d777a79a08606a39bb31f6b329dc9d28c1ef2ea9f3253746dce853a295e8fe85b14c65b04762aa5acd5facc879232a375875a2ca6dc9477cc1ab88786 diff --git a/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch b/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch deleted file mode 100644 index 1f997a3c3a3..000 --- a/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch +++ /dev/null @@ -1,159 +0,0 @@ -diff --git a/nbconvert/preprocessors/svg2pdf.py b/nbconvert/preprocessors/svg2pdf.py -index aff14d9f..de51f3b8 100644 a/nbconvert/preprocessors/svg2pdf.py -+++ b/nbconvert/preprocessors/svg2pdf.py -@@ -1,4 +1,4 @@ --"""Module containing a preprocessor that converts outputs in the notebook from -+"""Module containing a preprocessor that converts outputs in the notebook from - one format to another. - """ - -@@ -17,11 +17,7 @@ from traitlets import Unicode, default - - from .convertfigures import ConvertFiguresPreprocessor - --if sys.version_info >= (3,3): --from shutil import which --get_inkscape_path = which('inkscape') --else: --get_inkscape_path = None -+from shutil import which - - - INKSCAPE_APP = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape' -@@ -46,26 +42,49 @@ class SVG2PDFPreprocessor(ConvertFiguresPreprocessor): - def _to_format_default(self): - return 'application/pdf' - -+inkscape_version = Unicode( -+help="""The version of inkscpae being used. -+ -+This affects how the conversion command is run. -+""" -+).tag(config=True) -+ -+@default('inkscape_version') -+def _inkscape_version_default(self): -+p = subprocess.Popen([self.inkscape, '--version'], -+stdout=subprocess.PIPE, -+stderr=subprocess.PIPE) -+output, _ = p.communicate() -+if p.returncode != 0: -+raise RuntimeError("Unable to find inkscape executable --version") -+return output.decode('utf-8').split(' ')[1] -+ - command = Unicode( - help="""The command to use for converting SVG to PDF -- -+ - This string is a template, which will be formatted with the keys - to_filename and from_filename. -- -+ - The conversion call must read the SVG from {from_filename}, - and write a PDF to {to_filename}. - """).tag(config=True) - - @default('command') - def _command_default(self): --return self.inkscape + \ -- ' --without-gui --export-pdf="{to_filename}" "{from_filename}"' -- -+major_verison = self.inkscape_version.split('.')[0] -+export_option = ' --export-filename' if int(major_verison) > 0 else ' --export-pdf' -+gui_option = '' if int(major_verison) > 0 else ' --without-gui' -+ -+return '{inkscape}{gui_option}{export_option}='.format( -+inkscape=self.inkscape, export_option=export_option, gui_option=gui_option -+) + '"{to_filename}" "{from_filename}"' -+ - 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 -+inkscape_path = which('inkscape') -+if inkscape_path is not None: -+return inkscape_path - if sys.platform == "darwin": - if os.path.isfile(INKSCAPE_APP): - return INKSCAPE_APP -@@ -85,22 +104,22 @@ class SVG2PDFPreprocessor(ConvertFiguresPreprocessor): - Convert a single SVG figure to PDF. Returns converted data. - """ - -
[gentoo-commits] repo/gentoo:master commit in: dev-python/nbconvert/files/
commit: 0df2a7212f237067ba7cb8dd8df8489fe51060ba Author: Michał Górny gentoo org> AuthorDate: Wed Jun 10 06:35:06 2020 + Commit: Michał Górny gentoo org> CommitDate: Wed Jun 10 06:42:45 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0df2a721 dev-python/nbconvert: Fix inkscape patch Signed-off-by: Michał Górny gentoo.org> .../files/nbconvert-5.6.1-inkscape-1.patch | 169 ++--- 1 file changed, 144 insertions(+), 25 deletions(-) diff --git a/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch b/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch index 06e8d06c935..1f997a3c3a3 100644 --- a/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch +++ b/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch @@ -1,40 +1,159 @@ -From 61757ce936ab37855a5289d31ef59ef898061bcf Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Sun, 3 May 2020 15:41:07 +0200 -Subject: [PATCH] Fix CLI options given to Inkscape 1.0rc1+ - -Fixes https://github.com/jupyter/nbconvert/issues/1246 - nbconvert/preprocessors/svg2pdf.py| 7 --- - nbconvert/preprocessors/tests/test_svg2pdf.py | 2 +- - 2 files changed, 5 insertions(+), 4 deletions(-) - diff --git a/nbconvert/preprocessors/svg2pdf.py b/nbconvert/preprocessors/svg2pdf.py -index d4c48af6..af6a7dea 100644 +index aff14d9f..de51f3b8 100644 --- a/nbconvert/preprocessors/svg2pdf.py +++ b/nbconvert/preprocessors/svg2pdf.py -@@ -76,10 +76,11 @@ def _inkscape_version_default(self): +@@ -1,4 +1,4 @@ +-"""Module containing a preprocessor that converts outputs in the notebook from ++"""Module containing a preprocessor that converts outputs in the notebook from + one format to another. + """ + +@@ -17,11 +17,7 @@ from traitlets import Unicode, default + + from .convertfigures import ConvertFiguresPreprocessor + +-if sys.version_info >= (3,3): +-from shutil import which +-get_inkscape_path = which('inkscape') +-else: +-get_inkscape_path = None ++from shutil import which + + + INKSCAPE_APP = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape' +@@ -46,26 +42,49 @@ class SVG2PDFPreprocessor(ConvertFiguresPreprocessor): + def _to_format_default(self): + return 'application/pdf' + ++inkscape_version = Unicode( ++help="""The version of inkscpae being used. ++ ++This affects how the conversion command is run. ++""" ++).tag(config=True) ++ ++@default('inkscape_version') ++def _inkscape_version_default(self): ++p = subprocess.Popen([self.inkscape, '--version'], ++stdout=subprocess.PIPE, ++stderr=subprocess.PIPE) ++output, _ = p.communicate() ++if p.returncode != 0: ++raise RuntimeError("Unable to find inkscape executable --version") ++return output.decode('utf-8').split(' ')[1] ++ + command = Unicode( + help="""The command to use for converting SVG to PDF +- ++ + This string is a template, which will be formatted with the keys + to_filename and from_filename. +- ++ + The conversion call must read the SVG from {from_filename}, + and write a PDF to {to_filename}. + """).tag(config=True) + @default('command') def _command_default(self): - major_verison = self.inkscape_version.split('.')[0] --export_option = '--export-file' if int(major_verison) > 0 else '--export-pdf' +-return self.inkscape + \ +- ' --without-gui --export-pdf="{to_filename}" "{from_filename}"' +- ++major_verison = self.inkscape_version.split('.')[0] +export_option = ' --export-filename' if int(major_verison) > 0 else ' --export-pdf' +gui_option = '' if int(major_verison) > 0 else ' --without-gui' - --return '{inkscape} --without-gui {export_option}='.format( --inkscape=self.inkscape, export_option=export_option ++ +return '{inkscape}{gui_option}{export_option}='.format( +inkscape=self.inkscape, export_option=export_option, gui_option=gui_option - ) + '"{to_filename}" "{from_filename}"' - ++) + '"{to_filename}" "{from_filename}"' ++ 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 ++inkscape_path = which('inkscape') ++if inkscape_path is not None: ++return inkscape_path + if sys.platform == "darwin": + if os.path.isfile(INKSCAPE_APP): + return INKSCAPE_APP +@@ -85,22 +104,22 @@ class SVG2PDFPreprocessor(ConvertFiguresPreprocessor): + Convert a single SVG figure to PDF. Returns converted data. + """ + +-#Work in a temporary directory ++# Work in a temporary directory
[gentoo-commits] repo/gentoo:master commit in: dev-python/nbconvert/files/, dev-python/nbconvert/
commit: f98144fc46bc93d25acb728dfc2c91fad61b7382 Author: Michał Górny gentoo org> AuthorDate: Wed Jun 10 05:57:50 2020 + Commit: Michał Górny gentoo org> CommitDate: Wed Jun 10 05:57:50 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f98144fc dev-python/nbconvert: Backport inkscape-1+ fix Thanks to sam_c for finding out. Signed-off-by: Michał Górny gentoo.org> .../files/nbconvert-5.6.1-inkscape-1.patch | 40 ++ dev-python/nbconvert/nbconvert-5.6.1.ebuild| 4 +++ 2 files changed, 44 insertions(+) diff --git a/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch b/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch new file mode 100644 index 000..06e8d06c935 --- /dev/null +++ b/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch @@ -0,0 +1,40 @@ +From 61757ce936ab37855a5289d31ef59ef898061bcf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Sun, 3 May 2020 15:41:07 +0200 +Subject: [PATCH] Fix CLI options given to Inkscape 1.0rc1+ + +Fixes https://github.com/jupyter/nbconvert/issues/1246 +--- + nbconvert/preprocessors/svg2pdf.py| 7 --- + nbconvert/preprocessors/tests/test_svg2pdf.py | 2 +- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/nbconvert/preprocessors/svg2pdf.py b/nbconvert/preprocessors/svg2pdf.py +index d4c48af6..af6a7dea 100644 +--- a/nbconvert/preprocessors/svg2pdf.py b/nbconvert/preprocessors/svg2pdf.py +@@ -76,10 +76,11 @@ def _inkscape_version_default(self): + @default('command') + def _command_default(self): + major_verison = self.inkscape_version.split('.')[0] +-export_option = '--export-file' if int(major_verison) > 0 else '--export-pdf' ++export_option = ' --export-filename' if int(major_verison) > 0 else ' --export-pdf' ++gui_option = '' if int(major_verison) > 0 else ' --without-gui' + +-return '{inkscape} --without-gui {export_option}='.format( +-inkscape=self.inkscape, export_option=export_option ++return '{inkscape}{gui_option}{export_option}='.format( ++inkscape=self.inkscape, export_option=export_option, gui_option=gui_option + ) + '"{to_filename}" "{from_filename}"' + + inkscape = Unicode(help="The path to Inkscape, if necessary").tag(config=True) +diff --git a/nbconvert/preprocessors/tests/test_svg2pdf.py b/nbconvert/preprocessors/tests/test_svg2pdf.py +index 5e13b282..d9ccec8c 100644 +--- a/nbconvert/preprocessors/tests/test_svg2pdf.py b/nbconvert/preprocessors/tests/test_svg2pdf.py +@@ -91,4 +91,4 @@ def test_inkscape_pre_v1_command(self): + + def test_inkscape_v1_command(self): + preprocessor = self.build_preprocessor(inkscape='fake-inkscape', inkscape_version='1.0beta2') +-self.assertEquals(preprocessor.command, 'fake-inkscape --without-gui --export-file="{to_filename}" "{from_filename}"') ++self.assertEquals(preprocessor.command, 'fake-inkscape --export-filename="{to_filename}" "{from_filename}"') diff --git a/dev-python/nbconvert/nbconvert-5.6.1.ebuild b/dev-python/nbconvert/nbconvert-5.6.1.ebuild index 64b91a7af87..c2041fa935c 100644 --- a/dev-python/nbconvert/nbconvert-5.6.1.ebuild +++ b/dev-python/nbconvert/nbconvert-5.6.1.ebuild @@ -44,6 +44,10 @@ distutils_enable_sphinx docs \ dev-python/{ipython,jupyter_client,nbsphinx,sphinx_rtd_theme} distutils_enable_tests pytest +PATCHES=( + "${FILESDIR}"/${P}-inkscape-1.patch +) + python_test() { distutils_install_for_testing bdist_egg cd "${TEST_DIR}"/lib || die