Skip to content

Commit

Permalink
Fix docs build on case-insensitive systems (Qiskit#9748)
Browse files Browse the repository at this point in the history
During the switchover of the `SymbolicPulse` classes in the pulse
library, there are several objects documented under
`qiskit.library.pulse` that differ only by capitalisation.  Under
`autosummary`, these therefore generate files with names that differ
only by capitalisation, which causes naming clashes on systems that have
case-insensitive semantics, such as macOS.  This then causes warnings to
be emitted from the Sphinx build, failing it.

Autosummary has this setting that can be used as a workaround.  I went
this route rather than converting the documentation to use more inline
documentation for the library for now, because I expect the clash to be
more short-lived, and I didn't want to make a change that meaningful
impacts the style of the documentation without knowing the full context
around it.

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
  • Loading branch information
2 people authored and king-p3nguin committed May 22, 2023
1 parent dd7952b commit 686ee0e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,20 @@

autosummary_generate = True
autosummary_generate_overwrite = False

# The pulse library contains some names that differ only in capitalisation, during the changeover
# surrounding SymbolPulse. Since these resolve to autosummary filenames that also differ only in
# capitalisation, this causes problems when the documentation is built on an OS/filesystem that is
# enforcing case-insensitive semantics. This setting defines some custom names to prevent the clash
# from happening.
autosummary_filename_map = {
"qiskit.pulse.library.Constant": "qiskit.pulse.library.Constant_class.rst",
"qiskit.pulse.library.Sawtooth": "qiskit.pulse.library.Sawtooth_class.rst",
"qiskit.pulse.library.Triangle": "qiskit.pulse.library.Triangle_class.rst",
"qiskit.pulse.library.Cos": "qiskit.pulse.library.Cos_class.rst",
"qiskit.pulse.library.Sin": "qiskit.pulse.library.Sin_class.rst",
"qiskit.pulse.library.Gaussian": "qiskit.pulse.library.Gaussian_class.rst",
"qiskit.pulse.library.Drag": "qiskit.pulse.library.Drag_class.rst",
}

autoclass_content = "both"

0 comments on commit 686ee0e

Please sign in to comment.