|
17 | 17 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
18 | 18 | # |
19 | 19 | import os |
| 20 | +import re |
| 21 | +import subprocess |
20 | 22 | import sys |
| 23 | +from typing import Dict |
21 | 24 |
|
22 | 25 | sys.path.insert(0, os.path.abspath("..")) |
23 | 26 |
|
|
65 | 68 | # built documents. |
66 | 69 | # |
67 | 70 | # The full version, including alpha/beta/rc tags. |
68 | | -from subprocess import check_output |
69 | | - |
70 | | -release = check_output(["git", "describe", "--abbrev=0"], universal_newlines=True).strip() |
| 71 | +git_describe = subprocess.run( |
| 72 | + ["git", "describe", "--abbrev=0"], stdout=subprocess.PIPE, universal_newlines=True, check=True |
| 73 | +) |
| 74 | +release = git_describe.stdout.strip() |
| 75 | +assert release |
71 | 76 | print("release version: %r" % release) |
72 | | -# The short X.Y version. |
73 | | -import re |
74 | 77 |
|
75 | | -version = re.match(r"([0-9]+\.[0-9]+).*?", release).group() |
| 78 | +# The short X.Y version. |
| 79 | +match_version = re.match(r"([0-9]+\.[0-9]+).*?", release) |
| 80 | +assert match_version |
| 81 | +version = match_version.group() |
76 | 82 |
|
77 | 83 | # The language for content autogenerated by Sphinx. Refer to documentation |
78 | 84 | # for a list of supported languages. |
|
261 | 267 |
|
262 | 268 | # -- Options for LaTeX output --------------------------------------------- |
263 | 269 |
|
264 | | -latex_elements = { |
| 270 | +latex_elements: Dict[str, str] = { |
265 | 271 | # The paper size ('letterpaper' or 'a4paper'). |
266 | 272 | # 'papersize': 'letterpaper', |
267 | 273 | # The font size ('10pt', '11pt' or '12pt'). |
|
0 commit comments