Skip to content

Commit

Permalink
Fix docs build with Pygments 2.15 (#9948) (#9952)
Browse files Browse the repository at this point in the history
The problem was because the latest version of Pygments included a
docstring in `Lexer.__init__` that includes a crossreference to an
object that Qiskit naturally doesn't have.  We don't need to inherit the
`__init__` docstring for this object; we're only interested in
documenting the existence of object itself.

(cherry picked from commit e598593)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
  • Loading branch information
mergify[bot] and jakelishman committed Apr 11, 2023
1 parent 595a68a commit 32281ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions qiskit/qasm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@
Pygments
========
.. autosummary::
:toctree: ../stubs/
.. autoclass:: OpenQASMLexer
:class-doc-from: class
OpenQASMLexer
QasmHTMLStyle
QasmTerminalStyle
.. autoclass:: QasmHTMLStyle
:class-doc-from: class
.. autoclass:: QasmTerminalStyle
:class-doc-from: class
"""

from numpy import pi
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Sphinx>=3.0.0
qiskit-sphinx-theme>=1.6
sphinx-autodoc-typehints==1.21.1 # revert to >=1.18 once the incompatibilities are fixed
sphinx-design>=0.2.0
pygments>=2.4,<2.15
pygments>=2.4
scikit-learn>=0.20.0
scikit-quant<=0.7;platform_system != 'Windows'
jax;platform_system != 'Windows'
Expand Down

0 comments on commit 32281ad

Please sign in to comment.