Skip to content

Commit

Permalink
add configuration option to allow disabling progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Sep 11, 2021
1 parent 5c3bd50 commit f714ea6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions easybuild/tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX):
'map_toolchains',
'modules_tool_version_check',
'pre_create_installdir',
'show_progress_bar',
],
WARN: [
'check_ebroot_env_vars',
Expand Down
7 changes: 4 additions & 3 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ def override_options(self):
'force-download': ("Force re-downloading of sources and/or patches, "
"even if they are available already in source path",
'choice', 'store_or_None', DEFAULT_FORCE_DOWNLOAD, FORCE_DOWNLOAD_CHOICES),
'generate-devel-module': ("Generate a develop module file, implies --force if disabled",
None, 'store_true', True),
'group': ("Group to be used for software installations (only verified, not set)", None, 'store', None),
'group-writable-installdir': ("Enable group write permissions on installation directory after installation",
None, 'store_true', False),
Expand Down Expand Up @@ -468,13 +470,12 @@ def override_options(self):
None, 'store_true', False),
'set-default-module': ("Set the generated module as default", None, 'store_true', False),
'set-gid-bit': ("Set group ID bit on newly created directories", None, 'store_true', False),
'show-progress-bar': ("Show progress bar in terminal output", None, 'store_true', True),
'silence-deprecation-warnings': ("Silence specified deprecation warnings", 'strlist', 'extend', None),
'sticky-bit': ("Set sticky bit on newly created directories", None, 'store_true', False),
'skip-extensions': ("Skip installation of extensions", None, 'store_true', False),
'skip-test-cases': ("Skip running test cases", None, 'store_true', False, 't'),
'skip-test-step': ("Skip running the test step (e.g. unit tests)", None, 'store_true', False),
'generate-devel-module': ("Generate a develop module file, implies --force if disabled",
None, 'store_true', True),
'sticky-bit': ("Set sticky bit on newly created directories", None, 'store_true', False),
'sysroot': ("Location root directory of system, prefix for standard paths like /usr/lib and /usr/include",
None, 'store', None),
'trace': ("Provide more information in output to stdout on progress", None, 'store_true', False, 'T'),
Expand Down
4 changes: 3 additions & 1 deletion easybuild/tools/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"""
import random

from easybuild.tools.config import build_option

try:
from rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn, TimeElapsedColumn
HAVE_RICH = True
Expand Down Expand Up @@ -63,7 +65,7 @@ def create_progress_bar():
Returns rich.progress.Progress instance if the Rich Python package is available,
or a shim DummyProgress instance otherwise.
"""
if HAVE_RICH:
if HAVE_RICH and build_option('show_progress_bar'):

# pick random spinner, from a selected subset of available spinner (see 'python3 -m rich.spinner')
spinner = random.choice(('aesthetic', 'arc', 'bounce', 'dots', 'line', 'monkey', 'point', 'simpleDots'))
Expand Down

0 comments on commit f714ea6

Please sign in to comment.