Skip to content

Commit

Permalink
Update matplotlib to 3.8.2
Browse files Browse the repository at this point in the history
Requires an update to matplotlib-pyodide before it will work:
pyodide/matplotlib-pyodide#52
  • Loading branch information
hoodmane committed Feb 10, 2024
1 parent e08ebf0 commit 56dbaca
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
13 changes: 7 additions & 6 deletions packages/matplotlib/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package:
name: matplotlib
version: 3.5.2
version: 3.8.2
tag:
- min-scipy-stack
top-level:
- pylab
- 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
Expand Down Expand Up @@ -48,6 +48,7 @@ requirements:
host:
- numpy
run:
- contourpy
- cycler
- fonttools
- kiwisolver
Expand Down
6 changes: 3 additions & 3 deletions packages/matplotlib/patches/0001-disable-macosx-backend.patch
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Date: Mon, 12 Dec 2022 18:18:31 -0800
Subject: [PATCH 1/3] disable macosx backend
Expand All @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions packages/matplotlib/patches/0002-fix-threading.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b82445488de21258ba2a72dfb0853eb1c6514658 Mon Sep 17 00:00:00 2001
From dd7c0ccf731b605e540401f13aa801a02016f6b2 Mon Sep 17 00:00:00 2001
From: casatir <[email protected]>
Date: Mon, 12 Dec 2022 18:26:01 -0800
Subject: [PATCH 2/3] fix threading
Expand All @@ -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 = []

Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions packages/matplotlib/patches/0003-hardcoded-font-cache.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 84121d18d4f98fb8eedcc0c5ba282231714dc40a Mon Sep 17 00:00:00 2001
From 0cb057461c1280a1304808db02e81930dcc54b24 Mon Sep 17 00:00:00 2001
From: casatir <[email protected]>
Date: Mon, 12 Dec 2022 18:27:17 -0800
Subject: [PATCH 3/3] hardcoded font cache
Expand All @@ -11,18 +11,18 @@ 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
)

-
# 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):
Expand Down

0 comments on commit 56dbaca

Please sign in to comment.