[4.0.x] Refs #33476 -- Reformatted code with Black.

Backport of 9c19aff7c7 from main.
This commit is contained in:
django-bot 2022-02-08 12:09:55 +01:00 committed by Mariusz Felisiak
parent e73ce08888
commit 6a682b38e7
1985 changed files with 137777 additions and 94571 deletions

View file

@ -32,13 +32,13 @@ sys.path.append(abspath(join(dirname(__file__), "_ext")))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.6.0'
needs_sphinx = "1.6.0"
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"djangodocs",
'sphinx.ext.extlinks',
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx.ext.autosectionlabel",
@ -53,35 +53,35 @@ autosectionlabel_maxdepth = 2
# Linkcheck settings.
linkcheck_ignore = [
# Special-use addresses and domain names. (RFC 6761/6890)
r'^https?://(?:127\.0\.0\.1|\[::1\])(?::\d+)?/',
r'^https?://(?:[^/\.]+\.)*example\.(?:com|net|org)(?::\d+)?/',
r'^https?://(?:[^/\.]+\.)*(?:example|invalid|localhost|test)(?::\d+)?/',
r"^https?://(?:127\.0\.0\.1|\[::1\])(?::\d+)?/",
r"^https?://(?:[^/\.]+\.)*example\.(?:com|net|org)(?::\d+)?/",
r"^https?://(?:[^/\.]+\.)*(?:example|invalid|localhost|test)(?::\d+)?/",
# Pages that are inaccessible because they require authentication.
r'^https://github\.com/[^/]+/[^/]+/fork',
r'^https://code\.djangoproject\.com/github/login',
r'^https://code\.djangoproject\.com/newticket',
r'^https://(?:code|www)\.djangoproject\.com/admin/',
r'^https://www\.djangoproject\.com/community/add/blogs/',
r'^https://www\.google\.com/webmasters/tools/ping',
r'^https://search\.google\.com/search-console/welcome',
r"^https://github\.com/[^/]+/[^/]+/fork",
r"^https://code\.djangoproject\.com/github/login",
r"^https://code\.djangoproject\.com/newticket",
r"^https://(?:code|www)\.djangoproject\.com/admin/",
r"^https://www\.djangoproject\.com/community/add/blogs/",
r"^https://www\.google\.com/webmasters/tools/ping",
r"^https://search\.google\.com/search-console/welcome",
# Fragments used to dynamically switch content or populate fields.
r'^https://web\.libera\.chat/#',
r'^https://github\.com/[^#]+#L\d+-L\d+$',
r'^https://help\.apple\.com/itc/podcasts_connect/#/itc',
r"^https://web\.libera\.chat/#",
r"^https://github\.com/[^#]+#L\d+-L\d+$",
r"^https://help\.apple\.com/itc/podcasts_connect/#/itc",
# Anchors on certain pages with missing a[name] attributes.
r'^https://tools\.ietf\.org/html/rfc1123\.html#section-',
r"^https://tools\.ietf\.org/html/rfc1123\.html#section-",
]
# Spelling check needs an additional module that is not installed by default.
# Add it only if spelling check is requested so docs can be generated without it.
if 'spelling' in sys.argv:
if "spelling" in sys.argv:
extensions.append("sphinxcontrib.spelling")
# Spelling language.
spelling_lang = 'en_US'
spelling_lang = "en_US"
# Location of word list.
spelling_word_list_filename = 'spelling_wordlist'
spelling_word_list_filename = "spelling_wordlist"
spelling_warning = True
@ -89,17 +89,17 @@ spelling_warning = True
# templates_path = []
# The suffix of source filenames.
source_suffix = '.txt'
source_suffix = ".txt"
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'contents'
master_doc = "contents"
# General substitutions.
project = 'Django'
copyright = 'Django Software Foundation and contributors'
project = "Django"
copyright = "Django Software Foundation and contributors"
# The version info for the project you're documenting, acts as replacement for
@ -107,31 +107,32 @@ copyright = 'Django Software Foundation and contributors'
# built documents.
#
# The short X.Y version.
version = '4.0'
version = "4.0"
# The full version, including alpha/beta/rc tags.
try:
from django import VERSION, get_version
except ImportError:
release = version
else:
def django_release():
pep440ver = get_version()
if VERSION[3:5] == ('alpha', 0) and 'dev' not in pep440ver:
return pep440ver + '.dev'
if VERSION[3:5] == ("alpha", 0) and "dev" not in pep440ver:
return pep440ver + ".dev"
return pep440ver
release = django_release()
# The "development version" of Django
django_next_version = '4.1'
django_next_version = "4.1"
extlinks = {
'bpo': ('https://bugs.python.org/issue%s', 'bpo-'),
'commit': ('https://github.com/django/django/commit/%s', ''),
'cve': ('https://nvd.nist.gov/vuln/detail/CVE-%s', 'CVE-'),
"bpo": ("https://bugs.python.org/issue%s", "bpo-"),
"commit": ("https://github.com/django/django/commit/%s", ""),
"cve": ("https://nvd.nist.gov/vuln/detail/CVE-%s", "CVE-"),
# A file or directory. GitHub redirects from blob to tree if needed.
'source': ('https://github.com/django/django/blob/main/%s', ''),
'ticket': ('https://code.djangoproject.com/ticket/%s', '#'),
"source": ("https://github.com/django/django/blob/main/%s", ""),
"ticket": ("https://code.djangoproject.com/ticket/%s", "#"),
}
# The language for content autogenerated by Sphinx. Refer to documentation
@ -139,17 +140,17 @@ extlinks = {
# language = None
# Location for .po/.mo translation files used when language is set
locale_dirs = ['locale/']
locale_dirs = ["locale/"]
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
today_fmt = "%B %d, %Y"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', '_theme', 'requirements.txt']
exclude_patterns = ["_build", "_theme", "requirements.txt"]
# The reST default role (used for this markup: `text`) to use for all documents.
default_role = "default-role-error"
@ -166,21 +167,21 @@ add_module_names = False
show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'trac'
pygments_style = "trac"
# Links to Python's docs should reference the most recent version of the 3.x
# branch, which is located at this URL.
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
'psycopg2': ('https://www.psycopg.org/docs/', None),
"python": ("https://docs.python.org/3/", None),
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
"psycopg2": ("https://www.psycopg.org/docs/", None),
}
# Python's docs don't change every week.
intersphinx_cache_limit = 90 # days
# The 'versionadded' and 'versionchanged' directives are overridden.
suppress_warnings = ['app.add_directive']
suppress_warnings = ["app.add_directive"]
# -- Options for HTML output ---------------------------------------------------
@ -219,7 +220,7 @@ html_theme_path = ["_theme"]
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = "%b %d, %Y"
# Content template for the index page.
# html_index = ''
@ -258,7 +259,7 @@ html_additional_pages = {}
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'Djangodoc'
htmlhelp_basename = "Djangodoc"
modindex_common_prefix = ["django."]
@ -273,11 +274,11 @@ rst_epilog = """
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
'preamble': (
'\\DeclareUnicodeCharacter{2264}{\\ensuremath{\\le}}'
'\\DeclareUnicodeCharacter{2265}{\\ensuremath{\\ge}}'
'\\DeclareUnicodeCharacter{2665}{[unicode-heart]}'
'\\DeclareUnicodeCharacter{2713}{[unicode-checkmark]}'
"preamble": (
"\\DeclareUnicodeCharacter{2264}{\\ensuremath{\\le}}"
"\\DeclareUnicodeCharacter{2265}{\\ensuremath{\\ge}}"
"\\DeclareUnicodeCharacter{2665}{[unicode-heart]}"
"\\DeclareUnicodeCharacter{2713}{[unicode-checkmark]}"
),
}
@ -285,8 +286,13 @@ latex_elements = {
# (source start file, target name, title, author, document class [howto/manual]).
# latex_documents = []
latex_documents = [
('contents', 'django.tex', 'Django Documentation',
'Django Software Foundation', 'manual'),
(
"contents",
"django.tex",
"Django Documentation",
"Django Software Foundation",
"manual",
),
]
# The name of an image file (relative to this directory) to place at the top of
@ -314,31 +320,41 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(
'ref/django-admin',
'django-admin',
'Utility script for the Django web framework',
['Django Software Foundation'],
1
)]
man_pages = [
(
"ref/django-admin",
"django-admin",
"Utility script for the Django web framework",
["Django Software Foundation"],
1,
)
]
# -- Options for Texinfo output ------------------------------------------------
# List of tuples (startdocname, targetname, title, author, dir_entry,
# description, category, toctree_only)
texinfo_documents = [(
master_doc, "django", "", "", "Django",
"Documentation of the Django framework", "Web development", False
)]
texinfo_documents = [
(
master_doc,
"django",
"",
"",
"Django",
"Documentation of the Django framework",
"Web development",
False,
)
]
# -- Options for Epub output ---------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
epub_author = 'Django Software Foundation'
epub_publisher = 'Django Software Foundation'
epub_author = "Django Software Foundation"
epub_publisher = "Django Software Foundation"
epub_copyright = copyright
# The basename for the epub file. It defaults to the project name.
@ -348,7 +364,7 @@ epub_copyright = copyright
# for small screen space, using the same theme for HTML and epub output is
# usually not wise. This defaults to 'epub', a theme designed to save visual
# space.
epub_theme = 'djangodocs-epub'
epub_theme = "djangodocs-epub"
# The language of the text. It defaults to the language option
# or en if the language is not set.
@ -365,7 +381,7 @@ epub_theme = 'djangodocs-epub'
# epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
epub_cover = ('', 'epub-cover.html')
epub_cover = ("", "epub-cover.html")
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
# epub_guide = ()