Skip to content

Commit d9dbc14

Browse files
committed
Fix warnings in Sphinx configuration.
1 parent 25b13cc commit d9dbc14

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/conf.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
# documentation root, use os.path.abspath to make it absolute, like shown here.
1818
#
1919
import os
20+
import re
21+
import subprocess
2022
import sys
23+
from typing import Dict
2124

2225
sys.path.insert(0, os.path.abspath(".."))
2326

@@ -65,14 +68,17 @@
6568
# built documents.
6669
#
6770
# 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
7176
print("release version: %r" % release)
72-
# The short X.Y version.
73-
import re
7477

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()
7682

7783
# The language for content autogenerated by Sphinx. Refer to documentation
7884
# for a list of supported languages.
@@ -261,7 +267,7 @@
261267

262268
# -- Options for LaTeX output ---------------------------------------------
263269

264-
latex_elements = {
270+
latex_elements: Dict[str, str] = {
265271
# The paper size ('letterpaper' or 'a4paper').
266272
# 'papersize': 'letterpaper',
267273
# The font size ('10pt', '11pt' or '12pt').

0 commit comments

Comments
 (0)