Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1095306?usp=email )
Change subject: [cleanup] remove Sphinx autodoc workaround for Family
classproperty-s
......................................................................
[cleanup] remove Sphinx autodoc workaround for Family classproperty-s
This workaround does not solves the missing doc string with class
properties (any longer)
Change-Id: Ifd181805257c8e484eb3e4bce21077afa3f2aa5a
---
M docs/conf.py
1 file changed, 0 insertions(+), 25 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/docs/conf.py b/docs/conf.py
index 522a1b2..da75c99 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -579,35 +579,10 @@
length = 0
-def pywikibot_family_classproperty_getattr(obj, name, *defargs):
- """Custom getattr() to get classproperty instances."""
- from sphinx.util.inspect import safe_getattr
-
- from pywikibot.family import Family
- from pywikibot.tools import classproperty
-
- if not isinstance(obj, type) or not issubclass(obj, Family):
- return safe_getattr(obj, name, *defargs)
-
- for base_class in obj.__mro__:
- try:
- prop = base_class.__dict__[name]
- except KeyError:
- continue
-
- if not isinstance(prop, classproperty):
- return safe_getattr(obj, name, *defargs)
-
- return prop
-
- return safe_getattr(obj, name, *defargs)
-
-
def setup(app):
"""Implicit Sphinx extension hook."""
app.connect('autodoc-process-docstring', pywikibot_docstring_fixups)
app.connect('autodoc-process-docstring', pywikibot_script_docstring_fixups)
- app.add_autodoc_attrgetter(type, pywikibot_family_classproperty_getattr)
autoclass_content = 'both'
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1095306?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ifd181805257c8e484eb3e4bce21077afa3f2aa5a
Gerrit-Change-Number: 1095306
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]