From 6ae73072b012cd58bae9dba7f57cf9c9ee612575 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2019 11:13:12 +0000 Subject: import python-matplotlib-1.2.0-16.el7 --- diff --git a/SOURCES/FIX-catch-ValueError-as-well.patch b/SOURCES/FIX-catch-ValueError-as-well.patch new file mode 100644 index 0000000..a0812bf --- /dev/null +++ b/SOURCES/FIX-catch-ValueError-as-well.patch @@ -0,0 +1,30 @@ +From 0854a2eaa44b16e2261e9cb7c0f39a2fb82160ab Mon Sep 17 00:00:00 2001 +From: Thomas A Caswell +Date: Sat, 9 Jul 2016 14:46:39 -0400 +Subject: [PATCH 4/5] FIX: catch ValueError as well + +Closes #6702 + +Extension of #5233 + +Signed-off-by: John Kacur +--- + lib/matplotlib/font_manager.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py +index 8ee5cdc3fe80..168fa9f306e9 100644 +--- a/lib/matplotlib/font_manager.py ++++ b/lib/matplotlib/font_manager.py +@@ -581,7 +581,7 @@ def createFontList(fontfiles, fontext='ttf'): + continue + try: + prop = ttfFontProperty(font) +- except (KeyError, RuntimeError): ++ except (KeyError, RuntimeError, ValueError): + continue + + fontlist.append(prop) +-- +2.20.1 + diff --git a/SOURCES/Fix-for-Python-3.patch b/SOURCES/Fix-for-Python-3.patch new file mode 100644 index 0000000..cc8b324 --- /dev/null +++ b/SOURCES/Fix-for-Python-3.patch @@ -0,0 +1,26 @@ +From 49180b3f5bb2e823bfa927a4b46a4ff0ef3730f0 Mon Sep 17 00:00:00 2001 +From: Michael Droettboom +Date: Mon, 12 Oct 2015 20:03:57 -0400 +Subject: [PATCH 3/5] Fix for Python 3 + +Signed-off-by: John Kacur +--- + lib/matplotlib/font_manager.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py +index a57e211509bb..8ee5cdc3fe80 100644 +--- a/lib/matplotlib/font_manager.py ++++ b/lib/matplotlib/font_manager.py +@@ -581,7 +581,7 @@ def createFontList(fontfiles, fontext='ttf'): + continue + try: + prop = ttfFontProperty(font) +- except KeyError, RuntimeError: ++ except (KeyError, RuntimeError): + continue + + fontlist.append(prop) +-- +2.20.1 + diff --git a/SOURCES/Make-font_manager-ignore-KeyErrors-for-bad-fonts.patch b/SOURCES/Make-font_manager-ignore-KeyErrors-for-bad-fonts.patch new file mode 100644 index 0000000..cd3b6d1 --- /dev/null +++ b/SOURCES/Make-font_manager-ignore-KeyErrors-for-bad-fonts.patch @@ -0,0 +1,41 @@ +From faa88c94e36ae1c51ca75c1a8eee87d7148156e3 Mon Sep 17 00:00:00 2001 +From: Damon McDougall +Date: Mon, 17 Dec 2012 10:15:48 -0600 +Subject: [PATCH 1/5] Make font_manager ignore KeyErrors for bad fonts + +Signed-off-by: John Kacur +--- + lib/matplotlib/font_manager.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py +index 4ba6f80d0145..f9418dc5b4bd 100644 +--- a/lib/matplotlib/font_manager.py ++++ b/lib/matplotlib/font_manager.py +@@ -565,7 +565,10 @@ def createFontList(fontfiles, fontext='ttf'): + except RuntimeError: + verbose.report("Could not parse font file %s"%fpath) + continue +- prop = afmFontProperty(fpath, font) ++ try: ++ prop = afmFontProperty(fpath, font) ++ except KeyError: ++ continue + else: + try: + font = ft2font.FT2Font(str(fpath)) +@@ -576,7 +579,10 @@ def createFontList(fontfiles, fontext='ttf'): + verbose.report("Cannot handle unicode filenames") + #print >> sys.stderr, 'Bad file is', fpath + continue +- prop = ttfFontProperty(font) ++ try: ++ prop = ttfFontProperty(font) ++ except KeyError: ++ continue + + fontlist.append(prop) + return fontlist +-- +2.20.1 + diff --git a/SOURCES/Remove-call-to-nonexistent-FT2Font.get_fontsize.patch b/SOURCES/Remove-call-to-nonexistent-FT2Font.get_fontsize.patch new file mode 100644 index 0000000..ac7b7af --- /dev/null +++ b/SOURCES/Remove-call-to-nonexistent-FT2Font.get_fontsize.patch @@ -0,0 +1,62 @@ +From 22a27a7921d4c74fada02ed807253b178fcd8e06 Mon Sep 17 00:00:00 2001 +From: Antony Lee +Date: Thu, 16 Nov 2017 19:57:33 -0800 +Subject: [PATCH 5/5] Remove call to nonexistent FT2Font.get_fontsize. + +Signed-off-by: John Kacur +--- + lib/matplotlib/font_manager.py | 17 ++++------------- + 1 file changed, 4 insertions(+), 13 deletions(-) + +diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py +index 168fa9f306e9..2cabc31090bc 100644 +--- a/lib/matplotlib/font_manager.py ++++ b/lib/matplotlib/font_manager.py +@@ -28,7 +28,6 @@ KNOWN ISSUES + - font variant is untested + - font stretch is incomplete + - font size is incomplete +- - font size_adjust is incomplete + - default font algorithm needs improvement and testing + - setWeights function needs improvement + - 'light' is an invalid weight value, remove it. +@@ -457,14 +456,9 @@ def ttfFontProperty(font): + # Length value is an absolute font size, e.g. 12pt + # Percentage values are in 'em's. Most robust specification. + +- # !!!! Incomplete +- if font.scalable: +- size = 'scalable' +- else: +- size = str(float(font.get_fontsize())) +- +- # !!!! Incomplete +- size_adjust = None ++ if not font.scalable: ++ raise NotImplementedError("Non-scalable fonts are not supported") ++ size = 'scalable' + + return FontEntry(font.fname, name, style, variant, weight, stretch, size) + +@@ -530,9 +524,6 @@ def afmFontProperty(fontpath, font): + + size = 'scalable' + +- # !!!! Incomplete +- size_adjust = None +- + return FontEntry(fontpath, name, style, variant, weight, stretch, size) + + +@@ -581,7 +572,7 @@ def createFontList(fontfiles, fontext='ttf'): + continue + try: + prop = ttfFontProperty(font) +- except (KeyError, RuntimeError, ValueError): ++ except (KeyError, RuntimeError, ValueError, NotImplementedError): + continue + + fontlist.append(prop) +-- +2.20.1 + diff --git a/SOURCES/Skip-over-broken-TTF-font-when-creating-cache.patch b/SOURCES/Skip-over-broken-TTF-font-when-creating-cache.patch new file mode 100644 index 0000000..4f64231 --- /dev/null +++ b/SOURCES/Skip-over-broken-TTF-font-when-creating-cache.patch @@ -0,0 +1,26 @@ +From 484f95e01a836f39ab55daee2663788cb9813c3d Mon Sep 17 00:00:00 2001 +From: Michael Droettboom +Date: Mon, 12 Oct 2015 18:51:00 -0400 +Subject: [PATCH 2/5] Skip over broken TTF font when creating cache + +Signed-off-by: John Kacur +--- + lib/matplotlib/font_manager.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py +index f9418dc5b4bd..a57e211509bb 100644 +--- a/lib/matplotlib/font_manager.py ++++ b/lib/matplotlib/font_manager.py +@@ -581,7 +581,7 @@ def createFontList(fontfiles, fontext='ttf'): + continue + try: + prop = ttfFontProperty(font) +- except KeyError: ++ except KeyError, RuntimeError: + continue + + fontlist.append(prop) +-- +2.20.1 + diff --git a/SPECS/python-matplotlib.spec b/SPECS/python-matplotlib.spec index 02d2e3a..bcfb04a 100644 --- a/SPECS/python-matplotlib.spec +++ b/SPECS/python-matplotlib.spec @@ -5,7 +5,7 @@ %global with_python3 0 %endif %global __provides_exclude_from .*/site-packages/.*\\.so$ -%global with_html 1 +%global with_html 0 # On RHEL 7 onwards, don't build with wx: %if 0%{?rhel} >= 7 @@ -17,7 +17,7 @@ Name: python-matplotlib Version: 1.2.0 -Release: 15%{?dist} +Release: 16%{?dist} Summary: Python 2D plotting library Group: Development/Libraries License: Python @@ -63,12 +63,26 @@ Requires: pygtk2 Requires: pyparsing Requires: python-dateutil Requires: pytz +Requires: stix-fonts +Requires: stix-math-fonts + %if 0%{?fedora} >= 18 Requires: stix-math-fonts %else Requires: stix-fonts %endif +%if 0%{?rhel} >= 7 +Requires: stix-math-fonts +%endif + +# PATCHES +Patch4: Make-font_manager-ignore-KeyErrors-for-bad-fonts.patch +Patch5: Skip-over-broken-TTF-font-when-creating-cache.patch +Patch6: Fix-for-Python-3.patch +Patch7: FIX-catch-ValueError-as-well.patch +Patch8: Remove-call-to-nonexistent-FT2Font.get_fontsize.patch + %description Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive @@ -184,6 +198,11 @@ Requires: python3-tkinter %prep %setup -q -n matplotlib-%{version} +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 # Remove bundled libraries rm -r agg24 lib/matplotlib/pyparsing_py?.py @@ -321,6 +340,10 @@ popd %endif %changelog +* Mon Jan 21 2019 John Kacur - 1.2.0-16 +- Fix "unable to parse the pattern" message in stderr +Resolves: rhbz#1653300 + * Fri Jan 24 2014 Daniel Mach - 1.2.0-15 - Mass rebuild 2014-01-24