|
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')) |
|
61 | 58 |
|
62 | 59 | # General substitutions. |
63 | 60 | project = 'Python' |
64 | | -if sphinx.version_info[:2] >= (8, 1): |
65 | | - copyright = "2001-%Y, Python Software Foundation" |
66 | | -else: |
67 | | - copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation" |
| 61 | +copyright = "2001-%Y, Python Software Foundation" |
68 | 62 |
|
69 | 63 | # We look for the Include/patchlevel.h file in the current Python source tree |
70 | 64 | # and replace the values accordingly. |
|
85 | 79 | highlight_language = 'python3' |
86 | 80 |
|
87 | 81 | # Minimum version of sphinx required |
88 | | -needs_sphinx = '7.2.6' |
| 82 | +# Keep this version in sync with ``Doc/requirements.txt``. |
| 83 | +needs_sphinx = '8.1.3' |
89 | 84 |
|
90 | 85 | # Create table of contents entries for domain objects (e.g. functions, classes, |
91 | 86 | # attributes, etc.). Default is True. |
|
350 | 345 |
|
351 | 346 | # This 'Last updated on:' timestamp is inserted at the bottom of every page. |
352 | 347 | html_last_updated_fmt = '%b %d, %Y (%H:%M UTC)' |
353 | | -if sphinx.version_info[:2] >= (8, 1): |
354 | | - html_last_updated_use_utc = True |
355 | | -else: |
356 | | - html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) |
357 | | - html_last_updated_fmt = time.strftime( |
358 | | - html_last_updated_fmt, time.gmtime(html_time) |
359 | | - ) |
| 348 | +html_last_updated_use_utc = True |
360 | 349 |
|
361 | 350 | # Path to find HTML templates to override theme |
362 | 351 | templates_path = ['tools/templates'] |
|
594 | 583 | } |
595 | 584 | extlinks_detect_hardcoded_links = True |
596 | 585 |
|
597 | | -if sphinx.version_info[:2] < (8, 1): |
598 | | - # Sphinx 8.1 has in-built CVE and CWE roles. |
599 | | - extlinks |= { |
600 | | - "cve": ( |
601 | | - "https://www.cve.org/CVERecord?id=CVE-%s", |
602 | | - "CVE-%s", |
603 | | - ), |
604 | | - "cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"), |
605 | | - } |
606 | | - |
607 | 586 | # Options for c_annotations extension |
608 | 587 | # ----------------------------------- |
609 | 588 |
|
|
0 commit comments