File: conf.py

package info (click to toggle)
python-es-client 9.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 576 kB
  • sloc: python: 2,815; sh: 239; makefile: 17
file content (98 lines) | stat: -rw-r--r-- 2,991 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
"""Sphinx configuration for es_client documentation.

Configures Sphinx to generate documentation for the es_client package,
using autodoc, Napoleon, doctest, viewcode, and intersphinx extensions.
Imports metadata (__version__, __author__, __copyright__) from
es_client, leveraging module installation for ReadTheDocs. Sets up
GitHub integration for "Edit Source" links and supports Python 3.8-3.13.

Attributes:
    project: Project name ("es_client"). (str)
    author: Author name from es_client.__author__. (str)
    version: Major.minor version (e.g., "1.3"). (str)
    release: Full version (e.g., "1.3.0"). (str)
    html_theme: Theme for HTML output, defaults to "furo". (str)

Examples:
    >>> project
    'es_client'
    >>> author
    'Aaron Mildenstein'
    >>> version
    '1.3'
    >>> 'autodoc' in [ext.split('.')[-1] for ext in extensions]
    True
"""

# pylint: disable=C0103,E0401,W0622

# -- Imports and setup -----------------------------------------------------

from es_client import __author__, __copyright__, __version__

# -- Project information -----------------------------------------------------

project = "es_client"
github_user = "untergeek"
github_repo = "es_client"
github_branch = "master"
author = __author__
copyright = __copyright__
release = __version__
version = ".".join(release.split(".")[:2])

# -- General configuration ---------------------------------------------------

extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.doctest",
    "sphinx.ext.githubpages",
    "sphinx.ext.intersphinx",
    "sphinx.ext.napoleon",
    "sphinx.ext.viewcode",
]
napoleon_google_docstring = True
napoleon_numpy_docstring = False

templates_path = ["_templates"]
exclude_patterns = ["_build"]
source_suffix = ".rst"
master_doc = "index"

# -- Options for HTML output -------------------------------------------------

html_theme = "furo"

# Add "Edit Source" links into the template
html_context = {
    "display_github": True,
    "github_user": f"{github_user}",
    "github_repo": f"{github_repo}",
    "github_version": f"{github_branch}",
    "conf_py_path": "/docs/",  # Path in the checkout to the docs root
}

# -- Autodoc configuration ---------------------------------------------------

autoclass_content = "both"
autodoc_class_signature = "separated"
autodoc_default_options = {
    "members": True,
    "undoc-members": True,
    "show-inheritance": True,
}
autodoc_member_order = "bysource"
autodoc_typehints = "description"

# -- Intersphinx configuration -----------------------------------------------

intersphinx_mapping = {
    "python": ("https://docs.python.org/3.13", None),
    "elasticsearch9": ("https://elasticsearch-py.readthedocs.io/en/v9.1.1", None),
    "elastic-transport": (
        "https://elastic-transport-python.readthedocs.io/en/stable",
        None,
    ),
    "voluptuous": ("http://alecthomas.github.io/voluptuous/docs/_build/html", None),
    "click": ("https://click.palletsprojects.com/en/stable", None),
}