1
0
mirror of https://github.com/django/django.git synced 2024-12-22 09:05:43 +00:00

Fixed docs build on Sphinx 8.1+.

Sphinx 8.1 added :cve: role, so there is no need to define it in Django:
- https://github.com/sphinx-doc/sphinx/pull/11781

This also changes used URL to the one used by Python and soonish to be
used by Sphinx itself:
- https://github.com/sphinx-doc/sphinx/pull/13006
This commit is contained in:
Mariusz Felisiak 2024-10-11 13:50:51 +02:00 committed by Sarah Boyce
parent 9423f8b476
commit 263f731919

View File

@ -13,6 +13,8 @@ import functools
import sys import sys
from os.path import abspath, dirname, join from os.path import abspath, dirname, join
from sphinx import version_info as sphinx_version
# Workaround for sphinx-build recursion limit overflow: # Workaround for sphinx-build recursion limit overflow:
# pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL) # pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL)
# RuntimeError: maximum recursion depth exceeded while pickling an object # RuntimeError: maximum recursion depth exceeded while pickling an object
@ -138,13 +140,15 @@ django_next_version = "5.2"
extlinks = { extlinks = {
"bpo": ("https://bugs.python.org/issue?@action=redirect&bpo=%s", "bpo-%s"), "bpo": ("https://bugs.python.org/issue?@action=redirect&bpo=%s", "bpo-%s"),
"commit": ("https://github.com/django/django/commit/%s", "%s"), "commit": ("https://github.com/django/django/commit/%s", "%s"),
"cve": ("https://nvd.nist.gov/vuln/detail/CVE-%s", "CVE-%s"),
"pypi": ("https://pypi.org/project/%s/", "%s"), "pypi": ("https://pypi.org/project/%s/", "%s"),
# A file or directory. GitHub redirects from blob to tree if needed. # A file or directory. GitHub redirects from blob to tree if needed.
"source": ("https://github.com/django/django/blob/main/%s", "%s"), "source": ("https://github.com/django/django/blob/main/%s", "%s"),
"ticket": ("https://code.djangoproject.com/ticket/%s", "#%s"), "ticket": ("https://code.djangoproject.com/ticket/%s", "#%s"),
} }
if sphinx_version < (8, 1):
extlinks["cve"] = ("https://www.cve.org/CVERecord?id=CVE-%s", "CVE-%s")
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
# language = None # language = None