From 9d50dba7f12a784f7bcf6510d3a5fda13beb199a Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Tue, 11 Apr 2023 22:26:24 +0100 Subject: [PATCH] Fix docs build with Pygments 2.15 (#9948) 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 e5985930204a6836d70f188ff81edec841927807) --- qiskit/qasm/__init__.py | 11 ++++++----- requirements-dev.txt | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/qiskit/qasm/__init__.py b/qiskit/qasm/__init__.py index 9010df392331..d828581d5f72 100644 --- a/qiskit/qasm/__init__.py +++ b/qiskit/qasm/__init__.py @@ -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 diff --git a/requirements-dev.txt b/requirements-dev.txt index ff915b8be1a3..54d0f552546d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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'