|
5 | 5 | # stdlib
|
6 | 6 | import os
|
7 | 7 | import re
|
8 |
| -import sys |
9 | 8 |
|
10 |
| -sys.path.append(os.path.abspath('.')) |
11 |
| -sys.path.append(os.path.abspath("..")) |
| 9 | +# 3rd party |
| 10 | +from sphinx_pyproject import SphinxConfig |
12 | 11 |
|
13 |
| -# this package |
14 |
| -from __pkginfo__ import __version__ |
| 12 | +config = SphinxConfig() |
15 | 13 |
|
16 | 14 | github_username = "python-coincidence"
|
17 | 15 | github_repository = "tox-recreate-hook"
|
18 |
| -github_url = f"https://github.com/{github_username}/{github_repository}" |
19 |
| - |
20 |
| -rst_prolog = f""".. |pkgname| replace:: tox-recreate-hook |
21 |
| -.. |pkgname2| replace:: ``tox-recreate-hook`` |
22 |
| -.. |browse_github| replace:: `Browse the GitHub Repository <{github_url}>`__ |
23 |
| -""" |
24 |
| - |
25 | 16 | author = "Dominic Davis-Foster"
|
26 |
| -project = "tox-recreate-hook".replace('_', '-') |
27 |
| -slug = re.sub(r'\W+', '-', project.lower()) |
28 |
| -release = version = __version__ |
29 |
| -copyright = "2021 Dominic Davis-Foster" # pylint: disable=redefined-builtin |
| 17 | +project = "tox-recreate-hook" |
| 18 | +copyright = "2021 Dominic Davis-Foster" |
30 | 19 | language = "en"
|
31 | 20 | package_root = "tox_recreate_hook"
|
32 |
| - |
33 | 21 | extensions = [
|
34 | 22 | "sphinx_toolbox",
|
35 | 23 | "sphinx_toolbox.more_autodoc",
|
|
50 | 38 | "sphinx_debuginfo",
|
51 | 39 | "seed_intersphinx_mapping",
|
52 | 40 | ]
|
53 |
| - |
54 | 41 | sphinxemoji_style = "twemoji"
|
55 |
| -todo_include_todos = bool(os.environ.get("SHOW_TODOS", 0)) |
56 | 42 | gitstamp_fmt = "%d %b %Y"
|
57 |
| - |
58 | 43 | templates_path = ["_templates"]
|
59 | 44 | html_static_path = ["_static"]
|
60 | 45 | source_suffix = ".rst"
|
61 | 46 | master_doc = "index"
|
62 | 47 | suppress_warnings = ["image.nonlocal_uri"]
|
63 | 48 | pygments_style = "default"
|
64 |
| - |
65 |
| -intersphinx_mapping = { |
66 |
| - "python": ("https://docs.python.org/3/", None), |
67 |
| - "sphinx": ("https://www.sphinx-doc.org/en/stable/", None), |
68 |
| - "tox": ("https://tox.readthedocs.io/en/latest/", None), |
69 |
| - } |
70 |
| - |
71 | 49 | html_theme = "furo"
|
72 |
| -html_theme_options = { |
73 |
| - "light_css_variables": { |
74 |
| - "toc-title-font-size": "12pt", |
75 |
| - "toc-font-size": "12pt", |
76 |
| - "admonition-font-size": "12pt", |
77 |
| - }, |
78 |
| - "dark_css_variables": { |
79 |
| - "toc-title-font-size": "12pt", |
80 |
| - "toc-font-size": "12pt", |
81 |
| - "admonition-font-size": "12pt", |
82 |
| - }, |
83 |
| - } |
84 | 50 | html_theme_path = ["../.."]
|
85 |
| -html_show_sourcelink = True # True will show link to source |
86 |
| - |
87 |
| -html_context = {} |
88 |
| -htmlhelp_basename = slug |
89 |
| - |
90 |
| -latex_documents = [("index", f'{slug}.tex', project, author, "manual")] |
91 |
| -man_pages = [("index", slug, project, [author], 1)] |
92 |
| -texinfo_documents = [("index", slug, project, author, slug, project, "Miscellaneous")] |
93 |
| - |
94 |
| -toctree_plus_types = { |
| 51 | +html_show_sourcelink = True |
| 52 | +toctree_plus_types = [ |
95 | 53 | "class",
|
96 |
| - "function", |
97 |
| - "method", |
| 54 | + "confval", |
98 | 55 | "data",
|
| 56 | + "directive", |
99 | 57 | "enum",
|
| 58 | + "exception", |
100 | 59 | "flag",
|
101 |
| - "confval", |
102 |
| - "directive", |
103 |
| - "role", |
104 |
| - "confval", |
| 60 | + "function", |
| 61 | + "method", |
| 62 | + "namedtuple", |
105 | 63 | "protocol",
|
| 64 | + "role", |
106 | 65 | "typeddict",
|
107 |
| - "namedtuple", |
108 |
| - "exception", |
109 |
| - } |
110 |
| - |
| 66 | + ] |
111 | 67 | add_module_names = False
|
112 | 68 | hide_none_rtype = True
|
113 | 69 | all_typevars = True
|
114 | 70 | overloads_location = "bottom"
|
115 | 71 | documentation_summary = "(experimental) Allows hooks to be defined which are called when recreating a tox testenv."
|
116 |
| - |
117 |
| -autodoc_exclude_members = [ # Exclude "standard" methods. |
| 72 | +autodoc_exclude_members = [ |
118 | 73 | "__dict__",
|
119 | 74 | "__class__",
|
120 | 75 | "__dir__",
|
|
132 | 87 | "__abstractmethods__",
|
133 | 88 | "__hash__",
|
134 | 89 | ]
|
| 90 | + |
| 91 | +github_url = f"https://github.com/{github_username}/{github_repository}" |
| 92 | + |
| 93 | +rst_prolog = f""".. |pkgname| replace:: tox-recreate-hook |
| 94 | +.. |pkgname2| replace:: ``tox-recreate-hook`` |
| 95 | +.. |browse_github| replace:: `Browse the GitHub Repository <{github_url}>`__ |
| 96 | +""" |
| 97 | + |
| 98 | +slug = re.sub(r'\W+', '-', project.lower()) |
| 99 | +release = version = config.version |
| 100 | + |
| 101 | +todo_include_todos = bool(os.environ.get("SHOW_TODOS", 0)) |
| 102 | + |
| 103 | +intersphinx_mapping = { |
| 104 | + "python": ("https://docs.python.org/3/", None), |
| 105 | + "sphinx": ("https://www.sphinx-doc.org/en/stable/", None), |
| 106 | + "tox": ("https://tox.readthedocs.io/en/latest/", None), |
| 107 | + } |
| 108 | + |
| 109 | +html_theme_options = { |
| 110 | + "light_css_variables": { |
| 111 | + "toc-title-font-size": "12pt", |
| 112 | + "toc-font-size": "12pt", |
| 113 | + "admonition-font-size": "12pt", |
| 114 | + }, |
| 115 | + "dark_css_variables": { |
| 116 | + "toc-title-font-size": "12pt", |
| 117 | + "toc-font-size": "12pt", |
| 118 | + "admonition-font-size": "12pt", |
| 119 | + }, |
| 120 | + } |
| 121 | + |
| 122 | +html_context = {} |
| 123 | +htmlhelp_basename = slug |
| 124 | + |
| 125 | +latex_documents = [("index", f'{slug}.tex', project, author, "manual")] |
| 126 | +man_pages = [("index", slug, project, [author], 1)] |
| 127 | +texinfo_documents = [("index", slug, project, author, slug, project, "Miscellaneous")] |
| 128 | + |
| 129 | +toctree_plus_types = set(toctree_plus_types) |
| 130 | + |
135 | 131 | autodoc_default_options = {
|
136 | 132 | "members": None, # Include all members (methods).
|
137 | 133 | "special-members": None,
|
|
0 commit comments