From a525954b7e1f6bb8237e7d491a9c1d50837eeac7 Mon Sep 17 00:00:00 2001 From: Bas van Beek Date: Tue, 22 Jun 2021 17:27:32 +0200 Subject: DOC: Do not generate source URLs for re-exported objects Ignore re-exports as their source files are not within the numpy repo. --- doc/source/conf.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/source/conf.py') diff --git a/doc/source/conf.py b/doc/source/conf.py index a49074922..59e1e9b8d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -435,6 +435,11 @@ def linkcode_resolve(domain, info): if not fn: return None + # Ignore re-exports as their source files are not within the numpy repo + module = inspect.getmodule(obj) + if module is not None and not module.__name__.startswith("numpy"): + return None + try: source, lineno = inspect.getsourcelines(obj) except Exception: -- cgit v1.2.1