Hello community,

here is the log from the commit of package 
python-sphinxcontrib-svg2pdfconverter for openSUSE:Factory checked in at 
2020-07-29 17:19:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sphinxcontrib-svg2pdfconverter (Old)
 and      
/work/SRC/openSUSE:Factory/.python-sphinxcontrib-svg2pdfconverter.new.3592 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-sphinxcontrib-svg2pdfconverter"

Wed Jul 29 17:19:50 2020 rev:3 rq:823192 version:1.1.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-sphinxcontrib-svg2pdfconverter/python-sphinxcontrib-svg2pdfconverter.changes
      2019-09-17 13:39:11.321825835 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-sphinxcontrib-svg2pdfconverter.new.3592/python-sphinxcontrib-svg2pdfconverter.changes
    2020-07-29 17:20:59.748585995 +0200
@@ -1,0 +2,6 @@
+Tue Jul 28 09:12:16 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- Update to 1.1.0
+  * Add CairoSVG converter
+
+-------------------------------------------------------------------

Old:
----
  sphinxcontrib-svg2pdfconverter-1.0.1.tar.gz

New:
----
  sphinxcontrib-svg2pdfconverter-1.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-sphinxcontrib-svg2pdfconverter.spec ++++++
--- /var/tmp/diff_new_pack.bL1hre/_old  2020-07-29 17:21:02.152588063 +0200
+++ /var/tmp/diff_new_pack.bL1hre/_new  2020-07-29 17:21:02.156588066 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-sphinxcontrib-svg2pdfconverter
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-sphinxcontrib-svg2pdfconverter
-Version:        1.0.1
+Version:        1.1.0
 Release:        0
 Summary:        Sphinx SVG to PDF converter extension
 License:        BSD-2-Clause
@@ -31,6 +31,7 @@
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-Sphinx >= 1.6.3
+Recommends:     python-CairoSVG >= 1.0
 BuildArch:      noarch
 %python_subpackages
 

++++++ sphinxcontrib-svg2pdfconverter-1.0.1.tar.gz -> 
sphinxcontrib-svg2pdfconverter-1.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxcontrib-svg2pdfconverter-1.0.1/PKG-INFO 
new/sphinxcontrib-svg2pdfconverter-1.1.0/PKG-INFO
--- old/sphinxcontrib-svg2pdfconverter-1.0.1/PKG-INFO   2019-09-13 
15:42:12.000000000 +0200
+++ new/sphinxcontrib-svg2pdfconverter-1.1.0/PKG-INFO   2020-06-17 
14:55:34.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: sphinxcontrib-svg2pdfconverter
-Version: 1.0.1
+Version: 1.1.0
 Summary: Sphinx SVG to PDF converter extension
 Home-page: 
https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter
 Author: Stefan Wiehler
@@ -14,9 +14,10 @@
         This extension converts SVG images to PDF in case the builder does not 
support
         SVG images natively (e.g. LaTeX).
         
-        Internally, either `Inkscape <https://inkscape.org/>`_ or 
``rsvg-convert`` from
-        `libRSVG <https://wiki.gnome.org/Projects/LibRsvg>`_ as a more 
lightweight
-        alternative is used to convert images.
+        Internally, either `Inkscape <https://inkscape.org/>`_, 
``rsvg-convert``
+        from `libRSVG <https://wiki.gnome.org/Projects/LibRsvg>`_ or `CairoSVG
+        <https://cairosvg.org/>`_ as progressively more lightweight 
alternatives
+        are used to convert images.
         
         
         Installation
@@ -28,14 +29,24 @@
         
            $ pip install sphinxcontrib-svg2pdfconverter
         
-        You can choose between Inkscape and libRSVG by either adding
-        ``sphinxcontrib.inkscapeconverter`` or ``sphinxcontrib.rsvgconverter`` 
to the
-        ``extensions`` list in your ``conf.py``.
+        You can choose between Inkscape, libRSVG and CairoSVG by adding
+        ``sphinxcontrib.inkscapeconverter``, ``sphinxcontrib.rsvgconverter`` or
+        ``sphinxcontrib.cairosvgconverter`` to the ``extensions`` list in your
+        ``conf.py``.
         
         Make sure to have either ``inkscape`` or the ``rsvg-convert`` command 
available
         in your systems ``PATH`` and, if necessary, adapt the
         ``inkscape_converter_bin`` or ``rsvg_converter_bin`` config value 
respectively.
         
+        CairoSVG requires additional dependencies to be installed with:
+        
+        .. code-block:: console
+        
+           $ pip install sphinxcontrib-svg2pdfconverter[CairoSVG]
+        
+        CairoSVG and its dependencies may require additional tools during the
+        installation depending on the OS you are using; see the `CairoSVG 
documentation
+        <https://cairosvg.org/documentation/#installation>`_ for further 
details.
         
         Configuration
         =============
@@ -60,6 +71,11 @@
             Additional command-line arguments for the RSVG converter, as a 
list. By
             default, this is the emtpy list ``[]``.
         
+        CairoSVG
+        --------
+        
+        No configuration is required.
+        
 Platform: any
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
@@ -73,3 +89,4 @@
 Classifier: Topic :: Utilities
 Requires-Python: ~=3.4
 Description-Content-Type: text/x-rst
+Provides-Extra: CairoSVG
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxcontrib-svg2pdfconverter-1.0.1/README.rst 
new/sphinxcontrib-svg2pdfconverter-1.1.0/README.rst
--- old/sphinxcontrib-svg2pdfconverter-1.0.1/README.rst 2019-08-26 
09:10:10.000000000 +0200
+++ new/sphinxcontrib-svg2pdfconverter-1.1.0/README.rst 2020-05-29 
13:50:34.000000000 +0200
@@ -5,9 +5,10 @@
 This extension converts SVG images to PDF in case the builder does not support
 SVG images natively (e.g. LaTeX).
 
-Internally, either `Inkscape <https://inkscape.org/>`_ or ``rsvg-convert`` from
-`libRSVG <https://wiki.gnome.org/Projects/LibRsvg>`_ as a more lightweight
-alternative is used to convert images.
+Internally, either `Inkscape <https://inkscape.org/>`_, ``rsvg-convert``
+from `libRSVG <https://wiki.gnome.org/Projects/LibRsvg>`_ or `CairoSVG
+<https://cairosvg.org/>`_ as progressively more lightweight alternatives
+are used to convert images.
 
 
 Installation
@@ -19,14 +20,24 @@
 
    $ pip install sphinxcontrib-svg2pdfconverter
 
-You can choose between Inkscape and libRSVG by either adding
-``sphinxcontrib.inkscapeconverter`` or ``sphinxcontrib.rsvgconverter`` to the
-``extensions`` list in your ``conf.py``.
+You can choose between Inkscape, libRSVG and CairoSVG by adding
+``sphinxcontrib.inkscapeconverter``, ``sphinxcontrib.rsvgconverter`` or
+``sphinxcontrib.cairosvgconverter`` to the ``extensions`` list in your
+``conf.py``.
 
 Make sure to have either ``inkscape`` or the ``rsvg-convert`` command available
 in your systems ``PATH`` and, if necessary, adapt the
 ``inkscape_converter_bin`` or ``rsvg_converter_bin`` config value respectively.
 
+CairoSVG requires additional dependencies to be installed with:
+
+.. code-block:: console
+
+   $ pip install sphinxcontrib-svg2pdfconverter[CairoSVG]
+
+CairoSVG and its dependencies may require additional tools during the
+installation depending on the OS you are using; see the `CairoSVG documentation
+<https://cairosvg.org/documentation/#installation>`_ for further details.
 
 Configuration
 =============
@@ -50,3 +61,8 @@
 ``rsvg_converter_args``
     Additional command-line arguments for the RSVG converter, as a list. By
     default, this is the emtpy list ``[]``.
+
+CairoSVG
+--------
+
+No configuration is required.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxcontrib-svg2pdfconverter-1.0.1/setup.py 
new/sphinxcontrib-svg2pdfconverter-1.1.0/setup.py
--- old/sphinxcontrib-svg2pdfconverter-1.0.1/setup.py   2019-09-13 
15:41:13.000000000 +0200
+++ new/sphinxcontrib-svg2pdfconverter-1.1.0/setup.py   2020-06-17 
14:43:12.000000000 +0200
@@ -13,7 +13,7 @@
 
 setup(
     name='sphinxcontrib-svg2pdfconverter',
-    version='1.0.1',
+    version='1.1.0',
     
url='https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter',
     download_url='https://pypi.org/project/sphinxcontrib-svg2pdfconverter',
     license='BSD',
@@ -39,6 +39,9 @@
     packages=find_packages(),
     include_package_data=True,
     install_requires=requires,
+    extras_require={
+        "CairoSVG": ['cairosvg>=1.0'],
+    },
     python_requires='~=3.4',
     namespace_packages=['sphinxcontrib'],
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib/cairosvgconverter.py 
new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib/cairosvgconverter.py
--- old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib/cairosvgconverter.py 
1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib/cairosvgconverter.py 
2020-05-29 13:50:34.000000000 +0200
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+"""
+    sphinxcontrib.cairosvgconverter
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    Converts SVG images to PDF using CairoSVG in case the builder does not
+    support SVG images natively (e.g. LaTeX).
+
+    See <https://cairosvg.org/>.
+
+    :copyright: Copyright 2018-2020 by Stefan Wiehler
+                <[email protected]> and
+                Copyright 2020 by Marko Kohtala
+                <[email protected]>.
+    :license: BSD, see LICENSE.txt for details.
+"""
+
+from sphinx.errors import ExtensionError
+from sphinx.locale import __
+from sphinx.transforms.post_transforms.images import ImageConverter
+from sphinx.util import logging
+from urllib.error import URLError
+
+if False:
+    # For type annotation
+    from typing import Any, Dict  # NOQA
+    from sphinx.application import Sphinx  # NOQA
+
+
+logger = logging.getLogger(__name__)
+
+
+class CairoSVGConverter(ImageConverter):
+    conversion_rules = [
+        ('image/svg+xml', 'application/pdf'),
+    ]
+
+    def is_available(self):
+        # type: () -> bool
+        """Confirms if CairoSVG package is available or not."""
+        try:
+            import cairosvg  # noqa: F401
+            return True
+        except ImportError:
+            logger.warning(__('CairoSVG package cannot be imported. '
+                              'Check if CairoSVG has been installed properly'))
+            return False
+
+    def convert(self, _from, _to):
+        # type: (unicode, unicode) -> bool
+        """Converts the image from SVG to PDF via CairoSVG."""
+        import cairosvg
+        try:
+            cairosvg.svg2pdf(url=_from, write_to=_to)
+        except (OSError, URLError) as err:
+            raise ExtensionError(__('CairoSVG converter failed with reason: '
+                                    '%s') % err.reason)
+
+        return True
+
+
+def setup(app):
+    # type: (Sphinx) -> Dict[unicode, Any]
+    app.add_post_transform(CairoSVGConverter)
+
+    return {
+        'version': 'builtin',
+        'parallel_read_safe': True,
+        'parallel_write_safe': True,
+    }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib/inkscapeconverter.py 
new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib/inkscapeconverter.py
--- old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib/inkscapeconverter.py 
2019-09-13 10:36:32.000000000 +0200
+++ new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib/inkscapeconverter.py 
2020-05-29 13:46:21.000000000 +0200
@@ -6,10 +6,11 @@
     Converts SVG images to PDF using Inkscape in case the builder does not
     support SVG images natively (e.g. LaTeX).
 
-    :copyright: Copyright 2018-2019 by Stefan Wiehler
+    :copyright: Copyright 2018-2020 by Stefan Wiehler
                 <[email protected]>.
     :license: BSD, see LICENSE.txt for details.
 """
+import re
 import subprocess
 
 from sphinx.errors import ExtensionError
@@ -38,11 +39,19 @@
         try:
             args = [self.config.inkscape_converter_bin, '--version']
             logger.debug('Invoking %r ...', args)
-            ret = subprocess.call(args, stdin=subprocess.PIPE, 
stdout=subprocess.PIPE)
-            if ret == 0:
-                return True
-            else:
+            output = subprocess.check_output(args, stdin=subprocess.PIPE,
+                    universal_newlines=True)
+            match = re.search('Inkscape (.+) \(.+, .+\)', output)
+            if not match:
+                logger.warning(__('Inkscape command %r returned invalid 
result: %s\n '
+                                  'Check the inkscape_converter_bin setting'),
+                               self.config.inkscape_converter_bin, output)
                 return False
+            self._inkscape_version = match.group(1)
+            logger.debug('Inkscape version: %s', self._inkscape_version)
+            return True
+        except subprocess.CalledProcessError:
+            return False
         except (OSError, IOError):
             logger.warning(__('Inkscape command %r cannot be run. '
                               'Check the inkscape_converter_bin setting'),
@@ -54,8 +63,11 @@
         """Converts the image from SVG to PDF via Inkscape."""
         try:
             args = ([self.config.inkscape_converter_bin] +
-                    self.config.inkscape_converter_args +
-                    ['--export-pdf=' + _to, _from])
+                    self.config.inkscape_converter_args)
+            if self._inkscape_version.startswith('1.'):
+                    args += ['--export-filename=' + _to, _from]
+            else:
+                    args += ['--export-pdf=' + _to, _from]
             logger.debug('Invoking %r ...', args)
             p = subprocess.Popen(args, stdin=subprocess.PIPE, 
stdout=subprocess.PIPE)
         except OSError as err:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib_svg2pdfconverter.egg-info/PKG-INFO
 
new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib_svg2pdfconverter.egg-info/PKG-INFO
--- 
old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib_svg2pdfconverter.egg-info/PKG-INFO
   2019-09-13 15:42:11.000000000 +0200
+++ 
new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib_svg2pdfconverter.egg-info/PKG-INFO
   2020-06-17 14:55:34.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: sphinxcontrib-svg2pdfconverter
-Version: 1.0.1
+Version: 1.1.0
 Summary: Sphinx SVG to PDF converter extension
 Home-page: 
https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter
 Author: Stefan Wiehler
@@ -14,9 +14,10 @@
         This extension converts SVG images to PDF in case the builder does not 
support
         SVG images natively (e.g. LaTeX).
         
-        Internally, either `Inkscape <https://inkscape.org/>`_ or 
``rsvg-convert`` from
-        `libRSVG <https://wiki.gnome.org/Projects/LibRsvg>`_ as a more 
lightweight
-        alternative is used to convert images.
+        Internally, either `Inkscape <https://inkscape.org/>`_, 
``rsvg-convert``
+        from `libRSVG <https://wiki.gnome.org/Projects/LibRsvg>`_ or `CairoSVG
+        <https://cairosvg.org/>`_ as progressively more lightweight 
alternatives
+        are used to convert images.
         
         
         Installation
@@ -28,14 +29,24 @@
         
            $ pip install sphinxcontrib-svg2pdfconverter
         
-        You can choose between Inkscape and libRSVG by either adding
-        ``sphinxcontrib.inkscapeconverter`` or ``sphinxcontrib.rsvgconverter`` 
to the
-        ``extensions`` list in your ``conf.py``.
+        You can choose between Inkscape, libRSVG and CairoSVG by adding
+        ``sphinxcontrib.inkscapeconverter``, ``sphinxcontrib.rsvgconverter`` or
+        ``sphinxcontrib.cairosvgconverter`` to the ``extensions`` list in your
+        ``conf.py``.
         
         Make sure to have either ``inkscape`` or the ``rsvg-convert`` command 
available
         in your systems ``PATH`` and, if necessary, adapt the
         ``inkscape_converter_bin`` or ``rsvg_converter_bin`` config value 
respectively.
         
+        CairoSVG requires additional dependencies to be installed with:
+        
+        .. code-block:: console
+        
+           $ pip install sphinxcontrib-svg2pdfconverter[CairoSVG]
+        
+        CairoSVG and its dependencies may require additional tools during the
+        installation depending on the OS you are using; see the `CairoSVG 
documentation
+        <https://cairosvg.org/documentation/#installation>`_ for further 
details.
         
         Configuration
         =============
@@ -60,6 +71,11 @@
             Additional command-line arguments for the RSVG converter, as a 
list. By
             default, this is the emtpy list ``[]``.
         
+        CairoSVG
+        --------
+        
+        No configuration is required.
+        
 Platform: any
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
@@ -73,3 +89,4 @@
 Classifier: Topic :: Utilities
 Requires-Python: ~=3.4
 Description-Content-Type: text/x-rst
+Provides-Extra: CairoSVG
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib_svg2pdfconverter.egg-info/SOURCES.txt
 
new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib_svg2pdfconverter.egg-info/SOURCES.txt
--- 
old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib_svg2pdfconverter.egg-info/SOURCES.txt
        2019-09-13 15:42:12.000000000 +0200
+++ 
new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib_svg2pdfconverter.egg-info/SOURCES.txt
        2020-06-17 14:55:34.000000000 +0200
@@ -4,6 +4,7 @@
 setup.cfg
 setup.py
 sphinxcontrib/__init__.py
+sphinxcontrib/cairosvgconverter.py
 sphinxcontrib/inkscapeconverter.py
 sphinxcontrib/rsvgconverter.py
 sphinxcontrib_svg2pdfconverter.egg-info/PKG-INFO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib_svg2pdfconverter.egg-info/requires.txt
 
new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib_svg2pdfconverter.egg-info/requires.txt
--- 
old/sphinxcontrib-svg2pdfconverter-1.0.1/sphinxcontrib_svg2pdfconverter.egg-info/requires.txt
       2019-09-13 15:42:11.000000000 +0200
+++ 
new/sphinxcontrib-svg2pdfconverter-1.1.0/sphinxcontrib_svg2pdfconverter.egg-info/requires.txt
       2020-06-17 14:55:34.000000000 +0200
@@ -1 +1,4 @@
 Sphinx>=1.6.3
+
+[CairoSVG]
+cairosvg>=1.0


Reply via email to