conf   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 108
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 46
dl 0
loc 108
rs 10
c 0
b 0
f 0
wmc 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A get_version() 0 7 2
1
# Configuration file for the Sphinx documentation builder.
2
#
3
# This file only contains a selection of the most common options. For a full
4
# list see the documentation:
5
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6
7
# -- Path setup --------------------------------------------------------------
8
9
# If extensions (or modules to document with autodoc) are in another directory,
10
# add these directories to sys.path here. If the directory is relative to the
11
# documentation root, use os.path.abspath to make it absolute, like shown here.
12
#
13
import os
14
import sys
15
16
import toml
17
18
19
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
20
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__name__), "..",)))
21
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__name__), "..", "networkx_query")))
22
23
24
# -- Project information -----------------------------------------------------
25
26
def get_version():
27
    """Return current project version from pyproject.toml."""
28
29
    toml_path = os.path.join(os.path.dirname(__file__), "..", "pyproject.toml")
30
    with open(toml_path, "r") as fopen:
31
        pyproject = toml.load(fopen)
32
    return pyproject["tool"]["poetry"]["version"]
33
34
35
project = 'networkx_query'
36
copyright = '2020, Jerome Guibert'
37
author = 'Jerome Guibert <[email protected]>'
38
39
# The full version, including alpha/beta/rc tags
40
release = get_version()
41
42
43
# -- General configuration ---------------------------------------------------
44
45
# Add any Sphinx extension module names here, as strings. They can be
46
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
47
# ones.
48
extensions = [
49
    "sphinx.ext.autodoc",
50
    "sphinx.ext.napoleon",
51
    "sphinx.ext.viewcode",
52
    "sphinx.ext.ifconfig",
53
    "sphinx.ext.autosummary",
54
    "m2r",
55
    "autodocsumm",
56
]
57
58
autoclass_content = "both"  # include both class docstring and __init__
59
autosummary_generate = True
60
61
# Napoleon settings
62
napoleon_google_docstring = True
63
napoleon_numpy_docstring = True
64
napoleon_include_init_with_doc = False
65
napoleon_include_private_with_doc = False
66
napoleon_include_special_with_doc = True
67
napoleon_use_admonition_for_examples = False
68
napoleon_use_admonition_for_notes = False
69
napoleon_use_admonition_for_references = False
70
napoleon_use_ivar = False
71
napoleon_use_param = True
72
napoleon_use_rtype = True
73
74
# autodocsumm settings
75
autodoc_default_options = {'autosummary': True}
76
77
# Autodoc Settings
78
autodoc_default_options = {"member-order": "bysource", "undoc-members": True, "members": True, "show-inheritance": True}
79
80
source_suffix = ['.rst', '.md']
81
82
# Autodoc Settings
83
autodoc_default_options = {"member-order": "bysource", "undoc-members": True}
84
85
# Add any paths that contain templates here, relative to this directory.
86
templates_path = ['_templates']
87
88
# List of patterns, relative to source directory, that match files and
89
# directories to ignore when looking for source files.
90
# This pattern also affects html_static_path and html_extra_path.
91
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
92
93
94
# -- Options for HTML output -------------------------------------------------
95
96
# The theme to use for HTML and HTML Help pages.  See the documentation for
97
# a list of builtin themes.
98
#
99
html_theme = "sphinx_rtd_theme"
100
101
# Add any paths that contain custom static files (such as style sheets) here,
102
# relative to this directory. They are copied after the builtin static files,
103
# so a file named "default.css" will overwrite the builtin "default.css".
104
html_static_path = ['_static']
105
106
# Set master doc
107
master_doc = "index"
108