conf   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 99
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 30
dl 0
loc 99
rs 10
c 0
b 0
f 0
1
"""
2
Sphinx configuration.
3
"""
4
5
# noqa: INP001
6
# Configuration file for the Sphinx documentation builder.
7
#
8
# This file does only contain a selection of the most common options. For a
9
# full list see the documentation:
10
# http://www.sphinx-doc.org/en/master/config
11
12
# -- Path setup --------------------------------------------------------------
13
14
import datetime
15
import os
16
import sys
17
18
import tomllib
19
20
sys.path.insert(0, os.path.abspath("../.."))
21
22
on_rtd = os.environ.get("READTHEDOCS") == "True"
23
24
# -- Project information -----------------------------------------------------
25
26
with open("../pyproject.toml", "rb") as f:
27
    data = tomllib.load(f)
28
    project = data["project"]["name"]
29
    author = ",".join(author["name"] for author in data["project"]["authors"])
30
release = os.popen("hatch version").readline().strip()  # noqa: S605, S607
31
year = datetime.datetime.now(tz=datetime.UTC).date().year
32
copyright = f"2017-{year}, {author}"  # noqa: A001
33
34
# The short X.Y version
35
version = ".".join(release.split(".")[:2])
36
37
# -- General configuration ---------------------------------------------------
38
39
# If your documentation needs a minimal Sphinx version, state it here.
40
needs_sphinx = "8.1"
41
42
# Add any Sphinx extension module names here, as strings. They can be
43
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
44
# ones.
45
extensions = ["myst_parser", "sphinx_copybutton"]
46
47
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
48
copybutton_prompt_is_regexp = True
49
copybutton_line_continuation_character = "\\"
50
51
# Add any paths that contain templates here, relative to this directory.
52
templates_path = []
53
54
# The suffix(es) of source filenames.
55
# You can specify multiple suffix as a list of string:
56
source_suffix = {
57
    ".rst": "restructuredtext",
58
    ".md": "markdown",
59
}
60
61
62
# The master document.
63
master_doc = "index"
64
65
# The language for content by Sphinx. Refer to documentation
66
# for a list of supported languages.
67
#
68
# This is also used if you do content translation via gettext catalogs.
69
# Usually you set "language" from the command line for these cases.
70
language = "en"
71
72
# List of patterns, relative to source directory, that match files and
73
# directories to ignore when looking for source files.
74
# This pattern also affects html_static_path and html_extra_path.
75
exclude_patterns = ["images"]
76
77
# The name of the syntax highlighting style to use.
78
pygments_style = "sphinx"
79
80
81
# -- Options for HTML output -------------------------------------------------
82
83
# The theme to use for HTML and HTML Help pages.  See the documentation for
84
# a list of builtin themes.
85
#
86
87
html_theme = "sphinx_rtd_theme"
88
89
# Theme options are theme-specific and customize the look and feel of a theme
90
# further.  For a list of options available for each theme, see the
91
# documentation.
92
#
93
# html_theme_options = {}
94
95
# Add any paths that contain custom static files (such as style sheets) here,
96
# relative to this directory. They are copied after the builtin static files,
97
# so a file named "default.css" will overwrite the builtin "default.css".
98
html_static_path = []
99