From 56dbaca1e922531e097a51a58228cc466181cebb Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Sat, 10 Feb 2024 11:22:56 -0800 Subject: [PATCH] Update matplotlib to 3.8.2 Requires an update to matplotlib-pyodide before it will work: https://github.com/pyodide/matplotlib-pyodide/pull/52 --- packages/matplotlib/meta.yaml | 13 +++++++------ .../patches/0001-disable-macosx-backend.patch | 6 +++--- .../matplotlib/patches/0002-fix-threading.patch | 8 ++++---- .../patches/0003-hardcoded-font-cache.patch | 8 ++++---- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/matplotlib/meta.yaml b/packages/matplotlib/meta.yaml index 0999baee0a4..0557aa215d3 100644 --- a/packages/matplotlib/meta.yaml +++ b/packages/matplotlib/meta.yaml @@ -1,6 +1,6 @@ package: name: matplotlib - version: 3.5.2 + version: 3.8.2 tag: - min-scipy-stack top-level: @@ -8,13 +8,13 @@ package: - mpl_toolkits - matplotlib source: - url: https://files.pythonhosted.org/packages/2f/be/7d6e073a3eb740ebeba43a69f5de2b141fea50b801e24e0ae024ac94d4ac/matplotlib-3.5.2.tar.gz - sha256: 48cf850ce14fa18067f2d9e0d646763681948487a8080ec0af2686468b4607a2 + url: https://files.pythonhosted.org/packages/fb/ab/38a0e94cb01dacb50f06957c2bed1c83b8f9dac6618988a37b2487862944/matplotlib-3.8.2.tar.gz + sha256: 01a978b871b881ee76017152f1f1a0cbf6bd5f7b8ff8c96df0df1bd57d8755a1 patches: - - patches/disable_macosx_backend.patch - - patches/hardcoded-font-cache.patch - - patches/fix-threading.patch + - patches/0001-disable-macosx-backend.patch + - patches/0002-fix-threading.patch + - patches/0003-hardcoded-font-cache.patch extras: - - extras/setup.cfg @@ -48,6 +48,7 @@ requirements: host: - numpy run: + - contourpy - cycler - fonttools - kiwisolver diff --git a/packages/matplotlib/patches/0001-disable-macosx-backend.patch b/packages/matplotlib/patches/0001-disable-macosx-backend.patch index e9fd44c283b..22f87f22a2e 100644 --- a/packages/matplotlib/patches/0001-disable-macosx-backend.patch +++ b/packages/matplotlib/patches/0001-disable-macosx-backend.patch @@ -1,4 +1,4 @@ -From 16c3b1d3881d809d564638421e656837ca4d5cb8 Mon Sep 17 00:00:00 2001 +From ccaf51989a9afb51e42a1d368ccb07834bea8745 Mon Sep 17 00:00:00 2001 From: William Lachance Date: Mon, 12 Dec 2022 18:18:31 -0800 Subject: [PATCH 1/3] disable macosx backend @@ -9,10 +9,10 @@ This comes from #541. We let it as is in case it helps building on Mac. 1 file changed, 1 insertion(+) diff --git a/setupext.py b/setupext.py -index 0387223b94..5e78ace36e 100644 +index 9f78d88c87..f6945c961a 100644 --- a/setupext.py +++ b/setupext.py -@@ -774,6 +774,7 @@ class BackendMacOSX(OptionalPackage): +@@ -782,6 +782,7 @@ class BackendMacOSX(OptionalPackage): name = 'macosx' def check(self): diff --git a/packages/matplotlib/patches/0002-fix-threading.patch b/packages/matplotlib/patches/0002-fix-threading.patch index 20cd8498b9b..ddc92710c62 100644 --- a/packages/matplotlib/patches/0002-fix-threading.patch +++ b/packages/matplotlib/patches/0002-fix-threading.patch @@ -1,4 +1,4 @@ -From b82445488de21258ba2a72dfb0853eb1c6514658 Mon Sep 17 00:00:00 2001 +From dd7c0ccf731b605e540401f13aa801a02016f6b2 Mon Sep 17 00:00:00 2001 From: casatir Date: Mon, 12 Dec 2022 18:26:01 -0800 Subject: [PATCH 2/3] fix threading @@ -9,10 +9,10 @@ threading.Timer is not yet supported in Pyodide. 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py -index a5742ef88f..7eb183ab00 100644 +index a91ca4ba45..c16466ef5e 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py -@@ -1093,10 +1093,8 @@ class FontManager: +@@ -1031,10 +1031,8 @@ class FontManager: self.afmlist = [] self.ttflist = [] @@ -25,7 +25,7 @@ index a5742ef88f..7eb183ab00 100644 try: for fontext in ["afm", "ttf"]: for path in [*findSystemFonts(paths, fontext=fontext), -@@ -1109,7 +1107,7 @@ class FontManager: +@@ -1047,7 +1045,7 @@ class FontManager: _log.info("Failed to extract font properties from %s: " "%s", path, exc) finally: diff --git a/packages/matplotlib/patches/0003-hardcoded-font-cache.patch b/packages/matplotlib/patches/0003-hardcoded-font-cache.patch index abe80f623d1..0f942f1fc04 100644 --- a/packages/matplotlib/patches/0003-hardcoded-font-cache.patch +++ b/packages/matplotlib/patches/0003-hardcoded-font-cache.patch @@ -1,4 +1,4 @@ -From 84121d18d4f98fb8eedcc0c5ba282231714dc40a Mon Sep 17 00:00:00 2001 +From 0cb057461c1280a1304808db02e81930dcc54b24 Mon Sep 17 00:00:00 2001 From: casatir Date: Mon, 12 Dec 2022 18:27:17 -0800 Subject: [PATCH 3/3] hardcoded font cache @@ -11,10 +11,10 @@ so we teach `font_manager.py` where to find it. 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py -index 7eb183ab00..51a0a29bec 100644 +index c16466ef5e..afb2b68a3d 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py -@@ -1557,7 +1557,6 @@ def _get_font(font_filepaths, hinting_factor, *, _kerning_factor, thread_id): +@@ -1503,7 +1503,6 @@ def _get_font(font_filepaths, hinting_factor, *, _kerning_factor, thread_id): _kerning_factor=_kerning_factor ) @@ -22,7 +22,7 @@ index 7eb183ab00..51a0a29bec 100644 # FT2Font objects cannot be used across fork()s because they reference the same # FT_Library object. While invalidating *all* existing FT2Fonts after a fork # would be too complicated to be worth it, the main way FT2Fonts get reused is -@@ -1615,8 +1614,7 @@ def get_font(font_filepaths, hinting_factor=None): +@@ -1560,8 +1559,7 @@ def get_font(font_filepaths, hinting_factor=None): def _load_fontmanager(*, try_read_cache=True):