[Python-checkins] bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827)

Miss Islington (bot) webhook-mailer at python.org
Tue Oct 16 02:46:43 EDT 2018


https://github.com/python/cpython/commit/514bbfc7fc4dcb868d4364632ad14c0533af154f
commit: 514bbfc7fc4dcb868d4364632ad14c0533af154f
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-10-15T23:46:38-07:00
summary:

bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827)

(cherry picked from commit e385d0661ecf8bc9ba95c4395d9a11262c2cbfec)

Co-authored-by: Stéphane Wirtel <stephane at wirtel.be>

files:
A Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst
M Doc/tools/extensions/pyspecific.py

diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index 4df292d1689d..a7f7797861bf 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -424,11 +424,9 @@ def setup(app):
     app.add_directive('deprecated-removed', DeprecatedRemoved)
     app.add_builder(PydocTopicsBuilder)
     app.add_builder(suspicious.CheckSuspiciousMarkupBuilder)
-    app.add_description_unit('opcode', 'opcode', '%s (opcode)',
-                             parse_opcode_signature)
-    app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)',
-                             parse_pdb_command)
-    app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
+    app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature)
+    app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command)
+    app.add_object_type('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
     app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
     app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
     app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction)
diff --git a/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst
new file mode 100644
index 000000000000..6341296663ae
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2018-10-13-07-39-57.bpo-34967.E40tFP.rst
@@ -0,0 +1,2 @@
+Use app.add_object_type() instead of the deprecated Sphinx function
+app.description_unit()



More information about the Python-checkins mailing list