diff -Nru cu2qu-1.6.6/debian/changelog cu2qu-1.6.7/debian/changelog --- cu2qu-1.6.6/debian/changelog 2020-02-18 08:27:21.000000000 +0000 +++ cu2qu-1.6.7/debian/changelog 2020-03-01 15:24:49.000000000 +0000 @@ -1,8 +1,10 @@ -cu2qu (1.6.6-5build1) focal; urgency=medium +cu2qu (1.6.7-1) unstable; urgency=medium - * No-change rebuild to drop python3.7. + * New upstream version 1.6.7 + * d/control: Bump Standards-Version to 4.5.0 + * d/patches: Delete patches that applied upstream - -- Matthias Klose Tue, 18 Feb 2020 09:27:21 +0100 + -- Yao Wei (魏銘廷) Sun, 01 Mar 2020 23:24:49 +0800 cu2qu (1.6.6-5) unstable; urgency=medium diff -Nru cu2qu-1.6.6/debian/control cu2qu-1.6.7/debian/control --- cu2qu-1.6.6/debian/control 2019-11-03 04:50:49.000000000 +0000 +++ cu2qu-1.6.7/debian/control 2020-03-01 15:24:49.000000000 +0000 @@ -16,7 +16,7 @@ python3-importlib-metadata , python3-setuptools, python3-setuptools-scm -Standards-Version: 4.4.1 +Standards-Version: 4.5.0 Homepage: https://github.com/googlei18n/cu2qu Vcs-Git: https://salsa.debian.org/fonts-team/cu2qu.git Vcs-Browser: https://salsa.debian.org/fonts-team/cu2qu diff -Nru cu2qu-1.6.6/debian/patches/fix-i386-test-precision.patch cu2qu-1.6.7/debian/patches/fix-i386-test-precision.patch --- cu2qu-1.6.6/debian/patches/fix-i386-test-precision.patch 2019-11-01 15:18:25.000000000 +0000 +++ cu2qu-1.6.7/debian/patches/fix-i386-test-precision.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -From: Cosimo Lupo -Subject: pens_test: compare float coordinates up to 12 decimal precision - -This issue fixes the precision issue in test comparison, specifically this -issue was to solve the failing test with cu2qu compiled on i386 with x87 -floating-point arithmetics. - -Origin: upstream, https://github.com/googlefonts/cu2qu/commit/3bd978bf0f011d8c7ee6ff21fb04815d6d80427d -Bug: https://github.com/googlefonts/cu2qu/issues/186 - -diff --git a/tests/pens_test.py b/tests/pens_test.py -index c861934..18e63a8 100644 ---- a/tests/pens_test.py -+++ b/tests/pens_test.py -@@ -39,7 +39,7 @@ def convert_glyph(self, glyph, **kwargs): - def expect_glyph(self, source, expected): - converted = self.convert_glyph(source) - self.assertNotEqual(converted, source) -- if converted != expected: -+ if not converted.approx(expected): - print(self.diff(expected, converted)) - self.fail("converted glyph is different from expected") - -diff --git a/tests/utils.py b/tests/utils.py -index 2706a71..b0d6c11 100644 ---- a/tests/utils.py -+++ b/tests/utils.py -@@ -112,7 +112,7 @@ def __ne__(self, other): - """Return True if 'other' glyph's outline is different from self.""" - return not (self == other) - -- def approx(self, other): -+ def approx(self, other, rel_tol=1e-12): - if hasattr(other, 'outline'): - outline2 == other.outline - elif hasattr(other, 'draw'): -@@ -132,7 +132,10 @@ def approx(self, other): - if not arg2 or not isinstance(arg2[0], tuple): - return False - for (x1, y1), (x2, y2) in zip(arg1, arg2): -- if not isclose(x1, x2) or not isclose(y1, y2): -+ if ( -+ not isclose(x1, x2, rel_tol=rel_tol) or -+ not isclose(y1, y2, rel_tol=rel_tol) -+ ): - return False - elif arg1 != arg2: - return False -@@ -208,9 +211,12 @@ def _repr_pen_commands(commands): - for cmd, args, kwargs in commands: - if args: - if isinstance(args[0], tuple): -- # cast float to int if there're no digits after decimal point -- args = [tuple((int(v) if int(v) == v else v) for v in pt) -- for pt in args] -+ # cast float to int if there're no digits after decimal point, -+ # and round floats to 12 decimal digits (more than enough) -+ args = [ -+ tuple((int(v) if int(v) == v else round(v, 12)) for v in pt) -+ for pt in args -+ ] - args = ", ".join(repr(a) for a in args) - if kwargs: - kwargs = ", ".join("%s=%r" % (k, v) diff -Nru cu2qu-1.6.6/debian/patches/series cu2qu-1.6.7/debian/patches/series --- cu2qu-1.6.6/debian/patches/series 2019-11-01 15:18:25.000000000 +0000 +++ cu2qu-1.6.7/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -fix-i386-test-precision.patch diff -Nru cu2qu-1.6.6/Lib/cu2qu/cu2qu.py cu2qu-1.6.7/Lib/cu2qu/cu2qu.py --- cu2qu-1.6.6/Lib/cu2qu/cu2qu.py 2019-09-13 13:06:49.000000000 +0000 +++ cu2qu-1.6.7/Lib/cu2qu/cu2qu.py 2020-02-07 13:23:43.000000000 +0000 @@ -26,6 +26,7 @@ import math +from .errors import Error as Cu2QuError, ApproxNotFoundError __all__ = ['curve_to_quadratic', 'curves_to_quadratic'] @@ -42,16 +43,6 @@ COMPILED = False -class Cu2QuError(Exception): - pass - - -class ApproxNotFoundError(Cu2QuError): - def __init__(self, curve): - message = "no approximation found: %s" % curve - super(Cu2QuError, self).__init__(message) - self.curve = curve - @cython.cfunc @cython.inline @cython.returns(cython.double) diff -Nru cu2qu-1.6.6/Lib/cu2qu/cython.py cu2qu-1.6.7/Lib/cu2qu/cython.py --- cu2qu-1.6.6/Lib/cu2qu/cython.py 2019-09-13 13:06:49.000000000 +0000 +++ cu2qu-1.6.7/Lib/cu2qu/cython.py 2020-02-07 13:23:43.000000000 +0000 @@ -6,7 +6,7 @@ # cython.* namespace for pure mode. from __future__ import absolute_import -__version__ = "0.28.5" +__version__ = "0.29.14" try: from __builtin__ import basestring @@ -113,13 +113,14 @@ cclass = ccall = cfunc = _EmptyDecoratorAndManager() returns = wraparound = boundscheck = initializedcheck = nonecheck = \ - overflowcheck = embedsignature = cdivision = cdivision_warnings = \ + embedsignature = cdivision = cdivision_warnings = \ always_allows_keywords = profile = linetrace = infer_types = \ unraisable_tracebacks = freelist = \ lambda _: _EmptyDecoratorAndManager() exceptval = lambda _=None, check=True: _EmptyDecoratorAndManager() +overflowcheck = lambda _: _EmptyDecoratorAndManager() optimization = _Optimization() overflowcheck.fold = optimization.use_switch = \ @@ -190,8 +191,15 @@ return value class _nogil(object): - """Support for 'with nogil' statement + """Support for 'with nogil' statement and @nogil decorator. """ + def __call__(self, x): + if callable(x): + # Used as function decorator => return the function unchanged. + return x + # Used as conditional context manager or to create an "@nogil(True/False)" decorator => keep going. + return self + def __enter__(self): pass def __exit__(self, exc_class, exc, tb): @@ -201,6 +209,7 @@ gil = _nogil() del _nogil + # Emulated types class CythonMetaType(type): @@ -451,7 +460,7 @@ def parallel(self, num_threads=None): return nogil - def prange(self, start=0, stop=None, step=1, schedule=None, nogil=False): + def prange(self, start=0, stop=None, step=1, nogil=False, schedule=None, chunksize=None, num_threads=None): if stop is None: stop = start start = 0 diff -Nru cu2qu-1.6.6/Lib/cu2qu/errors.py cu2qu-1.6.7/Lib/cu2qu/errors.py --- cu2qu-1.6.6/Lib/cu2qu/errors.py 2019-09-13 13:06:49.000000000 +0000 +++ cu2qu-1.6.7/Lib/cu2qu/errors.py 2020-02-07 13:23:43.000000000 +0000 @@ -1,12 +1,22 @@ from __future__ import print_function, absolute_import, division -class UnequalZipLengthsError(ValueError): - pass +class Error(Exception): + """Base Cu2Qu exception class for all other errors.""" + + +class ApproxNotFoundError(Error): + def __init__(self, curve): + message = "no approximation found: %s" % curve + super(Error, self).__init__(message) + self.curve = curve + +class UnequalZipLengthsError(Error): + pass -class IncompatibleGlyphsError(ValueError): +class IncompatibleGlyphsError(Error): def __init__(self, glyphs): assert len(glyphs) > 1 self.glyphs = glyphs @@ -21,14 +31,13 @@ class IncompatibleSegmentNumberError(IncompatibleGlyphsError): - def __str__(self): return "Glyphs named %s have different number of segments" % ( - self.combined_name) + self.combined_name + ) class IncompatibleSegmentTypesError(IncompatibleGlyphsError): - def __init__(self, glyphs, segments): IncompatibleGlyphsError.__init__(self, glyphs) self.segments = segments @@ -37,17 +46,20 @@ lines = [] ndigits = len(str(max(self.segments))) for i, tags in sorted(self.segments.items()): - lines.append("%s: (%s)" % ( - str(i).rjust(ndigits), ", ".join(repr(t) for t in tags))) + lines.append( + "%s: (%s)" % (str(i).rjust(ndigits), ", ".join(repr(t) for t in tags)) + ) return "Glyphs named %s have incompatible segment types:\n %s" % ( - self.combined_name, "\n ".join(lines)) - + self.combined_name, + "\n ".join(lines), + ) -class IncompatibleFontsError(ValueError): +class IncompatibleFontsError(Error): def __init__(self, glyph_errors): self.glyph_errors = glyph_errors def __str__(self): return "fonts contains incompatible glyphs: %s" % ( - ", ".join(repr(g) for g in sorted(self.glyph_errors.keys()))) + ", ".join(repr(g) for g in sorted(self.glyph_errors.keys())) + ) diff -Nru cu2qu-1.6.6/setup.cfg cu2qu-1.6.7/setup.cfg --- cu2qu-1.6.6/setup.cfg 2019-09-13 13:06:49.000000000 +0000 +++ cu2qu-1.6.7/setup.cfg 2020-02-07 13:23:43.000000000 +0000 @@ -24,3 +24,5 @@ -r a --doctest-modules --doctest-ignore-import-errors +filterwarnings: + ignore:.*bytes:DeprecationWarning:fs.base diff -Nru cu2qu-1.6.6/setup.py cu2qu-1.6.7/setup.py --- cu2qu-1.6.6/setup.py 2019-09-13 13:06:49.000000000 +0000 +++ cu2qu-1.6.7/setup.py 2020-02-07 13:23:43.000000000 +0000 @@ -208,7 +208,7 @@ description='Cubic-to-quadratic bezier curve conversion', author="James Godfrey-Kittle, Behdad Esfahbod", author_email="jamesgk@google.com", - url="https://github.com/googlei18n", + url="https://github.com/googlefonts", license="Apache License, Version 2.0", long_description=long_description, packages=find_packages('Lib'), diff -Nru cu2qu-1.6.6/tests/pens_test.py cu2qu-1.6.7/tests/pens_test.py --- cu2qu-1.6.6/tests/pens_test.py 2019-09-13 13:06:49.000000000 +0000 +++ cu2qu-1.6.7/tests/pens_test.py 2020-02-07 13:23:43.000000000 +0000 @@ -39,7 +39,7 @@ def expect_glyph(self, source, expected): converted = self.convert_glyph(source) self.assertNotEqual(converted, source) - if converted != expected: + if not converted.approx(expected): print(self.diff(expected, converted)) self.fail("converted glyph is different from expected") diff -Nru cu2qu-1.6.6/tests/utils.py cu2qu-1.6.7/tests/utils.py --- cu2qu-1.6.6/tests/utils.py 2019-09-13 13:06:49.000000000 +0000 +++ cu2qu-1.6.7/tests/utils.py 2020-02-07 13:23:43.000000000 +0000 @@ -112,7 +112,7 @@ """Return True if 'other' glyph's outline is different from self.""" return not (self == other) - def approx(self, other): + def approx(self, other, rel_tol=1e-12): if hasattr(other, 'outline'): outline2 == other.outline elif hasattr(other, 'draw'): @@ -132,7 +132,10 @@ if not arg2 or not isinstance(arg2[0], tuple): return False for (x1, y1), (x2, y2) in zip(arg1, arg2): - if not isclose(x1, x2) or not isclose(y1, y2): + if ( + not isclose(x1, x2, rel_tol=rel_tol) or + not isclose(y1, y2, rel_tol=rel_tol) + ): return False elif arg1 != arg2: return False @@ -208,9 +211,12 @@ for cmd, args, kwargs in commands: if args: if isinstance(args[0], tuple): - # cast float to int if there're no digits after decimal point - args = [tuple((int(v) if int(v) == v else v) for v in pt) - for pt in args] + # cast float to int if there're no digits after decimal point, + # and round floats to 12 decimal digits (more than enough) + args = [ + tuple((int(v) if int(v) == v else round(v, 12)) for v in pt) + for pt in args + ] args = ", ".join(repr(a) for a in args) if kwargs: kwargs = ", ".join("%s=%r" % (k, v) diff -Nru cu2qu-1.6.6/.travis.yml cu2qu-1.6.7/.travis.yml --- cu2qu-1.6.6/.travis.yml 2019-09-13 13:06:49.000000000 +0000 +++ cu2qu-1.6.7/.travis.yml 2020-02-07 13:23:43.000000000 +0000 @@ -32,6 +32,6 @@ - if [ -z "$TRAVIS_TAG" ]; then tox -e codecov; fi # deploy to PyPI on tags - | - if [ -n "$TRAVIS_TAG" ] && [ "$TRAVIS_REPO_SLUG" == "googlei18n/cu2qu" ] && [ "$BUILD_DIST" == true ]; then + if [ -n "$TRAVIS_TAG" ] && [ "$TRAVIS_REPO_SLUG" == "googlefonts/cu2qu" ] && [ "$BUILD_DIST" == true ]; then tox -e pypi fi