From: Dmitry Shachnev Date: Thu, 25 Jun 2020 11:58:34 +0300 Subject: Use class-based directives to fix build with Sphinx 3.x --- nose/sphinx/pluginopts.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/nose/sphinx/pluginopts.py b/nose/sphinx/pluginopts.py index d2b284a..033297b 100644 --- a/nose/sphinx/pluginopts.py +++ b/nose/sphinx/pluginopts.py @@ -34,7 +34,7 @@ import os try: from docutils import nodes, utils from docutils.statemachine import ViewList - from docutils.parsers.rst import directives + from docutils.parsers.rst import convert_directive_function, directives except ImportError: pass # won't run anyway @@ -183,7 +183,14 @@ class Opt(object): def setup(app): + autoplugin_directive.content = True + autoplugin_directive.arguments = (1, 0, True) + autoplugin_directive.options = {'plugin': directives.unchanged} app.add_directive('autoplugin', - autoplugin_directive, 1, (1, 0, 1), - plugin=directives.unchanged) - app.add_directive('autohelp', autohelp_directive, 0, (0, 0, 1)) + convert_directive_function(autoplugin_directive)) + + autohelp_directive.content = False + autohelp_directive.arguments = (0, 0, True) + autohelp_directive.options = {} + app.add_directive('autohelp', + convert_directive_function(autohelp_directive))