import os import sys from datetime import datetime # Add SRV to sys.path so autodoc can import packages sys.path.insert(0, os.path.abspath('..')) project = 'GONETS SRV' author = 'GONETS' copyright = f"{datetime.now().year}, {author}" release = '0.0.3' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', 'sphinx.ext.autosummary', 'sphinx.ext.autodoc.typehints', ] autosummary_generate = True napoleon_google_docstring = False napoleon_numpy_docstring = False napoleon_use_param = True napoleon_use_rtype = True napoleon_google_docstring = True napoleon_numpy_docstring = False html_theme = 'furo' # Source file parsers source_suffix = { '.rst': 'restructuredtext', } master_doc = 'index' html_static_path = ['_static'] # Create _static if missing to silence warnings static_dir = os.path.join(os.path.dirname(__file__), '_static') os.makedirs(static_dir, exist_ok=True) # Mock heavy/optional modules for RTD/local doc builds autodoc_mock_imports = [ 'gi', 'pygobject', 'pywifi', 'sdbus', 'sdbus_async', 'sdbus_async.networkmanager', 'dbus', 'dbus.mainloop', 'dbus.mainloop.glib', 'pydbus', 'mac_vendor_lookup', # mock problematic local modules when docs are built 'config.init_config', ] # Also prevent autosummary from importing mocked modules autosummary_mock_imports = autodoc_mock_imports # Suppress noisy warnings for mocked objects suppress_warnings = [ 'autodoc.mocked_object', ] # Environment flag so code can short-circuit heavy side effects during import os.environ.setdefault('SPHINX_BUILD', '1') autodoc_default_options = { 'members': True, 'undoc-members': True, 'private-members': False, 'show-inheritance': True, 'no-index': True, }