question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sphinx emits lots of warnings when building docs

See original GitHub issue

Sphinx currently emits a few types of warnings when building the docs, none are really a big deal but it clutters the output and makes #909 less effective. I’ll open a PR shortly to address:

Docutils warning

/usr/share/miniconda/envs/test_env/lib/python3.8/site-packages/sphinx/util/nodes.py:94: FutureWarning: 
   The iterable returned by Node.traverse()
   will become an iterator instead of a list in Docutils > 0.16.

I’m not 100% sure what this one is, but I assume it is related to the newest version of docutils deprecating something and sphinx hasn’t caught up yet. example

I’ll play around with pinning the docutils version and see if that fixes it.

Improper RST in gallery example

The I-V curve example generates WARNING: Title underline too short. because the page title got updated without extending the underline (my bad). Easy fix. link

First-line references

The first lines of docstrings get orphaned when they are copied into the API Reference docs page and Sphinx emits a bunch of warnings about it: example

There were a few votes in #909 to remove references from first lines of docstrings to prevent these warnings. If nobody objects, I’ll move references into the second part of the docstring, for instance:

Current:

def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4):
    """
    Calculates the distance from the earth to the sun using the
    NREL SPA algorithm described in [1]_.

    Parameters
    ----------
    time : pandas.DatetimeIndex

New:

def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4):
    """
    Calculates the distance from the earth to the sun using the
    NREL SPA algorithm.

    The details of the NREL SPA algorithm are described in [1]_.

    Parameters
    ----------
    time : pandas.DatetimeIndex

This is related to #837 but that’s a much bigger job and I’d rather not tackle it right now.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

0reactions
kanderso-nrelcommented, Feb 26, 2020

I’d say let’s do option 2 for now and revisit after sphinx_rtd_theme cuts a new release. From reading through their issue log, it seems like the next release is focused on improving support for sphinx 2+ anyway so it should be a good time to bump our sphinx version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

See all warnings as errors when building Sphinx docs on ...
Turn warnings into errors ( -W and --keep-going options). This means the build fails if there is a warning and exits with exit...
Read more >
Configuration - Sphinx documentation
'python3' and other languages will emit warning if failed. The value should be a valid Pygments lexer name, see Showing code examples for...
Read more >
Configuration — Sphinx-Gallery 0.11.1-git documentation
To prevent warnings from being captured and included in your built documentation, you can use the package warnings in the conf.py file.
Read more >
Issue 35293: make doctest (Sphinx) emits a lot of warnings
The following commands emits a lot of warnings: make PYTHON=. ... venv/bin:$PATH sphinx-build -b doctest -d build/doctrees -D ...
Read more >
Building LLVM with CMake — LLVM 16.0.0git documentation
This page is geared towards users of the LLVM CMake build. ... If enabled then sphinx documentation warnings will be treated as errors....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found