[Python-checkins] gh-92448: Update the documentation builder to render the GitHub issue. (GH-92449)

miss-islington webhook-mailer at python.org
Sun May 8 09:05:05 EDT 2022


https://github.com/python/cpython/commit/d0d22ca9fb6afc3f01d1d2dc18a5e1eaba2988fa
commit: d0d22ca9fb6afc3f01d1d2dc18a5e1eaba2988fa
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-05-08T06:05:01-07:00
summary:

gh-92448: Update the documentation builder to render the GitHub issue. (GH-92449)

(cherry picked from commit 45e1721d100bab09510ccf9da49f14ca5cc268f4)

Co-authored-by: Dong-hee Na <donghee.na at python.org>

files:
M Doc/tools/extensions/pyspecific.py
M Misc/NEWS.d/3.10.0a6.rst
M Misc/NEWS.d/3.10.0a7.rst
M Misc/NEWS.d/3.10.0b1.rst
M Misc/NEWS.d/3.11.0a1.rst
M Misc/NEWS.d/3.11.0b1.rst
M Misc/NEWS.d/3.7.0a3.rst
M Misc/NEWS.d/3.8.0a1.rst
M Misc/NEWS.d/3.9.0a1.rst

diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index b02e31dc88e5c..bdcfe9ac1c23d 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -429,7 +429,8 @@ def run(self):
 
 # Support for including Misc/NEWS
 
-issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)')
+issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)', re.I)
+gh_issue_re = re.compile('(?:gh-issue-|gh-)([0-9]+)', re.I)
 whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$")
 
 
@@ -456,9 +457,9 @@ def run(self):
             text = 'The NEWS file is not available.'
             node = nodes.strong(text, text)
             return [node]
-        content = issue_re.sub(r'`bpo-\1 <https://bugs.python.org/'
-                               r'issue?@action=redirect&bpo=\1>`__',
-                               content)
+        content = issue_re.sub(r':issue:`\1`', content)
+        # Fallback handling for the GitHub issue
+        content = gh_issue_re.sub(r':gh:`\1`', content)
         content = whatsnew_re.sub(r'\1', content)
         # remove first 3 lines as they are the main heading
         lines = ['.. default-role:: obj', ''] + content.splitlines()[3:]
diff --git a/Misc/NEWS.d/3.10.0a6.rst b/Misc/NEWS.d/3.10.0a6.rst
index a4ee9ae098bd9..803df6f51ce62 100644
--- a/Misc/NEWS.d/3.10.0a6.rst
+++ b/Misc/NEWS.d/3.10.0a6.rst
@@ -232,7 +232,7 @@ now result in :exc:`MemoryError`. Patch by Erlend E. Aasland.
 .. section: Library
 
 Fix segfault in :meth:`sqlite3.Connection.backup` if no argument was
-provided. The regression was introduced by GH-23838. Patch by Erlend E.
+provided. The regression was introduced by PR 23838. Patch by Erlend E.
 Aasland.
 
 ..
diff --git a/Misc/NEWS.d/3.10.0a7.rst b/Misc/NEWS.d/3.10.0a7.rst
index 7e9cb77266bd9..286d0a8a7e919 100644
--- a/Misc/NEWS.d/3.10.0a7.rst
+++ b/Misc/NEWS.d/3.10.0a7.rst
@@ -574,7 +574,7 @@ raised. Patch by Erlend E. Aasland.
 .. nonce: t9XEkQ
 .. section: Library
 
-Fix a regression introduced in GH-24562, where an empty bytestring was
+Fix a regression introduced in PR 24562, where an empty bytestring was
 fetched as ``None`` instead of ``b''`` in :mod:`sqlite3`. Patch by Mariusz
 Felisiak.
 
diff --git a/Misc/NEWS.d/3.10.0b1.rst b/Misc/NEWS.d/3.10.0b1.rst
index 83ba504d04342..2a3d358edde90 100644
--- a/Misc/NEWS.d/3.10.0b1.rst
+++ b/Misc/NEWS.d/3.10.0b1.rst
@@ -941,7 +941,7 @@ result from ``entry_points()`` as deprecated.
 
 ..
 
-.. bpo: 47383
+.. gh: 47383
 .. date: 2021-04-08-19-32-26
 .. nonce: YI1hdL
 .. section: Library
@@ -1001,7 +1001,7 @@ some :mod:`dataclasses`.
 
 Fix :mod:`sqlite3` regression for zero-sized blobs with converters, where
 ``b""`` was returned instead of ``None``. The regression was introduced by
-GH-24723. Patch by Erlend E. Aasland.
+PR 24723. Patch by Erlend E. Aasland.
 
 ..
 
diff --git a/Misc/NEWS.d/3.11.0a1.rst b/Misc/NEWS.d/3.11.0a1.rst
index fa30c693c34c1..33841d9e4e39b 100644
--- a/Misc/NEWS.d/3.11.0a1.rst
+++ b/Misc/NEWS.d/3.11.0a1.rst
@@ -1597,7 +1597,7 @@ use map function instead of genexpr in capwords.
 .. section: Library
 
 Fix typo: ``importlib.find_loader`` is really slated for removal in Python
-3.12 not 3.10, like the others in GH-25169.
+3.12 not 3.10, like the others in PR 25169.
 
 Patch by Hugo van Kemenade.
 
diff --git a/Misc/NEWS.d/3.11.0b1.rst b/Misc/NEWS.d/3.11.0b1.rst
index 64c88c66ce50e..0def806185e5a 100644
--- a/Misc/NEWS.d/3.11.0b1.rst
+++ b/Misc/NEWS.d/3.11.0b1.rst
@@ -570,7 +570,7 @@ planned). Patch by Alex Waygood.
 
 ..
 
-.. bpo: 78157
+.. gh: 78157
 .. date: 2022-05-05-20-40-45
 .. nonce: IA_9na
 .. section: Library
@@ -1288,7 +1288,7 @@ Deprecate the chunk module.
 
 ..
 
-.. bpo: 91498
+.. gh: 91498
 .. date: 2022-04-10-08-39-44
 .. nonce: 8oII92
 .. section: Library
diff --git a/Misc/NEWS.d/3.7.0a3.rst b/Misc/NEWS.d/3.7.0a3.rst
index 067720efa516e..6576c1fadbff6 100644
--- a/Misc/NEWS.d/3.7.0a3.rst
+++ b/Misc/NEWS.d/3.7.0a3.rst
@@ -288,7 +288,7 @@ by Nir Soffer.
 
 ..
 
-.. bpo: 321010
+.. bpo: 32101
 .. date: 2017-11-29-00-42-47
 .. nonce: -axD5l
 .. section: Library
diff --git a/Misc/NEWS.d/3.8.0a1.rst b/Misc/NEWS.d/3.8.0a1.rst
index 5cd3fa32105c2..09b858d250c33 100644
--- a/Misc/NEWS.d/3.8.0a1.rst
+++ b/Misc/NEWS.d/3.8.0a1.rst
@@ -4617,7 +4617,7 @@ Based on patch by c-fos.
 .. section: Library
 
 Remove HMAC default to md5 marked for removal in 3.8 (removal originally
-planned in 3.6, bump to 3.8 in gh-7062).
+planned in 3.6, bump to 3.8 in PR 7062).
 
 ..
 
diff --git a/Misc/NEWS.d/3.9.0a1.rst b/Misc/NEWS.d/3.9.0a1.rst
index a9b6694c133f1..45f232f1948d5 100644
--- a/Misc/NEWS.d/3.9.0a1.rst
+++ b/Misc/NEWS.d/3.9.0a1.rst
@@ -1335,7 +1335,7 @@ module on POSIX systems.
 .. nonce: 9TWMlz
 .. section: Library
 
-Revert GH-15522, which introduces a regression in
+Revert PR 15522, which introduces a regression in
 :meth:`mimetypes.guess_type` due to improper handling of filenames as urls.
 
 ..



More information about the Python-checkins mailing list