FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge branch '3.7' into backport-sqlite-converter-segfault-3.7 · python/cpython@fe0d218 · GitHub

/ cpython Public

Commit fe0d218

Browse files
authored
Merge branch '3.7' into backport-sqlite-converter-segfault-3.7
2 parents d52fd31 + aebbd75 commit fe0d218

6 files changed

Lines changed: 35 additions & 8 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Check for source changes
2222
id: check
2323
run: |
24-
if [ -z "GITHUB_BASE_REF" ]; then
24+
if [ -z "$GITHUB_BASE_REF" ]; then
2525
echo '::set-output name=run_tests::true'
2626
else
2727
git fetch origin $GITHUB_BASE_REF --depth=1

‎Doc/tools/extensions/pyspecific.py‎

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
import suspicious
3636

3737

38-
ISSUE_URI = 'https://bugs.python.org/issue%s'
38+
ISSUE_URI = 'https://bugs.python.org/issue?@action=redirect&bpo=%s'
39+
GH_ISSUE_URI = 'https://github.com/python/cpython/issues/%s'
3940
SOURCE_URI = 'https://github.com/python/cpython/tree/3.7/%s'
4041

4142
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
@@ -81,11 +82,33 @@ def new_depart_literal_block(self, node):
8182

8283
def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
8384
issue = utils.unescape(text)
85+
# sanity check: there are no bpo issues within these two values
86+
if 47261 < int(issue) < 400000:
87+
msg = inliner.reporter.error(f'The BPO ID {text!r} seems too high -- '
88+
'use :gh:`...` for GitHub IDs', line=lineno)
89+
prb = inliner.problematic(rawtext, rawtext, msg)
90+
return [prb], [msg]
8491
text = 'bpo-' + issue
8592
refnode = nodes.reference(text, text, refuri=ISSUE_URI % issue)
8693
return [refnode], []
8794

8895

96+
# Support for marking up and linking to GitHub issues
97+
98+
def gh_issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
99+
issue = utils.unescape(text)
100+
# sanity check: all GitHub issues have ID >= 32426
101+
# even though some of them are also valid BPO IDs
102+
if int(issue) < 32426:
103+
msg = inliner.reporter.error(f'The GitHub ID {text!r} seems too low -- '
104+
'use :issue:`...` for BPO IDs', line=lineno)
105+
prb = inliner.problematic(rawtext, rawtext, msg)
106+
return [prb], [msg]
107+
text = 'gh-' + issue
108+
refnode = nodes.reference(text, text, refuri=GH_ISSUE_URI % issue)
109+
return [refnode], []
110+
111+
89112
# Support for linking to Python source files easily
90113

91114
def source_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
@@ -286,7 +309,8 @@ def run(self):
286309

287310
# Support for including Misc/NEWS
288311

289-
issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)')
312+
issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)', re.I)
313+
gh_issue_re = re.compile('(?:gh-issue-|gh-)([0-9]+)', re.I)
290314
whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$")
291315

292316

@@ -313,8 +337,9 @@ def run(self):
313337
text = 'The NEWS file is not available.'
314338
node = nodes.strong(text, text)
315339
return [node]
316-
content = issue_re.sub(r'`bpo-\1 <https://bugs.python.org/issue\1>`__',
317-
content)
340+
content = issue_re.sub(r':issue:`\1`', content)
341+
# Fallback handling for the GitHub issue
342+
content = gh_issue_re.sub(r':gh:`\1`', content)
318343
content = whatsnew_re.sub(r'\1', content)
319344
# remove first 3 lines as they are the main heading
320345
lines = ['.. default-role:: obj', ''] + content.splitlines()[3:]
@@ -430,6 +455,7 @@ def parse_pdb_command(env, sig, signode):
430455

431456
def setup(app):
432457
app.add_role('issue', issue_role)
458+
app.add_role('gh', gh_issue_role)
433459
app.add_role('source', source_role)
434460
app.add_directive('impl-detail', ImplementationDetail)
435461
app.add_directive('availability', Availability)

‎Misc/NEWS.d/3.7.0a3.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ by Nir Soffer.
289289

290290
..
291291
292-
.. bpo: 321010
292+
.. bpo: 32101
293293
.. date: 2017-11-29-00-42-47
294294
.. nonce: -axD5l
295295
.. section: Library

‎Misc/NEWS.d/3.7.5.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Prevent ctypes crash when handling arrays in structs/unions.
1313
.. nonce: 9TWMlz
1414
.. section: Library
1515
16-
Revert GH-15522, which introduces a regression in
16+
Revert PR 15522, which introduces a regression in
1717
:meth:`mimetypes.guess_type` due to improper handling of filenames as urls.
1818

1919
..

‎Misc/NEWS.d/3.7.7rc1.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Remove obsolete check for `__args__` in bdb.Bdb.format_stack_entry.
180180
.. section: Library
181181
182182
The original fix for bpo-27657, "Fix urlparse() with numeric paths"
183-
(GH-16839) included in 3.7.6, inadvertently introduced a behavior change
183+
(PR 16839) included in 3.7.6, inadvertently introduced a behavior change
184184
that broke several third-party packages relying on the original undefined
185185
parsing behavior. The change is reverted in 3.7.7, restoring the behavior of
186186
3.7.5 and earlier releases.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a new ``gh`` role to the documentation to link to GitHub issues.

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL