From a45e0af97e2e8362277f160d0f2b737590e367d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Mon, 4 Sep 2023 13:29:07 -0300 Subject: [PATCH] Fix code to work with Sphinx>5.0 The patch [1] introduced the use of Sphinx 6.2.1, which has some incompatibilities with the current code base. As we can see in [2], the `no_docstring` argument of `sphinx.ext.autodoc.Documenter.add_content()` was removed. It was already not used in our code base, therefore, we can remove its usage without any issues. [1] https://github.com/openstack/requirements/commit/289feed31747cbd922ef9d4a8df9ca87084b10a7 [2] https://www.sphinx-doc.org/en/master/extdev/deprecated.html#dev-deprecated-apis Change-Id: I65c2bd535fe366933e9aaf842ee9b953c5af375b --- wsmeext/sphinxext.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/wsmeext/sphinxext.py b/wsmeext/sphinxext.py index a513f53..2463956 100644 --- a/wsmeext/sphinxext.py +++ b/wsmeext/sphinxext.py @@ -223,13 +223,12 @@ class TypeDocumenter(autodoc.ClassDocumenter): else: return False - def add_content(self, more_content, no_docstring=False): + def add_content(self, more_content): # Check where to include the samples samples_slot = self.options.samples_slot or self.default_samples_slot def add_docstring(): - super(TypeDocumenter, self).add_content( - more_content, no_docstring) + super(TypeDocumenter, self).add_content(more_content) def add_samples(): protocols = get_protocols( @@ -284,14 +283,13 @@ class AttributeDocumenter(autodoc.AttributeDocumenter): self.datatype = self.object.datatype return success - def add_content(self, more_content, no_docstring=False): + def add_content(self, more_content): self.add_line( u':type: %s' % datatypename(self.datatype), '' ) self.add_line(u'', '') - super(AttributeDocumenter, self).add_content( - more_content, no_docstring) + super(AttributeDocumenter, self).add_content(more_content) def add_directive_header(self, sig): super(AttributeDocumenter, self).add_directive_header(sig) @@ -528,8 +526,8 @@ class FunctionDocumenter(autodoc.MethodDocumenter): self.wsme_fd, docstrings, protocols ) - def add_content(self, more_content, no_docstring=False): - super(FunctionDocumenter, self).add_content(more_content, no_docstring) + def add_content(self, more_content): + super(FunctionDocumenter, self).add_content(more_content) def format_name(self): return self.wsme_fd.name