Skip to content

Documentation building fails with sphinx-gallery 0.17.0 #3346

@yvonnefroehlich

Description

@yvonnefroehlich

Currently building the documentation fails with:

generating gallery for projections/table... 

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pygmt-dev/conda/3312/lib/python3.12/site-packages/sphinx/events.py", line 98, in emit
    results.append(listener.handler(self.app, *args))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/pygmt-dev/conda/3312/lib/python3.12/site-packages/sphinx_gallery/gen_gallery.py", line 796, in generate_gallery_rst
    _replace_md5(subsection_index_path, mode="t")
  File "/home/docs/checkouts/readthedocs.org/user_builds/pygmt-dev/conda/3312/lib/python3.12/site-packages/sphinx_gallery/utils.py", line 161, in _replace_md5
    assert fname_new.endswith(".new")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pygmt-dev/conda/3312/lib/python3.12/site-packages/sphinx/cmd/build.py", line 332, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/pygmt-dev/conda/3312/lib/python3.12/site-packages/sphinx/application.py", line 292, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/pygmt-dev/conda/3312/lib/python3.12/site-packages/sphinx/application.py", line 366, in _init_builder
    self.events.emit('builder-inited')
  File "/home/docs/checkouts/readthedocs.org/user_builds/pygmt-dev/conda/3312/lib/python3.12/site-packages/sphinx/events.py", line 109, in emit
    raise ExtensionError(
sphinx.errors.ExtensionError: Handler <function generate_gallery_rst at 0x7fd6af85a160> for event 'builder-inited' threw an exception (exception: )

Extension error (sphinx_gallery.gen_gallery):
Handler <function generate_gallery_rst at 0x7fd6af85a160> for event 'builder-inited' threw an exception (exception: )

The issue seem to be related to the README file containing the projection table.

When removing this README file building the documentation is [partly] successfull (a3a5416). I also tested changing the file extension, including *.md (d355b54, successfull) and *.rst (9080f46, failing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceBoring but important stuff for the core devsupstreamBug or missing feature of upstream core GMT

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions