|
9 | 9 | import importlib |
10 | 10 | import os |
11 | 11 | import sys |
12 | | -import time |
13 | | - |
14 | | -import sphinx |
15 | 12 |
|
16 | 13 | # Make our custom extensions available to Sphinx |
17 | 14 | sys.path.append(os.path.abspath('tools/extensions')) |
|
67 | 64 |
|
68 | 65 | # General substitutions. |
69 | 66 | project = 'Python' |
70 | | -if sphinx.version_info[:2] >= (8, 1): |
71 | | - copyright = "2001-%Y, Python Software Foundation" |
72 | | -else: |
73 | | - copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation" |
| 67 | +copyright = "2001-%Y, Python Software Foundation" |
74 | 68 |
|
75 | 69 | # We look for the Include/patchlevel.h file in the current Python source tree |
76 | 70 | # and replace the values accordingly. |
|
93 | 87 | highlight_language = 'python3' |
94 | 88 |
|
95 | 89 | # Minimum version of sphinx required |
96 | | -needs_sphinx = '7.2.6' |
| 90 | +# Keep this version in sync with ``Doc/requirements.txt``. |
| 91 | +needs_sphinx = '8.1.3' |
97 | 92 |
|
98 | 93 | # Create table of contents entries for domain objects (e.g. functions, classes, |
99 | 94 | # attributes, etc.). Default is True. |
|
372 | 367 |
|
373 | 368 | # This 'Last updated on:' timestamp is inserted at the bottom of every page. |
374 | 369 | html_last_updated_fmt = '%b %d, %Y (%H:%M UTC)' |
375 | | -if sphinx.version_info[:2] >= (8, 1): |
376 | | - html_last_updated_use_utc = True |
377 | | -else: |
378 | | - html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) |
379 | | - html_last_updated_fmt = time.strftime( |
380 | | - html_last_updated_fmt, time.gmtime(html_time) |
381 | | - ) |
| 370 | +html_last_updated_use_utc = True |
382 | 371 |
|
383 | 372 | # Path to find HTML templates to override theme |
384 | 373 | templates_path = ['tools/templates'] |
|
615 | 604 | } |
616 | 605 | extlinks_detect_hardcoded_links = True |
617 | 606 |
|
618 | | -if sphinx.version_info[:2] < (8, 1): |
619 | | - # Sphinx 8.1 has in-built CVE and CWE roles. |
620 | | - extlinks |= { |
621 | | - "cve": ( |
622 | | - "https://www.cve.org/CVERecord?id=CVE-%s", |
623 | | - "CVE-%s", |
624 | | - ), |
625 | | - "cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"), |
626 | | - } |
627 | | - |
628 | 607 | # Options for c_annotations extension |
629 | 608 | # ----------------------------------- |
630 | 609 |
|
|
0 commit comments