File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515sys .path .append (os .path .abspath ('tools/extensions' ))
1616sys .path .append (os .path .abspath ('includes' ))
1717
18- # Python specific content from Doc/Tools/extensions/pyspecific.py
19- from pyspecific import SOURCE_URI
18+ from patchlevel import get_header_version_info
2019
2120# General configuration
2221# ---------------------
555554 r'https://unix.org/version2/whatsnew/lp64_wp.html' ,
556555]
557556
557+
558558# Options for sphinx.ext.extlinks
559559# -------------------------------
560560
561+ v = get_header_version_info ()
562+ branch = "main" if v .releaselevel == "alpha" else f"{ v .major } .{ v .minor } "
563+
561564# This config is a dictionary of external sites,
562565# mapping unique short aliases to a base URL and a prefix.
563566# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
564567extlinks = {
565568 "oss-fuzz" : ("https://issues.oss-fuzz.com/issues/%s" , "#%s" ),
566569 "pypi" : ("https://pypi.org/project/%s/" , "%s" ),
567- "source" : (SOURCE_URI , "%s" ),
570+ "source" : (f"https://github.com/python/cpython/tree/ { branch } /%s" , "%s" ),
568571}
569572extlinks_detect_hardcoded_links = True
570573
Original file line number Diff line number Diff line change 1010"""
1111
1212import re
13- import io
14- from os import getenv , path
1513
16- from docutils import nodes
17- from docutils .parsers .rst import directives
18- from docutils .utils import unescape
1914from sphinx import addnodes
20- from sphinx .domains .python import PyFunction , PyMethod , PyModule
21- from sphinx .locale import _ as sphinx_gettext
22- from sphinx .util .docutils import SphinxDirective
15+ from sphinx .domains .python import PyFunction , PyMethod
2316
24- # Used in conf.py and updated here by python/release-tools/run_release.py
25- SOURCE_URI = 'https://github.com/python/cpython/tree/main/%s'
2617
2718class PyAwaitableMixin (object ):
2819 def handle_signature (self , sig , signode ):
You can’t perform that action at this time.
0 commit comments