Skip to content

Commit 737f52d

Browse files
committed
chore: Fix linting issues in docs/conf.py
1 parent 115dcd8 commit 737f52d

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

docs/conf.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# flake8: noqa E501
1+
# flake8: noqa: E501
22
import inspect
3-
import os
43
import sys
54
import typing as t
6-
from os.path import dirname, relpath
7-
from pathlib import Path
5+
from os.path import relpath
6+
import pathlib
87

98
import vcspull
109

1110
if t.TYPE_CHECKING:
1211
from sphinx.application import Sphinx
1312

1413
# Get the project root dir, which is the parent dir of this
15-
cwd = Path.cwd()
14+
cwd = pathlib.Path.cwd()
1615
project_root = cwd.parent
1716
src_root = project_root / "src"
1817

@@ -21,7 +20,7 @@
2120

2221
# package data
2322
about: dict[str, str] = {}
24-
with open(src_root / "vcspull" / "__about__.py") as fp:
23+
with (src_root / "vcspull" / "__about__.py").open() as fp:
2524
exec(fp.read(), about)
2625

2726
extensions = [
@@ -139,13 +138,13 @@
139138
ogp_desscription_length = about["__description__"]
140139
ogp_site_name = about["__title__"]
141140

142-
htmlhelp_basename = "%sdoc" % about["__title__"]
141+
htmlhelp_basename = f"{about['__title__']}doc"
143142

144143
latex_documents = [
145144
(
146145
"index",
147-
"{}.tex".format(about["__package_name__"]),
148-
"{} Documentation".format(about["__title__"]),
146+
f"{about['__package_name__']}.tex",
147+
f"{about['__title__']} Documentation",
149148
about["__author__"],
150149
"manual",
151150
)
@@ -155,7 +154,7 @@
155154
(
156155
"index",
157156
about["__package_name__"],
158-
"{} Documentation".format(about["__title__"]),
157+
f"{about['__title__']} Documentation",
159158
about["__author__"],
160159
1,
161160
)
@@ -164,8 +163,8 @@
164163
texinfo_documents = [
165164
(
166165
"index",
167-
"{}".format(about["__package_name__"]),
168-
"{} Documentation".format(about["__title__"]),
166+
about["__package_name__"],
167+
f"{about['__title__']} Documentation",
169168
about["__author__"],
170169
about["__package_name__"],
171170
about["__description__"],
@@ -234,7 +233,7 @@ def linkcode_resolve(
234233
else:
235234
linespec = ""
236235

237-
fn = relpath(fn, start=dirname(vcspull.__file__))
236+
fn = relpath(fn, start=pathlib.Path(vcspull.__file__).parent)
238237

239238
if "dev" in about["__version__"]:
240239
return "{}/blob/master/{}/{}/{}{}".format(
@@ -258,7 +257,7 @@ def linkcode_resolve(
258257
def remove_tabs_js(app: "Sphinx", exc: Exception) -> None:
259258
# Fix for sphinx-inline-tabs#18
260259
if app.builder.format == "html" and not exc:
261-
tabs_js = Path(app.builder.outdir) / "_static" / "tabs.js"
260+
tabs_js = pathlib.Path(app.builder.outdir) / "_static" / "tabs.js"
262261
tabs_js.unlink(missing_ok=True)
263262

264263

0 commit comments

Comments
 (0)