Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9082a8e

Browse files
committed
Use f-strings instead of string concatenation
1 parent783e704 commit9082a8e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎build_docs.py

Lines changed: 8 additions & 8 deletions
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-
returnself.run("show-ref","-s","origin/"+pattern).stdout.strip()
366+
returnself.run("show-ref","-s",f"origin/{pattern}").stdout.strip()
367367
exceptsubprocess.CalledProcessError:
368368
# Maybe it's a tag
369-
returnself.run("show-ref","-s","tags/"+pattern).stdout.strip()
369+
returnself.run("show-ref","-s",f"tags/{pattern}").stdout.strip()
370370

371371
deffetch(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)

[8]ページ先頭

©2009-2025 Movatter.jp