Skip to content

Commit 17e55fa

Browse files
committed
don't provide fallbacks for when fancylogger.Colorize isn't there, just bump vsc-base version requirement
1 parent 5366ea9 commit 17e55fa

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

easybuild/tools/build_log.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@
5656
DRY_RUN_SOFTWARE_INSTALL_DIR = None
5757
DRY_RUN_MODULES_INSTALL_DIR = None
5858

59-
try:
60-
from vsc.utils.fancylogger import Colorize
61-
COLOR_AUTO = Colorize.AUTO
62-
except ImportError:
63-
COLOR_AUTO = 'auto'
64-
6559

6660
class EasyBuildError(LoggedException):
6761
"""
@@ -203,13 +197,10 @@ def exception(self, msg, *args):
203197
_init_easybuildlog = fancylogger.getLogger(fname=False)
204198

205199

206-
def init_logging(logfile, logtostdout=False, silent=False, colorize=COLOR_AUTO):
200+
def init_logging(logfile, logtostdout=False, silent=False, colorize=fancylogger.Colorize.AUTO):
207201
"""Initialize logging."""
208202
if logtostdout:
209-
try:
210-
fancylogger.logToScreen(enable=True, stdout=True, colorize=colorize)
211-
except TypeError:
212-
fancylogger.logToScreen(enable=True, stdout=True)
203+
fancylogger.logToScreen(enable=True, stdout=True, colorize=colorize)
213204
else:
214205
if logfile is None:
215206
# mkstemp returns (fd,filename), fd is from os.open, not regular open!

easybuild/tools/options.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,7 @@ def terminal_supports_colors(stream):
100100
DEFAULT_SYS_CFGFILES = [f for d in XDG_CONFIG_DIRS for f in sorted(glob.glob(os.path.join(d, 'easybuild.d', '*.cfg')))]
101101
DEFAULT_USER_CFGFILE = os.path.join(XDG_CONFIG_HOME, 'easybuild', 'config.cfg')
102102

103-
try:
104-
from vsc.utils.fancylogger import Colorize
105-
(COLOR_AUTO, COLOR_ALWAYS, COLOR_NEVER) = Colorize
106-
except ImportError:
107-
(COLOR_AUTO, COLOR_ALWAYS, COLOR_NEVER) = ('auto', 'always', 'never')
108-
COLOR_OPTIONS = [COLOR_AUTO, COLOR_ALWAYS, COLOR_NEVER]
103+
(COLOR_AUTO, COLOR_ALWAYS, COLOR_NEVER) = fancylogger.Colorize
109104

110105

111106
_log = fancylogger.getLogger('options', fname=False)
@@ -176,7 +171,7 @@ def use_color(colorize, stream=sys.stdout):
176171
elif colorize == COLOR_ALWAYS:
177172
return True
178173
else:
179-
assert colorize == COLOR_NEVER, "Argument `colorize` must be one of: %s" % ', '.join(COLOR_OPTIONS)
174+
assert colorize == COLOR_NEVER, "Argument `colorize` must be one of: %s" % ', '.join(fancylogger.Colorize)
180175
return False
181176

182177

@@ -298,7 +293,7 @@ def override_options(self):
298293
None, 'store_true', False),
299294
'cleanup-builddir': ("Cleanup build dir after successful installation.", None, 'store_true', True),
300295
'cleanup-tmpdir': ("Cleanup tmp dir after successful run.", None, 'store_true', True),
301-
'color': ("Colorize output", 'choice', 'store', COLOR_AUTO, COLOR_OPTIONS, {'metavar':'WHEN'}),
296+
'color': ("Colorize output", 'choice', 'store', COLOR_AUTO, fancylogger.Colorize, {'metavar':'WHEN'}),
302297
'debug-lmod': ("Run Lmod modules tool commands in debug module", None, 'store_true', False),
303298
'default-opt-level': ("Specify default optimisation level", 'choice', 'store', DEFAULT_OPT_LEVEL,
304299
Compiler.COMPILER_OPT_FLAGS),

setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,11 @@ def find_rel_test():
122122
install_requires=[
123123
'setuptools >= 0.6',
124124
"vsc-install >= 0.9.19",
125-
"vsc-base >= 2.4.18",
125+
"vsc-base >= 2.5.3",
126126
],
127127
extras_require = {
128128
'yeb': ["PyYAML >= 3.11"],
129129
'coloredlogs': [
130-
'vsc-base[coloredlogs] >= 2.5.3',
131130
'coloredlogs',
132131
'humanfriendly', # determine whether terminal supports ANSI color
133132
],

0 commit comments

Comments
 (0)