summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-06-10 07:57:50 +0200
committerMichał Górny <mgorny@gentoo.org>2020-06-10 07:57:50 +0200
commitf98144fc46bc93d25acb728dfc2c91fad61b7382 (patch)
tree790c5d45aa4e8b3373d448730d67460e677fded8 /dev-python/nbconvert
parentdev-python/nbconvert: Add missing test deps (diff)
downloadgentoo-f98144fc46bc93d25acb728dfc2c91fad61b7382.tar.gz
gentoo-f98144fc46bc93d25acb728dfc2c91fad61b7382.tar.bz2
gentoo-f98144fc46bc93d25acb728dfc2c91fad61b7382.zip
dev-python/nbconvert: Backport inkscape-1+ fix
Thanks to sam_c for finding out. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/nbconvert')
-rw-r--r--dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch40
-rw-r--r--dev-python/nbconvert/nbconvert-5.6.1.ebuild4
2 files changed, 44 insertions, 0 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
new file mode 100644
index 000000000000..06e8d06c935f
--- /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?= <miro@hroncok.cz>
+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 64b91a7af873..c2041fa935cc 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