Skip to content

html-noplot does not work with strict build options #913

Closed

Description

@pmeier

The official instructions for building html-noplot include setting -D plot_gallery=0 -b html $(ALLSPHINXOPTS). This will emit the following warning:

The config value `plot_gallery' has type `str', defaults to `bool'.

This effectively prevents us from having -W in ALLSPHINXOPTS, i.e. running in strict mode that turns warnings into errors. Given that you cannot set anything besides strings from the CLI, this is pretty limiting.

Activity

  1. larsoner commented on Feb 8, 2022

    @larsoner
    Contributor

    If you put plot_gallery = 'True' in your conf.py instead of plot_gallery = True in your conf.py it should work, as Sphinx will see it as a str var, then in SG we try to be smart about converting string values to booleans. Can you try it, and if it works, open a PR to improve the docs here?

  2. pmeier commented on Feb 8, 2022

    @pmeier
    ContributorAuthor

    That indeed works, thanks. Still, this feels kinda awkward since we didn't have plot_gallery config option before. I'm guessing it just assumes plot_gallery=True if nothing is set and then complains because the CLI option is a string. Maybe we should fix this behavior rather than documenting the workaround?

  3. larsoner commented on Feb 11, 2022

    @larsoner
    Contributor

    Maybe we should fix this behavior rather than documenting the workaround?

    That would be nice. It might just require making the default configuration 'plot_gallery': 'true' or something. Want to take a look?

  4. added a commit that references this issue on Jan 6, 2023
    2c8893d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions