[Python-checkins] bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844)

Victor Stinner webhook-mailer at python.org
Wed Aug 12 15:49:50 EDT 2020


https://github.com/python/cpython/commit/423e77d6de497931585d1883805a9e3fa4096b0b
commit: 423e77d6de497931585d1883805a9e3fa4096b0b
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2020-08-12T21:49:22+02:00
summary:

bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844)

Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the
c_warn_on_allowed_pre_v3 option to make the documentation compatible
with Sphinx 2 and Sphinx 3.

files:
A Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst
M Doc/conf.py

diff --git a/Doc/conf.py b/Doc/conf.py
index bfb2a98fc63a2..079d17717f381 100644
--- a/Doc/conf.py
+++ b/Doc/conf.py
@@ -228,3 +228,13 @@
 
 # Relative filename of the reference count data file.
 refcount_file = 'data/refcounts.dat'
+
+# Sphinx 2 and Sphinx 3 compatibility
+# -----------------------------------
+
+# bpo-40204: Allow Sphinx 2 syntax in the C domain
+c_allow_pre_v3 = True
+
+# bpo-40204: Disable warnings on Sphinx 2 syntax of the C domain since the
+# documentation is built with -W (warnings treated as errors).
+c_warn_on_allowed_pre_v3 = False
diff --git a/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst b/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst
new file mode 100644
index 0000000000000..152f6c98b9004
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst
@@ -0,0 +1,3 @@
+Enable Sphinx 3.2 ``c_allow_pre_v3`` option and disable
+``c_warn_on_allowed_pre_v3`` option to make the documentation compatible
+with Sphinx 2 and Sphinx 3.



More information about the Python-checkins mailing list