Skip to content

Commit

Permalink
More style adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
psakievich committed Nov 30, 2023
1 parent 9cd68e4 commit 63f3791
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
2 changes: 0 additions & 2 deletions manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import importlib.util
import os
import sys

import spack.util.spack_yaml as syaml

Expand Down Expand Up @@ -68,7 +67,6 @@ def _machine_detector(self):

def _populate_machines(self):
self.machines = []
machine_path = os.path.join(self.root, "configs")
machine_dirs = list(os.scandir(os.path.join(self.root, "configs")))
for machine in machine_dirs:
self.machines.append(machine.name)
Expand Down
12 changes: 6 additions & 6 deletions manager/cmd/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
sys.path.append(module_dir)

# import manager_cmds.create_dev_env
import manager_cmds.create_env
import manager_cmds.create_env # noqa E402

# import manager_cmds.develop
# import manager_cmds.external
import manager_cmds.find_machine
# import manager_cmds.develop # noqa E402
# import manager_cmds.external # noqa E402
import manager_cmds.find_machine # noqa E402

# import manager_cmds.pin
# import manager_cmds.snapshot
# import manager_cmds.pin # noqa E402
# import manager_cmds.snapshot # noqa E402

if sys.version_info[0] < 3:
print("spack-manager commands only support python 3")
Expand Down
16 changes: 6 additions & 10 deletions manager/manager_cmds/create_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def create_env(parser, args):
if not args.yaml:
manifest.set_config_value("concretizer", "unify", True)

msg = (
"Specified machine {m} was not found. "
"To see registered machines run `spack manager find-machine --list`"
)
if args.machine is not None:
project = machine_defined(args.machine)
if not project:
tty.error(
"Specified machine {m} was not found. To see registered machines run `spack manager find-machine --list`".format(
m=args.machine
)
)
tty.error(msg.format(m=args.machine))
sys.exit(1)
else:
machine = args.machine
Expand All @@ -66,11 +66,7 @@ def create_env(parser, args):
print(find_machine())
project, machine = find_machine()
if machine == "NOT-FOUND":
tty.warn(
"Specified machine {m} was not found. To see registered machines run `spack manager find-machine --list`".format(
m=args.machine
)
)
tty.warn(msg.format(m=args.machine))

if args.spec:
spec_list = spack.cmd.parse_specs(args.spec)
Expand Down
2 changes: 0 additions & 2 deletions manager/manager_cmds/find_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# This software is released under the BSD 3-clause license. See LICENSE file
# for more details.

import os
import socket
import sys

import manager
Expand Down

0 comments on commit 63f3791

Please sign in to comment.