Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-svgpathtools for 
openSUSE:Factory checked in at 2023-05-21 19:09:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-svgpathtools (Old)
 and      /work/SRC/openSUSE:Factory/.python-svgpathtools.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-svgpathtools"

Sun May 21 19:09:04 2023 rev:7 rq:1088124 version:1.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-svgpathtools/python-svgpathtools.changes  
2023-02-21 15:36:47.340544566 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-svgpathtools.new.1533/python-svgpathtools.changes
        2023-05-21 19:09:50.122821137 +0200
@@ -1,0 +2,10 @@
+Sun May 21 12:16:43 UTC 2023 - Mia Herkt <[email protected]>
+
+- Update to 1.6.1
+  * Fix circles parsing to non-closed paths
+    #gh/mathandy/svgpathtools#198
+  * path.transform: Arc sweep is reversed by negative scale
+    #gh/mathandy/svgpathtools#200
+  * return error if Path.point() cannot be computed
+
+-------------------------------------------------------------------

Old:
----
  svgpathtools-1.6.0.tar.gz

New:
----
  svgpathtools-1.6.1.tar.gz

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

Other differences:
------------------
++++++ python-svgpathtools.spec ++++++
--- /var/tmp/diff_new_pack.bWX4GC/_old  2023-05-21 19:09:50.550823581 +0200
+++ /var/tmp/diff_new_pack.bWX4GC/_new  2023-05-21 19:09:50.554823604 +0200
@@ -16,10 +16,9 @@
 #
 
 
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %global skip_python36 1
 Name:           python-svgpathtools
-Version:        1.6.0
+Version:        1.6.1
 Release:        0
 Summary:        Tools for manipulating and analyzing SVG Path objects and 
Bézier curves
 License:        MIT
@@ -62,6 +61,6 @@
 %files %{python_files}
 %license LICENSE.txt LICENSE2.txt
 %doc README.md
-%{python_sitelib}/*
+%{python_sitelib}/svgpathtools*
 
 %changelog

++++++ svgpathtools-1.6.0.tar.gz -> svgpathtools-1.6.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/PKG-INFO 
new/svgpathtools-1.6.1/PKG-INFO
--- old/svgpathtools-1.6.0/PKG-INFO     2023-02-13 23:49:43.994840000 +0100
+++ new/svgpathtools-1.6.1/PKG-INFO     2023-05-20 20:35:44.937130500 +0200
@@ -1,9 +1,9 @@
 Metadata-Version: 2.1
 Name: svgpathtools
-Version: 1.6.0
+Version: 1.6.1
 Summary: A collection of tools for manipulating and analyzing SVG Path objects 
and Bezier curves.
 Home-page: https://github.com/mathandy/svgpathtools
-Download-URL: 
https://github.com/mathandy/svgpathtools/releases/download/1.6.0/svgpathtools-1.6.0-py2.py3-none-any.whl
+Download-URL: 
https://github.com/mathandy/svgpathtools/releases/download/1.6.1/svgpathtools-1.6.1-py2.py3-none-any.whl
 Author: Andy Port
 Author-email: [email protected]
 License: MIT
@@ -22,6 +22,7 @@
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
 Classifier: Topic :: Multimedia :: Graphics :: Editors :: Vector-Based
 Classifier: Topic :: Scientific/Engineering
 Classifier: Topic :: Scientific/Engineering :: Image Recognition
@@ -35,7 +36,6 @@
 
[![Donate](https://img.shields.io/badge/donate-paypal-brightgreen)](https://www.paypal.com/donate?business=4SKJ27AM4EYYA&amp;no_recurring=0&amp;item_name=Support+the+creator+of+svgpathtools?++He%27s+a+student+and+would+appreciate+it.&amp;currency_code=USD)
 ![Python](https://img.shields.io/pypi/pyversions/svgpathtools.svg)
 
[![PyPI](https://img.shields.io/pypi/v/svgpathtools)](https://pypi.org/project/svgpathtools/)
-![Build](https://img.shields.io/github/workflow/status/mathandy/svgpathtools/Github%20CI%20Unit%20Testing)
 [![PyPI - 
Downloads](https://img.shields.io/pypi/dm/svgpathtools?color=yellow)](https://pypistats.org/packages/svgpathtools)
 # svgpathtools
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/README.md 
new/svgpathtools-1.6.1/README.md
--- old/svgpathtools-1.6.0/README.md    2023-02-13 23:49:35.000000000 +0100
+++ new/svgpathtools-1.6.1/README.md    2023-05-20 20:35:36.000000000 +0200
@@ -1,7 +1,6 @@
 
[![Donate](https://img.shields.io/badge/donate-paypal-brightgreen)](https://www.paypal.com/donate?business=4SKJ27AM4EYYA&amp;no_recurring=0&amp;item_name=Support+the+creator+of+svgpathtools?++He%27s+a+student+and+would+appreciate+it.&amp;currency_code=USD)
 ![Python](https://img.shields.io/pypi/pyversions/svgpathtools.svg)
 
[![PyPI](https://img.shields.io/pypi/v/svgpathtools)](https://pypi.org/project/svgpathtools/)
-![Build](https://img.shields.io/github/workflow/status/mathandy/svgpathtools/Github%20CI%20Unit%20Testing)
 [![PyPI - 
Downloads](https://img.shields.io/pypi/dm/svgpathtools?color=yellow)](https://pypistats.org/packages/svgpathtools)
 # svgpathtools
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/setup.py 
new/svgpathtools-1.6.1/setup.py
--- old/svgpathtools-1.6.0/setup.py     2023-02-13 23:49:35.000000000 +0100
+++ new/svgpathtools-1.6.1/setup.py     2023-05-20 20:35:36.000000000 +0200
@@ -3,7 +3,7 @@
 import os
 
 
-VERSION = '1.6.0'
+VERSION = '1.6.1'
 AUTHOR_NAME = 'Andy Port'
 AUTHOR_EMAIL = '[email protected]'
 GITHUB = 'https://github.com/mathandy/svgpathtools'
@@ -47,6 +47,7 @@
             "Programming Language :: Python :: 3.8",
             "Programming Language :: Python :: 3.9",
             "Programming Language :: Python :: 3.10",
+            "Programming Language :: Python :: 3.11",
             "Topic :: Multimedia :: Graphics :: Editors :: Vector-Based",
             "Topic :: Scientific/Engineering",
             "Topic :: Scientific/Engineering :: Image Recognition",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/svgpathtools/path.py 
new/svgpathtools-1.6.1/svgpathtools/path.py
--- old/svgpathtools-1.6.0/svgpathtools/path.py 2023-02-13 23:49:35.000000000 
+0100
+++ new/svgpathtools-1.6.1/svgpathtools/path.py 2023-05-20 20:35:36.000000000 
+0200
@@ -43,8 +43,8 @@
 COMMANDS = set('MmZzLlHhVvCcSsQqTtAa')
 UPPERCASE = set('MZLHVCSQTA')
 
-COMMAND_RE = re.compile("([MmZzLlHhVvCcSsQqTtAa])")
-FLOAT_RE = re.compile("[-+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?")
+COMMAND_RE = re.compile(r"([MmZzLlHhVvCcSsQqTtAa])")
+FLOAT_RE = re.compile(r"[-+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?")
 
 # Default Parameters ##########################################################
 
@@ -338,9 +338,13 @@
 
         if new_radius.real == 0 or new_radius.imag == 0 :
             return Line(new_start, new_end)
-        else : 
+        else:
+            if tf[0][0] * tf[1][1] >= 0.0:
+                new_sweep = curve.sweep
+            else:
+                new_sweep = not curve.sweep
             return Arc(new_start, radius=new_radius, rotation=curve.rotation + 
rot,
-                       large_arc=curve.large_arc, sweep=curve.sweep, 
end=new_end,
+                       large_arc=curve.large_arc, sweep=new_sweep, end=new_end,
                        autoscale_radius=True)
 
     else:
@@ -1394,7 +1398,7 @@
 class Arc(object):
     def __init__(self, start, radius, rotation, large_arc, sweep, end,
                  autoscale_radius=True):
-        """
+        r"""
         This should be thought of as a part of an ellipse connecting two
         points on that ellipse, start and end.
         Parameters
@@ -2568,7 +2572,7 @@
 
         # Shortcuts
         if len(self._segments) == 0:
-            return None
+            raise ValueError("This path contains no segments!")
         if pos == 0.0:
             return self._segments[0].point(pos)
         if pos == 1.0:
@@ -2585,6 +2589,7 @@
                     segment_end - segment_start)
                 return segment.point(segment_pos)
             segment_start = segment_end
+        raise RuntimeError("Something has gone wrong.  Could not compute 
Path.point({}) for path {}".format(pos, self))
 
     def length(self, T0=0, T1=1, error=LENGTH_ERROR, 
min_depth=LENGTH_MIN_DEPTH):
         self._calc_lengths(error=error, min_depth=min_depth)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/svgpathtools/svg_to_paths.py 
new/svgpathtools-1.6.1/svgpathtools/svg_to_paths.py
--- old/svgpathtools-1.6.0/svgpathtools/svg_to_paths.py 2023-02-13 
23:49:35.000000000 +0100
+++ new/svgpathtools-1.6.1/svgpathtools/svg_to_paths.py 2023-05-20 
20:35:36.000000000 +0200
@@ -51,7 +51,7 @@
     d += 'a' + str(rx) + ',' + str(ry) + ' 0 1,0 ' + str(2 * rx) + ',0'
     d += 'a' + str(rx) + ',' + str(ry) + ' 0 1,0 ' + str(-2 * rx) + ',0'
 
-    return d
+    return d + 'z'
 
 
 def polyline2pathd(polyline, is_polygon=False):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/svgpathtools.egg-info/PKG-INFO 
new/svgpathtools-1.6.1/svgpathtools.egg-info/PKG-INFO
--- old/svgpathtools-1.6.0/svgpathtools.egg-info/PKG-INFO       2023-02-13 
23:49:43.000000000 +0100
+++ new/svgpathtools-1.6.1/svgpathtools.egg-info/PKG-INFO       2023-05-20 
20:35:44.000000000 +0200
@@ -1,9 +1,9 @@
 Metadata-Version: 2.1
 Name: svgpathtools
-Version: 1.6.0
+Version: 1.6.1
 Summary: A collection of tools for manipulating and analyzing SVG Path objects 
and Bezier curves.
 Home-page: https://github.com/mathandy/svgpathtools
-Download-URL: 
https://github.com/mathandy/svgpathtools/releases/download/1.6.0/svgpathtools-1.6.0-py2.py3-none-any.whl
+Download-URL: 
https://github.com/mathandy/svgpathtools/releases/download/1.6.1/svgpathtools-1.6.1-py2.py3-none-any.whl
 Author: Andy Port
 Author-email: [email protected]
 License: MIT
@@ -22,6 +22,7 @@
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
 Classifier: Topic :: Multimedia :: Graphics :: Editors :: Vector-Based
 Classifier: Topic :: Scientific/Engineering
 Classifier: Topic :: Scientific/Engineering :: Image Recognition
@@ -35,7 +36,6 @@
 
[![Donate](https://img.shields.io/badge/donate-paypal-brightgreen)](https://www.paypal.com/donate?business=4SKJ27AM4EYYA&amp;no_recurring=0&amp;item_name=Support+the+creator+of+svgpathtools?++He%27s+a+student+and+would+appreciate+it.&amp;currency_code=USD)
 ![Python](https://img.shields.io/pypi/pyversions/svgpathtools.svg)
 
[![PyPI](https://img.shields.io/pypi/v/svgpathtools)](https://pypi.org/project/svgpathtools/)
-![Build](https://img.shields.io/github/workflow/status/mathandy/svgpathtools/Github%20CI%20Unit%20Testing)
 [![PyPI - 
Downloads](https://img.shields.io/pypi/dm/svgpathtools?color=yellow)](https://pypistats.org/packages/svgpathtools)
 # svgpathtools
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/svgpathtools.egg-info/SOURCES.txt 
new/svgpathtools-1.6.1/svgpathtools.egg-info/SOURCES.txt
--- old/svgpathtools-1.6.0/svgpathtools.egg-info/SOURCES.txt    2023-02-13 
23:49:43.000000000 +0100
+++ new/svgpathtools-1.6.1/svgpathtools.egg-info/SOURCES.txt    2023-05-20 
20:35:44.000000000 +0200
@@ -33,6 +33,7 @@
 test/display_temp.svg
 test/ellipse.svg
 test/groups.svg
+test/negative-scale.svg
 test/polygons.svg
 test/rects.svg
 test/test.svg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/test/negative-scale.svg 
new/svgpathtools-1.6.1/test/negative-scale.svg
--- old/svgpathtools-1.6.0/test/negative-scale.svg      1970-01-01 
01:00:00.000000000 +0100
+++ new/svgpathtools-1.6.1/test/negative-scale.svg      2023-05-20 
20:35:36.000000000 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+<svg width="100mm" height="100mm" viewBox="-100 -200 500 500" 
xmlns="http://www.w3.org/2000/svg"; version="1.1">
+    <g id="Sketch" transform="scale(1,-1)">
+        <path id="slot" d="
+            M 0 10
+            L 0 80
+            A 30 30 0 1 0 0 140
+            A 10 10 0 0 1 0 100
+            L 100 100
+            A 10 10 0 1 1 100 140
+            A 30 30 0 0 0 100 80
+            L 100 10
+            A 10 10 0 0 0 90 0
+            L 10 0
+            A 10 10 0 0 0 0 10
+        " stroke="#ff0000" stroke-width="0.35 px"/>
+    </g>
+</svg>
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/test/test_groups.py 
new/svgpathtools-1.6.1/test/test_groups.py
--- old/svgpathtools-1.6.0/test/test_groups.py  2023-02-13 23:49:35.000000000 
+0100
+++ new/svgpathtools-1.6.1/test/test_groups.py  2023-05-20 20:35:36.000000000 
+0200
@@ -5,11 +5,15 @@
 """
 from __future__ import division, absolute_import, print_function
 import unittest
-from svgpathtools import Document, SVG_NAMESPACE, parse_path
+from svgpathtools import Document, SVG_NAMESPACE, parse_path, Line, Arc
 from os.path import join, dirname
 import numpy as np
 
 
+# When an assert fails, show the full error message, don't truncate it.
+unittest.util._MAX_LENGTH = 999999999
+
+
 def get_desired_path(name, paths):
     return next(p for p in paths
                 if p.element.get('{some://testuri}name') == name)
@@ -42,6 +46,22 @@
         self.check_values(tf.dot(v_s), actual.start)
         self.check_values(tf.dot(v_e), actual.end)
 
+    def test_group_transform(self):
+        # The input svg has a group transform of "scale(1,-1)", which
+        # can mess with Arc sweeps.
+        doc = Document(join(dirname(__file__), 'negative-scale.svg'))
+        path = doc.paths()[0]
+        self.assertEqual(path[0], Line(start=-10j, end=-80j))
+        self.assertEqual(path[1], Arc(start=-80j, radius=(30+30j), 
rotation=0.0, large_arc=True, sweep=True, end=-140j))
+        self.assertEqual(path[2], Arc(start=-140j, radius=(20+20j), 
rotation=0.0, large_arc=False, sweep=False, end=-100j))
+        self.assertEqual(path[3], Line(start=-100j, end=(100-100j)))
+        self.assertEqual(path[4], Arc(start=(100-100j), radius=(20+20j), 
rotation=0.0, large_arc=True, sweep=False, end=(100-140j)))
+        self.assertEqual(path[5], Arc(start=(100-140j), radius=(30+30j), 
rotation=0.0, large_arc=False, sweep=True, end=(100-80j)))
+        self.assertEqual(path[6], Line(start=(100-80j), end=(100-10j)))
+        self.assertEqual(path[7], Arc(start=(100-10j), radius=(10+10j), 
rotation=0.0, large_arc=False, sweep=True, end=(90+0j)))
+        self.assertEqual(path[8], Line(start=(90+0j), end=(10+0j)))
+        self.assertEqual(path[9], Arc(start=(10+0j), radius=(10+10j), 
rotation=0.0, large_arc=False, sweep=True, end=-10j))
+
     def test_group_flatten(self):
         # Test the Document.paths() function against the
         # groups.svg test file.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/svgpathtools-1.6.0/test/test_svg2paths.py 
new/svgpathtools-1.6.1/test/test_svg2paths.py
--- old/svgpathtools-1.6.0/test/test_svg2paths.py       2023-02-13 
23:49:35.000000000 +0100
+++ new/svgpathtools-1.6.1/test/test_svg2paths.py       2023-05-20 
20:35:36.000000000 +0200
@@ -3,8 +3,11 @@
 from svgpathtools import Path, Line, Arc, svg2paths, svgstr2paths
 from io import StringIO
 from io import open  # overrides build-in open for compatibility with python2
+import os
 from os.path import join, dirname
 from sys import version_info
+import tempfile
+import shutil
 
 from svgpathtools.svg_to_paths import rect2pathd
 
@@ -57,6 +60,26 @@
         self.assertTrue(path_circle==path_circle_correct)
         self.assertTrue(path_circle.isclosed())
 
+        # test for issue #198 (circles not being closed)
+        svg = u"""<?xml version="1.0" encoding="UTF-8"?>
+        <svg xmlns="http://www.w3.org/2000/svg"; 
xmlns:svg="http://www.w3.org/2000/svg"; width="40mm" height="40mm" 
+          viewBox="0 0 40 40" version="1.1">
+            
+          <g id="layer">
+            <circle id="c1" cx="20.000" cy="20.000" r="11.000" />
+            <circle id="c2" cx="20.000" cy="20.000" r="5.15" />
+          </g>
+        </svg>"""
+        tmpdir = tempfile.mkdtemp()
+        svgfile = os.path.join(tmpdir, 'test.svg')
+        with open(svgfile, 'w') as f:
+            f.write(svg)
+        paths, _ = svg2paths(svgfile)
+        self.assertEqual(len(paths), 2)
+        self.assertTrue(paths[0].isclosed())
+        self.assertTrue(paths[1].isclosed())
+        shutil.rmtree(tmpdir)
+
     def test_rect2pathd(self):
         non_rounded = {"x":"10", "y":"10", "width":"100","height":"100"}
         self.assertEqual(rect2pathd(non_rounded), 'M10.0 10.0 L 110.0 10.0 L 
110.0 110.0 L 10.0 110.0 z')
@@ -107,3 +130,7 @@
             paths, _ = svgstr2paths(file_content)
 
             self.assertEqual(len(paths), 2)
+
+
+if __name__ == '__main__':
+    unittest.main()

Reply via email to