This is on top of #2225. The goal is to be able to skip specific tests. Many core test sets have just one test that uses subprocess or threads. Others have a few tests that are failing due to upstream problems in emscripten. I went through and switched to skipping specific tests in as many cases as I could. In modules where most or all tests use threading or subprocess, I gave up and put a comment saying something like 35/50 tests fork and I didn't want to bother to salvage the remaining ones.

In order to accommodate using patterns to skip specific tests (and also extra comments) I switched the format of `python_tests` to a yaml file. This gives us significantly more flexibility in the structure of the file and allows us to use `ruamel.yaml` to update it. We gain a lot flexibility while reducing the length of `make_test_lists.py` modestly from 108 to 78 loc.

In the future, hopefully we should be able to make fixes by deleting one skip pattern and looking into why that particular test fails.

Rework core tests. This is on top of #2225. The goal is to be able to skip specific tests. Many core test sets have just one test that uses subprocess or threads. Others have a few tests that are failing due to upstream problems in emscripten. I went through and switched to skipping specific tests in as many cases as I could. In modules where most or all tests use threading or subprocess, I gave up and put a comment saying something like 35/50 tests fork and I didn't want to bother to salvage the remaining ones.

In order to accommodate using patterns to skip specific tests (and also extra comments) I switched the format of `python_tests` to a yaml file. This gives us significantly more flexibility in the structure of the file and allows us to use `ruamel.yaml` to update it. We gain a lot flexibility while reducing the length of `make_test_lists.py` modestly from 108 to 78 loc.

In the future, hopefully we should be able to make fixes by deleting one skip pattern and looking into why that particular test fails.

In Pyodide, font list (see packages/matplotlib/src/fontlist.json)
is manually pushed in the matplotlib's directory (see meta.yaml)
so we teach `font_manager.py` where to find it.

diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py
index e8fb0ca322..fa9a6c4ea7 100644
--- a/lib/matplotlib/font_manager.py
+++ b/lib/matplotlib/font_manager.py
@@ -1403,7 +1403,6 @@ def _get_font(filename, hinting_factor, *, _kerning_factor, thread_id):
     return ft2font.FT2Font(
         filename, hinting_factor, _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
@@ -1425,8 +1424,7 @@ def get_font(filename, hinting_factor=None):
 
 
 def _load_fontmanager(*, try_read_cache=True):
-    fm_path = Path(
-        mpl.get_cachedir(), f"fontlist-v{FontManager.__version__}.json")
+    fm_path = Path(__file__).parent.joinpath("fontlist.json")
     if try_read_cache:
         try:
             fm = json_load(fm_path)
-- 
2.35.1


In Pyodide, font list (see packages/matplotlib/src/fontlist.json)
is manually pushed in the matplotlib's directory (see meta.yaml)
so we teach `font_manager.py` where to find it.

diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py
index e8fb0ca322..fa9a6c4ea7 100644
--- a/lib/matplotlib/font_manager.py
+++ b/lib/matplotlib/font_manager.py
@@ -1403,7 +1403,6 @@ def _get_font(filename, hinting_factor, *, _kerning_factor, thread_id):
     return ft2font.FT2Font(
         filename, hinting_factor, _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
@@ -1425,8 +1424,7 @@ def get_font(filename, hinting_factor=None):
 
 
 def _load_fontmanager(*, try_read_cache=True):
-    fm_path = Path(
-        mpl.get_cachedir(), f"fontlist-v{FontManager.__version__}.json")
+    fm_path = Path(__file__).parent.joinpath("fontlist.json")
     if try_read_cache:
         try:
             fm = json_load(fm_path)
-- 
2.35.1

