File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 77
88import sys
99
10- import spack .extensions .manager .manager_cmds .analyze as analyze
1110import spack .extensions .manager .manager_cmds .binary_finder as binary_finder
1211import spack .extensions .manager .manager_cmds .cache_query as cache_query
1312import spack .extensions .manager .manager_cmds .cli_config as cli_config
2221import spack .extensions .manager .manager_cmds .make as make
2322import spack .extensions .manager .manager_cmds .pin as pin
2423
24+ try :
25+ import spack .extensions .manager .manager_cmds .analyze as analyze
26+ _analyze_imports = True
27+ except ImportError :
28+ _analyze_imports = False
29+
2530if sys .version_info < (3 , 8 ):
2631 print ("spack-manager commands only supported in python 3.8 and higher" )
2732 exit (1 )
@@ -39,8 +44,8 @@ def setup_parser(subparser):
3944 cli_config .cli_commands ["add" ](sp , _subcommands )
4045 cli_config .cli_commands ["remove" ](sp , _subcommands )
4146 cli_config .cli_commands ["list" ](sp , _subcommands )
42-
43- analyze .add_command (sp , _subcommands )
47+ if _analyze_imports :
48+ analyze .add_command (sp , _subcommands )
4449 binary_finder .add_command (sp , _subcommands )
4550 cache_query .add_command (sp , _subcommands )
4651 create_env .add_command (sp , _subcommands )
Original file line number Diff line number Diff line change @@ -216,7 +216,6 @@ def analyze(parser, args):
216216 else :
217217 visitor = OmitSpecsVisitor ([])
218218
219-
220219 stats = compute_dag_stats (specs , visitor )
221220
222221 if args .stats :
You can’t perform that action at this time.
0 commit comments