diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 981325bf..620855e1 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -30,6 +30,16 @@ jobs: pip install "jax[cuda13]==0.11.0" pip install numpyro python scripts/test-jax-install.py + - name: Build matplotlib's font cache + shell: bash -l {0} + run: | + # On a freshly launched runner the first matplotlib import scans the + # system fonts from a cold disk, which can take over 5 s, and + # matplotlib then prints "Matplotlib is building the font cache; this + # may take a moment." into the output of the first notebook that + # imports it. Build the cache here, so no page depends on that timing: + # the font manager builds it on import, with no backend involved. + python -c "import matplotlib.font_manager" - name: Check nvidia drivers shell: bash -l {0} run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b1dcda3..6718ff34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,16 @@ jobs: pip install "jax[cuda13]==0.11.0" pip install numpyro python scripts/test-jax-install.py + - name: Build matplotlib's font cache + shell: bash -l {0} + run: | + # On a freshly launched runner the first matplotlib import scans the + # system fonts from a cold disk, which can take over 5 s, and + # matplotlib then prints "Matplotlib is building the font cache; this + # may take a moment." into the output of the first notebook that + # imports it. Build the cache here, so no page depends on that timing: + # the font manager builds it on import, with no backend involved. + python -c "import matplotlib.font_manager" - name: Install latex dependencies run: | sudo apt-get -qq update diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e0b35fe1..7186c74f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -47,6 +47,16 @@ jobs: pip install "jax[cuda13]==0.11.0" pip install numpyro python scripts/test-jax-install.py + - name: Build matplotlib's font cache + shell: bash -l {0} + run: | + # On a freshly launched runner the first matplotlib import scans the + # system fonts from a cold disk, which can take over 5 s, and + # matplotlib then prints "Matplotlib is building the font cache; this + # may take a moment." into the output of the first notebook that + # imports it. Build the cache here, so no page depends on that timing: + # the font manager builds it on import, with no backend involved. + python -c "import matplotlib.font_manager" - name: Check nvidia drivers shell: bash -l {0} run: |