@@ -32,6 +32,15 @@ class _FakeDatasetDict(dict):
3232sys .modules ["datasets.arrow_dataset" ] = MagicMock ()
3333sys .modules ["datasets.dataset_dict" ] = MagicMock ()
3434
35+ # -- typing.override shim for Python < 3.12 ------------------------------------
36+ # `override` was added to `typing` in Python 3.12. The source uses it without
37+ # a try/except in some files, so we inject a no-op shim before importing.
38+ import typing as _typing
39+ if not hasattr (_typing , "override" ):
40+ def _override (f ): # type: ignore[return]
41+ return f
42+ _typing .override = _override # type: ignore[attr-defined]
43+
3544# -- Project information -------------------------------------------------------
3645project = "MMIRAGE"
3746copyright = "2024, Meditron team"
@@ -44,8 +53,8 @@ class _FakeDatasetDict(dict):
4453 "sphinx.ext.napoleon" ,
4554 "sphinx.ext.viewcode" ,
4655 "sphinx.ext.intersphinx" ,
47- "sphinx_autodoc_typehints" ,
4856 "myst_parser" ,
57+ "sphinx_design" ,
4958]
5059
5160templates_path = ["_templates" ]
@@ -104,6 +113,15 @@ class _FakeDatasetDict(dict):
104113napoleon_include_init_with_doc = True
105114napoleon_attr_annotations = True
106115
116+ # Suppress noisy-but-benign warnings:
117+ # - duplicate member descriptions caused by __init__.py re-exports
118+ # - unresolvable forward refs in mocked type annotations
119+ suppress_warnings = [
120+ "ref.duplicate" ,
121+ "sphinx_autodoc_typehints.forward_reference" ,
122+ "myst.header" ,
123+ ]
124+
107125# -- Intersphinx ---------------------------------------------------------------
108126intersphinx_mapping = {
109127 "python" : ("https://docs.python.org/3" , None ),
0 commit comments