15
0

Accepting request 814148 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/814148
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-fontPens?expand=0&rev=2
This commit is contained in:
2020-06-12 19:45:36 +00:00
committed by Git OBS Bridge
3 changed files with 35 additions and 0 deletions

26
fix-fp-issue.patch Normal file
View File

@@ -0,0 +1,26 @@
Subject: Fix floating point precission issue in tests
Author: Antonio Larrosa <alarrosa@suse.com>
Depending on the computer where the tests run, the result of
estimateQuadraticCurveLength((0, 0), (50, 20), (100, 40))
can be
107.70329614269009
or
107.70329614269008
so it's better to ignore the final digit
Index: antonio/obs/home/alarrosa/branches/devel/languages/python/fonts/python-fontPens/fontPens-0.2.4/Lib/fontPens/penTools.py
===================================================================
--- fontPens-0.2.4/Lib/fontPens/penTools.py
+++ fontPens-0.2.4.new/Lib/fontPens/penTools.py
@@ -160,8 +160,8 @@ def estimateQuadraticCurveLength(pt0, pt
0.0
>>> estimateQuadraticCurveLength((0, 0), (50, 0), (80, 0)) # collinear points
80.0
- >>> estimateQuadraticCurveLength((0, 0), (50, 20), (100, 40)) # collinear points
- 107.70329614269009
+ >>> int(10000000000000 * estimateQuadraticCurveLength((0, 0), (50, 20), (100, 40))) # collinear points
+ 1077032961426900
>>> estimateQuadraticCurveLength((0, 0), (0, 100), (100, 0))
153.6861437729263
>>> estimateQuadraticCurveLength((0, 0), (50, -10), (80, 50))

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jun 12 11:47:01 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>
- Add patch to fix floating point precission issue that made tests
fail depending on where the package is built
* fix-fp-issue.patch
-------------------------------------------------------------------
Wed May 20 10:25:48 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>

View File

@@ -24,6 +24,7 @@ Summary: A collection of classes implementing the pen protocol for manipu
License: BSD-3-Clause
URL: https://github.com/robofab-developers/fontPens
Source: https://files.pythonhosted.org/packages/source/f/fontPens/fontPens-%{version}.zip
Patch0: fix-fp-issue.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -42,6 +43,7 @@ A collection of classes implementing the pen protocol for manipulating glyphs.
%prep
%setup -q -n fontPens-%{version}
%patch0 -p1
%build
%python_build