ProjectPythia / cookbook-actions

Reusable workflows used by Project Pythia Cookbooks
Apache License 2.0
2 stars 7 forks source link

Pin link checker to Python < 3.13 to keep it running (for now) #126

Open brian-rose opened 1 month ago

brian-rose commented 1 month ago

Currently all link-checker runs are failing at run time with

Extension error:
Could not import extension sphinx.builders.epub3 (exception: No module named 'imghdr')
Traceback (most recent call last):
  File "/home/runner/miniconda3/envs/test/lib/python3.13/site-packages/sphinx/registry.py", line 459, in load_extension
    mod = import_module(extname)
  File "/home/runner/miniconda3/envs/test/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Appears to be something broken in the Sphinx ecosystem.

brian-rose commented 1 month ago

I was able to reproduce the same error locally on the Cookbook Template repo with

conda create --name testlink jupyter-book -c conda-forge
conda activate testlink
jupyter-book build --builder linkcheck .

I wonder if this is related to the fact that conda-forge is now installing Python 3.13 by default.

brian-rose commented 1 month ago

Suspicion confirmed. When I did this, the link-checker worked normally:

conda create --name testlink-py12 jupyter-book python=3.12 -c conda-forge
conda activate testlink-py12
jupyter-book build --builder linkcheck .

Something upstream in JupyterBook / sphinx must be incompatible with Python 3.13. Would be worth digging a little to see if this has been flagged in the right places yet.

brian-rose commented 1 month ago

The quick fix would be to just add

python<3.13

to this line

But it would be best to track the issue properly so we can remove that version pin once it's resolved.

brian-rose commented 1 month ago

127 didn't work, see https://github.com/ProjectPythia/cookbook-template/actions/runs/11355235621/job/31584177543

brian-rose commented 1 month ago

The link checker is working now! https://github.com/ProjectPythia/cookbook-template/actions/runs/11356548892

erogluorhan commented 1 day ago

Keep this open until things are fixed upstream and the version pin can be removed.