Skip to content

Commit 7939a0a

Browse files
committed
Use ruff format
1 parent 346a9b6 commit 7939a0a

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,8 @@ convention = "numpy"
4747

4848
[tool.pytest.ini_options]
4949
addopts = "--import-mode=importlib" # Recommended as best practice
50+
51+
[tool.ruff.format]
52+
docstring-code-format = true
53+
# ruff format does not seem to take indenting into account.
54+
docstring-code-line-length = 69

python/lsst/sconsUtils/installation.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def Declare(self, products=None):
230230
product = self["eupsProduct"]
231231

232232
if "EUPS_DIR" in os.environ:
233-
self["ENV"]["PATH"] += os.pathsep + f'{os.environ["EUPS_DIR"]}/bin'
233+
self["ENV"]["PATH"] += os.pathsep + f"{os.environ['EUPS_DIR']}/bin"
234234
self["ENV"]["EUPS_LOCK_PID"] = os.environ.get("EUPS_LOCK_PID", "-1")
235235
if "undeclare" in SCons.Script.COMMAND_LINE_TARGETS or self.GetOption("clean"):
236236
if version:
@@ -254,15 +254,15 @@ def Declare(self, products=None):
254254
)
255255

256256
if "eupsPath" in self:
257-
command += f' -Z {self["eupsPath"]}'
257+
command += f" -Z {self['eupsPath']}"
258258

259259
if version:
260260
command += f" {product} {version}"
261261

262262
current += [command + " --current"]
263263

264264
if self.GetOption("tag"):
265-
command += f' --tag={self.GetOption("tag")}'
265+
command += f" --tag={self.GetOption('tag')}"
266266

267267
declare += [command]
268268

@@ -389,8 +389,10 @@ def InstallEups(env, dest, files=[], presetup=""):
389389
390390
.. code-block:: python
391391
392-
env.InstallEups(os.path.join(env['prefix'], "ups"),
393-
presetup={"sconsUtils" : env['version']})
392+
env.InstallEups(
393+
os.path.join(env["prefix"], "ups"),
394+
presetup={"sconsUtils": env["version"]},
395+
)
394396
"""
395397
acts = []
396398
if not env.installing:
@@ -449,9 +451,9 @@ def InstallEups(env, dest, files=[], presetup=""):
449451
for i in build_obj:
450452
env.AlwaysBuild(i)
451453

452-
cmd = f'eups expandbuild -i --version {env["version"]} '
454+
cmd = f"eups expandbuild -i --version {env['version']} "
453455
if "baseversion" in env:
454-
cmd += f' --repoversion {env["baseversion"]} '
456+
cmd += f" --repoversion {env['baseversion']} "
455457
cmd += str(i)
456458
eupsTargets.extend(env.AddPostAction(build_obj, env.Action(f"{cmd}", cmd)))
457459

python/lsst/sconsUtils/state.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _initOptions():
7272
action="store_true",
7373
default=False,
7474
help="Filter out a class of warnings deemed irrelevant",
75-
),
75+
)
7676
SCons.Script.AddOption(
7777
"--force",
7878
dest="force",
@@ -579,13 +579,13 @@ def ClassifyCc(context):
579579
#
580580
if re.search(r"^(Linux|Linux64)$", env["eupsFlavor"]) and "LD_LIBRARY_PATH" in os.environ:
581581
env.Append(LINKFLAGS=["-Wl,-rpath-link"])
582-
env.Append(LINKFLAGS=[f'-Wl,{os.environ["LD_LIBRARY_PATH"]}'])
582+
env.Append(LINKFLAGS=[f"-Wl,{os.environ['LD_LIBRARY_PATH']}"])
583583
#
584584
# Set the optimization level.
585585
#
586586
if env["opt"]:
587587
env["CCFLAGS"] = [o for o in env["CCFLAGS"] if not re.search(r"^-O(\d|s|g|fast)$", o)]
588-
env.MergeFlags(f'-O{env["opt"]}')
588+
env.MergeFlags(f"-O{env['opt']}")
589589
#
590590
# Set compiler-specific warning flags.
591591
#

python/lsst/sconsUtils/vcs/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def guessFingerprint():
4343
state.log.warn(f"Cannot guess fingerprint without .git directory; will be set to '{fingerprint}'.")
4444
else:
4545
fingerprint = utils.runExternal(
46-
"git describe --match=" " --always --abbrev=0 --dirty", fatal=False
46+
"git describe --match= --always --abbrev=0 --dirty", fatal=False
4747
).strip()
4848

4949
return fingerprint

0 commit comments

Comments
 (0)