Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Warnings in plot directive aren't treated as such by Sphinx #15715

Open
Labels
Difficulty: Hardhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!topic: sphinx extension
@astrofrog

Description

@astrofrog

Bug report

Bug summary

sphinx-build has a-W option to turn warnings into errors. However, this doesn't seem to have any effect on warnings emitted inside plot directives.

Code for reproduction

To reproduce, create an empty directory then add aconf.py file with:

importmatplotlib.sphinxext.plot_directiveextensions= [matplotlib.sphinxext.plot_directive.__name__]

and anindex.rst file with:

.. plot::    import warnings    warnings.warn("A warning occurred")

Then run:

sphinx-build -b html -d _build/doctrees   . _build/html -W

The-W flag should turn warnings into errors, but this is not the case.

Actual outcome

Running Sphinx v2.3.0+making output directory... donebuilding [mo]: targets for 0 po files that are out of datebuilding [html]: targets for 1 source files that are out of dateupdating environment: [new config] 1 added, 0 changed, 0 removed<string>:2: UserWarning: A warning occurred                                                                                                                                                                                                                                          looking for now-outdated files... none foundpickling environment... donechecking consistency... donepreparing documents... donewriting output... [100%] index                                                                                                                                                                                                                                                       generating indices...  genindexdonewriting additional pages...  searchdonecopying static files... ... donecopying extra files... donedumping search index in English (code: en)... donedumping object inventory... donebuild succeeded.

Expected outcome

The build should fail with an error.

Matplotlib version

  • Operating system: Ubuntu 19.10
  • Matplotlib version: 3.2.0rc1 (from pip)
  • Python version: 3.7.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Hardhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!topic: sphinx extension

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp