conf   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 23
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A find() 0 2 1
1
"""
2
Sphinx config file for Tyrannosaurus.
3
4
Uses several extensions to get API docs and sourcecode.
5
https://www.sphinx-doc.org/en/master/usage/configuration.html
6
"""
7
8
from pathlib import Path
9
10
import tomlkit
11
12
root = Path(__file__).parent.parent.absolute()
13
toml = tomlkit.loads((root / "pyproject.toml").read_text(encoding="utf8"))
14
15
16
def find(key: str) -> str:
17
    return str(toml["tool"]["poetry"][key])
18
19
20
language = None
21
project = find("name")
22
version = find("version")
23
release = find("version")
24
author = ", ".join(find("authors"))
25
copyright = "Copyright (2020)"
26
27
28
extensions = [
29
    "autoapi.extension",
30
    "sphinx.ext.napoleon",
31
    "sphinx_rtd_theme",
32
    "sphinxcontrib.mermaid",
33
]
34
autoapi_type = "python"
35
autoapi_dirs = [str(root / project)]
36
master_doc = "index"
37
38
39
exclude_patterns = ["_build", "Thumbs.db", ".*", "~*", "*~", "*#"]
40
html_theme = "sphinx_rtd_theme"
41