You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.
A Python class with type annotation produces a warning: WARNING: duplicate object description during the sphinx-build if the sphinx.ext.napoleon extension is used. This used to not produce any warnings on version 1.8.5 of sphinx, but produces the warnings in version 3.4.3.
To Reproduce
Steps to reproduce the behavior:
#!/usr/bin/env bashset -e
set -x
mkdir repro &&cd repro
mkdir -p docs/source
cat <<EOF > generate_warning.pyclass Test: """ Attributes: attr: a doc """ attr: boolEOF
cat <<EOF > docs/source/conf.pyimport osimport syssys.path.insert(0, os.path.abspath('../../'))extensions = [ 'sphinx.ext.napoleon',]source_suffix = '.rst'# The master toctree document.master_doc = 'index'EOF
cat <<EOF > docs/source/index.rst.. toctree:: apidoc/modulesEOF# I use conda to create environemnts, but if you don't create a virtual env with# sphinx 3.4.3 instead of the following block
cat <<EOF > environment.ymlname: sphinx-duplicate-warningchannels: - conda-forge - nodefaultsdependencies: - sphinx==3.4.3EOF
conda env create
Then activate the environment and run sphinx build:
cd repro
conda activate sphinx-duplicate-warning
sphinx-apidoc --force --separate -o docs/source/apidoc .&& sphinx-build -M html "docs/source""build"
A Python class with type annotation produces a warning:
WARNING: duplicate object description
during thesphinx-build
if thesphinx.ext.napoleon
extension is used. This used to not produce any warnings on version 1.8.5 of sphinx, but produces the warnings in version 3.4.3.To Reproduce
Steps to reproduce the behavior:
Then activate the environment and run sphinx build:
Expected behavior
No warning
Your project
repro.zip
Environment info
The text was updated successfully, but these errors were encountered: