Hello everyone, I am using sphinx for the first time and running into some issues.
My code is structured like this. I have a package like
ctamain/
__init__.py
module1/
__init__.py
func1.py
func2.py
module2/
__init__.py
func3.py
func4.py
And using sphinx to automatically document it. The problem is, that it seems to be getting duplicate references when making the documentation.
The conf.py looks like:
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import sys
sys.path.insert(0, os.path.abspath("../../source/python/ctamain"))
project = 'CTADocs'
copyright = '2025, CTA'
author = 'CTA'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'myst_parser',
]
templates_path = ['_templates']
exclude_patterns = [
'_build',
'Thumbs.db',
'.DS_Store',
]
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
autosummary_generate = True
default_role = 'py:obj'
autodoc_typehints = 'description'
html_css_files = ['custom.css']
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}