Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctest comments not getting trimmed since Sphinx 1.8.0 #6545

Closed
ngoldbaum opened this issue Jul 1, 2019 · 0 comments
Closed

doctest comments not getting trimmed since Sphinx 1.8.0 #6545

ngoldbaum opened this issue Jul 1, 2019 · 0 comments
Labels
Milestone

Comments

@ngoldbaum
Copy link
Contributor

Doctest comments are showing up in the output of my documentation with recent builds of sphinx. If I build the same project with sphinx 1.7.9, the doctest comments do not show up.

To Reproduce
Steps to reproduce the behavior:

$ git clone https://github.com/yt-project/unyt
$ cd unyt/docs
$ pip install numpy sympy
$ cd docs
$ make html SPHINXOPTS="-D language=de"
$ # open _build/html/index/usage and see search for "doctest", if that shows up anywhere it's doing the wrong thing

You can see this for yourself showing up on ReadTheDocs on this page: https://unyt.readthedocs.io/en/stable/usage.html

Expected behavior
Doctest directives shouldn't show up in the doc build output

Your project
github.com/yt-project/unyt

Screenshots
You can see this on the readthedocs build for unyt, here's a screenshot of how it looks there:

image

Here's the same snippet built with Sphinx 1.7.9, the last version where this renders correctly:

image

Environment info

  • OS: Ubuntu 18.04
  • Python version: 3.7.3
  • Sphinx version: 2.1.2
  • Sphinx extensions:
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.viewcode",
    "sphinx.ext.doctest",
    "sphinx.ext.napoleon",
    "sphinx.ext.mathjax",
    "show_all_units",
]

(show_all_units is a custom extension that should be unrelated to this)

ngoldbaum added a commit to ngoldbaum/sphinx that referenced this issue Jul 2, 2019
ngoldbaum added a commit to ngoldbaum/sphinx that referenced this issue Jul 2, 2019
ngoldbaum added a commit to ngoldbaum/sphinx that referenced this issue Jul 2, 2019
@tk0miya tk0miya added this to the 2.2.0 milestone Jul 6, 2019
ngoldbaum added a commit to ngoldbaum/sphinx that referenced this issue Jul 7, 2019
ngoldbaum added a commit to ngoldbaum/sphinx that referenced this issue Jul 7, 2019
tk0miya added a commit that referenced this issue Jul 8, 2019
Fix #6545. Strip doctests for doctest_block nodes.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants