conf   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 92
Duplicated Lines 0 %

Importance

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