Skip to content

Commit 9082a8e

Browse files
committed
Use f-strings instead of string concatenation
1 parent 783e704 commit 9082a8e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

build_docs.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,10 @@ def get_ref(self, pattern: str) -> str:
363363
"""Return the reference of a given tag or branch."""
364364
try:
365365
# Maybe it's a branch
366-
return self.run("show-ref", "-s", "origin/" + pattern).stdout.strip()
366+
return self.run("show-ref", "-s", f"origin/{pattern}").stdout.strip()
367367
except subprocess.CalledProcessError:
368368
# Maybe it's a tag
369-
return self.run("show-ref", "-s", "tags/" + pattern).stdout.strip()
369+
return self.run("show-ref", "-s", f"tags/{pattern}").stdout.strip()
370370

371371
def fetch(self) -> subprocess.CompletedProcess:
372372
"""Try (and retry) to run git fetch."""
@@ -656,11 +656,11 @@ def build(self) -> None:
656656
"make",
657657
"-C",
658658
self.checkout / "Doc",
659-
"PYTHON=" + str(python),
660-
"SPHINXBUILD=" + str(sphinxbuild),
661-
"BLURB=" + str(blurb),
662-
"VENVDIR=" + str(self.venv),
663-
"SPHINXOPTS=" + " ".join(sphinxopts),
659+
f"PYTHON={python}",
660+
f"SPHINXBUILD={sphinxbuild}",
661+
f"BLURB={blurb}",
662+
f"VENVDIR={self.venv}",
663+
f"SPHINXOPTS={' '.join(sphinxopts)}",
664664
"SPHINXERRORHANDLING=",
665665
maketarget,
666666
])
@@ -683,7 +683,7 @@ def build_venv(self) -> None:
683683
# opengraph previews
684684
requirements.append("matplotlib>=3")
685685

686-
venv_path = self.build_root / ("venv-" + self.version.name)
686+
venv_path = self.build_root / f"venv-{self.version.name}"
687687
venv.create(venv_path, symlinks=os.name != "nt", with_pip=True)
688688
run(
689689
[venv_path / "bin" / "python", "-m", "pip", "install", "--upgrade"]

0 commit comments

Comments
 (0)