From f740f60679e41c364170a554baf554400559739e Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 10 Mar 2024 19:09:05 +0100 Subject: [PATCH] Preserve argument defaults to Sphinx documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change improves Sphinx documentation reproducibility by preserving argument defaults. The TaskVineManagerConfig dataclass includes an 'address' attribute that is set to the value of socket.gethostname() when the class is loaded. Meanwhile, the TaskVineExecutor.__init__ method 'manager_config' argument has a default value of a no-args constructed TaskVineManagerConfig instance. When Sphinx builds documentation, by default it will emit a Python repr() of the manager_config argument, causing the hostname of the build host to be included. We can solve that by instructing the Sphinx autodoc extension to retain the textual representation of argument lists as they are found in the source code, instead of evaluated and repr'd equivalents. Signed-off-by: Étienne Mollier --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index a475012603..b85013dc4f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -371,3 +371,4 @@ def linkcode_resolve(domain, info): 'members': True, 'undoc-members': True } +autodoc_preserve_defaults = True