summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-02-08 09:46:21 +0100
committerGitHub <noreply@github.com>2023-02-08 09:46:21 +0100
commit27c2ff6c64e0228ef66891e9618405abd1c1c200 (patch)
treed7e2804fe891c1b63061befd1a2ea45d5083eb8f /lib
parent9bde77199c5f8e162e3212b7c6821085dbf6e75a (diff)
downloadspack-27c2ff6c64e0228ef66891e9618405abd1c1c200.tar.gz
spack-27c2ff6c64e0228ef66891e9618405abd1c1c200.tar.bz2
spack-27c2ff6c64e0228ef66891e9618405abd1c1c200.tar.xz
spack-27c2ff6c64e0228ef66891e9618405abd1c1c200.zip
Ensure we print the correct branch number for tutorials (#35371)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/tutorial.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/tutorial.py b/lib/spack/spack/cmd/tutorial.py
index a0869bfdec..f37d73ab8c 100644
--- a/lib/spack/spack/cmd/tutorial.py
+++ b/lib/spack/spack/cmd/tutorial.py
@@ -63,7 +63,7 @@ def tutorial(parser, args):
if not tty.get_yes_or_no("Are you sure you want to proceed?"):
tty.die("Aborted")
- rm_cmds = ["rm -f %s" % f for f in rm_configs]
+ rm_cmds = [f"rm -f {f}" for f in rm_configs]
tty.msg("Reverting compiler and repository configuration", *rm_cmds)
for path in rm_configs:
if os.path.exists(path):
@@ -71,19 +71,19 @@ def tutorial(parser, args):
tty.msg(
"Ensuring that the tutorial binary mirror is configured:",
- "spack mirror add tutorial %s" % tutorial_mirror,
+ f"spack mirror add tutorial {tutorial_mirror}",
)
mirror_config = syaml_dict()
mirror_config["tutorial"] = tutorial_mirror
spack.config.set("mirrors", mirror_config, scope="user")
- tty.msg("Ensuring that we trust tutorial binaries", "spack gpg trust %s" % tutorial_key)
+ tty.msg("Ensuring that we trust tutorial binaries", f"spack gpg trust {tutorial_key}")
spack.util.gpg.trust(tutorial_key)
# Note that checkout MUST be last. It changes Spack under our feet.
# If you don't put this last, you'll get import errors for the code
# that follows (exacerbated by the various lazy singletons we use)
- tty.msg("Ensuring we're on the releases/v{0}.{1} branch".format(*spack.spack_version_info[:2]))
+ tty.msg(f"Ensuring we're on the {tutorial_branch} branch")
git = spack.util.git.git(required=True)
with working_dir(spack.paths.prefix):
git("checkout", tutorial_branch)