|
8 | 8 | from pathlib import Path |
9 | 9 |
|
10 | 10 | from setuptools_scm import get_version |
11 | | - |
12 | 11 | from sphinx.application import Sphinx |
13 | 12 | from sphinx.util.docutils import SphinxDirective |
14 | 13 |
|
15 | 14 | from myst_parser import __version__ |
16 | 15 |
|
17 | | - |
18 | 16 | # -- Path setup -------------------------------------------------------------- |
19 | 17 |
|
20 | 18 | PROJECT_ROOT_DIR = Path(__file__).parents[1].resolve() # pylint: disable=no-member |
21 | 19 | get_scm_version = partial(get_version, root=PROJECT_ROOT_DIR) |
22 | 20 | # -- Project information ----------------------------------------------------- |
23 | 21 |
|
24 | | -github_url = 'https://github.com' |
25 | | -github_repo_org = 'ansible' |
26 | | -github_repo_name = 'ansible-language-server' |
27 | | -github_repo_slug = f'{github_repo_org}/{github_repo_name}' |
28 | | -github_repo_url = f'{github_url}/{github_repo_slug}' |
29 | | -github_sponsors_url = f'{github_url}/sponsors' |
| 22 | +github_url = "https://github.com" |
| 23 | +github_repo_org = "ansible" |
| 24 | +github_repo_name = "ansible-language-server" |
| 25 | +github_repo_slug = f"{github_repo_org}/{github_repo_name}" |
| 26 | +github_repo_url = f"{github_url}/{github_repo_slug}" |
| 27 | +github_sponsors_url = f"{github_url}/sponsors" |
30 | 28 |
|
31 | 29 | project = "MyST Parser" |
32 | 30 | copyright = "2020, Executable Book Project" |
33 | 31 | author = "Executable Book Project" |
34 | 32 |
|
35 | 33 | # The short X.Y version |
36 | | -version = '.'.join( |
37 | | - get_scm_version( |
38 | | - local_scheme='no-local-version', |
39 | | - ).split('.')[:3], |
| 34 | +version = ".".join( |
| 35 | + get_scm_version(local_scheme="no-local-version",).split( |
| 36 | + "." |
| 37 | + )[:3], |
40 | 38 | ) |
41 | 39 |
|
42 | 40 | # The full version, including alpha/beta/rc tags |
|
54 | 52 | extensions = [ |
55 | 53 | "myst_parser", |
56 | 54 | "sphinx.ext.autodoc", |
57 | | - 'sphinx.ext.extlinks', |
| 55 | + "sphinx.ext.extlinks", |
58 | 56 | "sphinx.ext.intersphinx", |
59 | 57 | "sphinx.ext.viewcode", |
60 | 58 | "sphinxcontrib.bibtex", |
61 | 59 | "sphinx_panels", |
62 | 60 | "sphinxext.rediraffe", |
63 | 61 | "sphinxcontrib.mermaid", |
64 | 62 | "sphinxext.opengraph", |
65 | | - 'sphinxcontrib.towncrier', # provides `towncrier-draft-entries` directive |
| 63 | + "sphinxcontrib.towncrier", # provides `towncrier-draft-entries` directive |
66 | 64 | ] |
67 | 65 |
|
68 | 66 | # Add any paths that contain templates here, relative to this directory. |
|
72 | 70 | # directories to ignore when looking for source files. |
73 | 71 | # This pattern also affects html_static_path and html_extra_path. |
74 | 72 | exclude_patterns = [ |
75 | | - "_build", "Thumbs.db", ".DS_Store", |
76 | | - 'changelog-fragments.d/**', # Towncrier-managed change notes |
| 73 | + "_build", |
| 74 | + "Thumbs.db", |
| 75 | + ".DS_Store", |
| 76 | + "changelog-fragments.d/**", # Towncrier-managed change notes |
77 | 77 | ] |
78 | 78 |
|
79 | 79 |
|
|
121 | 121 | "tasklist", |
122 | 122 | ] |
123 | 123 | myst_substitutions = { |
124 | | - 'project': project, |
125 | | - 'release': release, |
126 | | - 'release_l': f'`{release}`', # Needed in draft changelog for spelling ext |
127 | | - 'version': version, |
| 124 | + "project": project, |
| 125 | + "release": release, |
| 126 | + "release_l": f"`{release}`", # Needed in draft changelog for spelling ext |
| 127 | + "version": version, |
128 | 128 | } |
129 | 129 | myst_heading_anchors = 2 |
130 | 130 | myst_footnote_transition = True |
|
142 | 142 |
|
143 | 143 | # -- Options for towncrier_draft extension ----------------------------------- |
144 | 144 |
|
145 | | -towncrier_draft_autoversion_mode = 'draft' # or: 'sphinx-version', 'sphinx-release' |
| 145 | +towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-version', 'sphinx-release' |
146 | 146 | towncrier_draft_include_empty = True |
147 | 147 | towncrier_draft_working_directory = PROJECT_ROOT_DIR |
148 | 148 | # Not yet supported: towncrier_draft_config_path = 'pyproject.toml' # relative to cwd |
@@ -186,11 +186,11 @@ def run_apidoc(app): |
186 | 186 | # -- Options for extlinks extension ------------------------------------------ |
187 | 187 |
|
188 | 188 | extlinks = { |
189 | | - 'issue': (f'{github_repo_url}/issues/%s', '#'), # noqa: WPS323 |
190 | | - 'pr': (f'{github_repo_url}/pull/%s', 'PR #'), # noqa: WPS323 |
191 | | - 'commit': (f'{github_repo_url}/commit/%s', ''), # noqa: WPS323 |
192 | | - 'gh': (f'{github_url}/%s', 'GitHub: '), # noqa: WPS323 |
193 | | - 'user': (f'{github_sponsors_url}/%s', '@'), # noqa: WPS323 |
| 189 | + "issue": (f"{github_repo_url}/issues/%s", "#"), # noqa: WPS323 |
| 190 | + "pr": (f"{github_repo_url}/pull/%s", "PR #"), # noqa: WPS323 |
| 191 | + "commit": (f"{github_repo_url}/commit/%s", ""), # noqa: WPS323 |
| 192 | + "gh": (f"{github_url}/%s", "GitHub: "), # noqa: WPS323 |
| 193 | + "user": (f"{github_sponsors_url}/%s", "@"), # noqa: WPS323 |
194 | 194 | } |
195 | 195 |
|
196 | 196 | intersphinx_mapping = { |
|
0 commit comments