|
9 | 9 | from pathlib import Path |
10 | 10 |
|
11 | 11 | from setuptools_scm import get_version |
12 | | - |
13 | 12 | from sphinx.application import Sphinx |
14 | 13 |
|
15 | | - |
16 | 14 | # -- Path setup -------------------------------------------------------------- |
17 | 15 |
|
18 | 16 | PROJECT_ROOT_DIR = Path(__file__).parents[1].resolve() # pylint: disable=no-member |
19 | 17 | get_scm_version = partial(get_version, root=PROJECT_ROOT_DIR) |
20 | 18 | # -- Project information ----------------------------------------------------- |
21 | 19 |
|
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' |
| 20 | +github_url = "https://github.com" |
| 21 | +github_repo_org = "ansible" |
| 22 | +github_repo_name = "ansible-language-server" |
| 23 | +github_repo_slug = f"{github_repo_org}/{github_repo_name}" |
| 24 | +github_repo_url = f"{github_url}/{github_repo_slug}" |
| 25 | +github_sponsors_url = f"{github_url}/sponsors" |
28 | 26 |
|
29 | 27 | project = "MyST Parser" |
30 | 28 | copyright = f"{date.today().year}, Executable Book Project" |
31 | 29 | author = "Executable Book Project" |
32 | 30 |
|
33 | 31 | # The short X.Y version |
34 | | -version = '.'.join( |
35 | | - get_scm_version( |
36 | | - local_scheme='no-local-version', |
37 | | - ).split('.')[:3], |
| 32 | +version = ".".join( |
| 33 | + get_scm_version(local_scheme="no-local-version",).split( |
| 34 | + "." |
| 35 | + )[:3], |
38 | 36 | ) |
39 | 37 |
|
40 | 38 | # The full version, including alpha/beta/rc tags |
|
52 | 50 | extensions = [ |
53 | 51 | "myst_parser", |
54 | 52 | "sphinx.ext.autodoc", |
55 | | - 'sphinx.ext.extlinks', |
| 53 | + "sphinx.ext.extlinks", |
56 | 54 | "sphinx.ext.intersphinx", |
57 | 55 | "sphinx.ext.viewcode", |
58 | 56 | "sphinx_design", |
59 | 57 | "sphinxext.rediraffe", |
60 | 58 | "sphinxcontrib.mermaid", |
61 | 59 | "sphinxext.opengraph", |
62 | | - 'sphinxcontrib.towncrier', # provides `towncrier-draft-entries` directive |
| 60 | + "sphinxcontrib.towncrier", # provides `towncrier-draft-entries` directive |
63 | 61 | ] |
64 | 62 |
|
65 | 63 | # Add any paths that contain templates here, relative to this directory. |
|
69 | 67 | # directories to ignore when looking for source files. |
70 | 68 | # This pattern also affects html_static_path and html_extra_path. |
71 | 69 | exclude_patterns = [ |
72 | | - "_build", "Thumbs.db", ".DS_Store", |
73 | | - 'changelog-fragments.d/**', # Towncrier-managed change notes |
| 70 | + "_build", |
| 71 | + "Thumbs.db", |
| 72 | + ".DS_Store", |
| 73 | + "changelog-fragments.d/**", # Towncrier-managed change notes |
74 | 74 | ] |
75 | 75 |
|
76 | 76 |
|
|
123 | 123 | ] |
124 | 124 | myst_number_code_blocks = ["typescript"] |
125 | 125 | myst_substitutions = { |
126 | | - 'project': project, |
127 | | - 'release': release, |
128 | | - 'release_l': f'`{release}`', # Needed in draft changelog for spelling ext |
129 | | - 'version': version, |
| 126 | + "project": project, |
| 127 | + "release": release, |
| 128 | + "release_l": f"`{release}`", # Needed in draft changelog for spelling ext |
| 129 | + "version": version, |
130 | 130 | } |
131 | 131 | myst_heading_anchors = 2 |
132 | 132 | myst_footnote_transition = True |
|
151 | 151 |
|
152 | 152 | # -- Options for towncrier_draft extension ----------------------------------- |
153 | 153 |
|
154 | | -towncrier_draft_autoversion_mode = 'draft' # or: 'sphinx-version', 'sphinx-release' |
| 154 | +towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-version', 'sphinx-release' |
155 | 155 | towncrier_draft_include_empty = True |
156 | 156 | towncrier_draft_working_directory = PROJECT_ROOT_DIR |
157 | 157 | # towncrier_draft_config_path = 'pyproject.toml' # relative to cwd |
158 | 158 |
|
159 | 159 | # -- Options for extlinks extension ------------------------------------------ |
160 | 160 |
|
161 | 161 | extlinks = { |
162 | | - 'issue': (f'{github_repo_url}/issues/%s', '#%s'), # noqa: WPS323 |
163 | | - 'pr': (f'{github_repo_url}/pull/%s', 'PR #%s'), # noqa: WPS323 |
164 | | - 'commit': (f'{github_repo_url}/commit/%s', '%s'), # noqa: WPS323 |
165 | | - 'gh': (f'{github_url}/%s', 'GitHub: %s'), # noqa: WPS323 |
166 | | - 'user': (f'{github_sponsors_url}/%s', '@%s'), # noqa: WPS323 |
| 162 | + "issue": (f"{github_repo_url}/issues/%s", "#%s"), # noqa: WPS323 |
| 163 | + "pr": (f"{github_repo_url}/pull/%s", "PR #%s"), # noqa: WPS323 |
| 164 | + "commit": (f"{github_repo_url}/commit/%s", "%s"), # noqa: WPS323 |
| 165 | + "gh": (f"{github_url}/%s", "GitHub: %s"), # noqa: WPS323 |
| 166 | + "user": (f"{github_sponsors_url}/%s", "@%s"), # noqa: WPS323 |
167 | 167 | } |
168 | 168 |
|
169 | 169 | intersphinx_mapping = { |
|
0 commit comments