Skip to content

Commit

Permalink
Try suppressing external inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
alanakbik committed Dec 7, 2024
1 parent 537511b commit 6859b3b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,16 @@ def linkcode_resolve(*args):
}


def suppress_inherited_from_external(app, what, name, obj, options, signature):
# Filter out inherited members that come from external modules
# You can add conditions based on module names or other attributes
if hasattr(obj, "__module__"):
module_name = obj.__module__
if "external_module_name" in module_name: # replace 'external_module_name' with the actual name
return None # Suppress this member from being documented

return return_annotation
def skip_external_inherited_member(app, what, name, obj, skip, options):
if isinstance(obj, (type,)):
# Check if the object is inherited from an external module
if "external_module_name" in obj.__module__: # adjust this condition as needed
return True # Skip this member
return skip


def setup(app):
app.connect("autodoc-process-docstring", suppress_inherited_from_external)
app.connect("autodoc-skip-member", skip_external_inherited_member)


smv_latest_version = importlib_metadata.version(project)
Expand Down

0 comments on commit 6859b3b

Please sign in to comment.