|
8 | 8 | import importlib |
9 | 9 | import inspect |
10 | 10 | import os |
11 | | -import subprocess |
12 | 11 | import sys |
13 | 12 |
|
| 13 | +from websockets.version import commit |
| 14 | + |
| 15 | + |
14 | 16 | # -- Path setup -------------------------------------------------------------- |
15 | 17 |
|
16 | 18 | # If extensions (or modules to document with autodoc) are in another directory, |
|
25 | 27 | copyright = f"2013-{datetime.date.today().year}, Aymeric Augustin and contributors" |
26 | 28 | author = "Aymeric Augustin" |
27 | 29 |
|
28 | | -from websockets.version import tag as version, version as release |
| 30 | +from websockets.version import tag as version, version as release # noqa: E402, F401 |
29 | 31 |
|
30 | 32 |
|
31 | 33 | # -- General configuration --------------------------------------------------- |
|
68 | 70 | ] |
69 | 71 | # It is currently inconvenient to install PyEnchant on Apple Silicon. |
70 | 72 | try: |
71 | | - import sphinxcontrib.spelling |
| 73 | + import sphinxcontrib.spelling # noqa: F401 |
72 | 74 | except ImportError: |
73 | 75 | extensions.remove("sphinxcontrib.spelling") |
74 | 76 |
|
|
77 | 79 | autodoc_typehints_description_target = "documented" |
78 | 80 |
|
79 | 81 | # Workaround for https://github.com/sphinx-doc/sphinx/issues/9560 |
80 | | -from sphinx.domains.python import PythonDomain |
| 82 | +from sphinx.domains.python import PythonDomain # noqa: E402 |
| 83 | + |
81 | 84 |
|
82 | 85 | assert PythonDomain.object_types["data"].roles == ("data", "obj") |
83 | 86 | PythonDomain.object_types["data"].roles = ("data", "class", "obj") |
|
98 | 101 | # This pattern also affects html_static_path and html_extra_path. |
99 | 102 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
100 | 103 |
|
| 104 | + |
101 | 105 | # Configure viewcode extension. |
102 | | -from websockets.version import commit |
103 | 106 |
|
104 | 107 | code_url = f"https://github.com/python-websockets/websockets/blob/{commit}" |
105 | 108 |
|
| 109 | + |
106 | 110 | def linkcode_resolve(domain, info): |
107 | 111 | # Non-linkable objects from the starter kit in the tutorial. |
108 | 112 | if domain == "js" or info["module"] == "connect4": |
@@ -137,6 +141,7 @@ def linkcode_resolve(domain, info): |
137 | 141 |
|
138 | 142 | return f"{code_url}/{file}#L{start}-L{end}" |
139 | 143 |
|
| 144 | + |
140 | 145 | # Configure opengraph extension |
141 | 146 |
|
142 | 147 | # Social cards don't support the SVG logo. Also, the text preview looks bad. |
|
0 commit comments