New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change option --color
choices to auto/always/never
#1701
Conversation
The option values are as in `ls --color` and `grep --color`, except that "auto" is the default which colorizes logs and output whenever EB's STDOUT is connected to a terminal.
Automatic reply from Jenkins: Can I test this? |
… be used. This is necessary after the recent API changes in PR easybuilders#225 on `vsc-base`: now the colorization options in `fancylogger` use a three-value enum `auto`/`always`/`never`.
…ly` is not available. We detect if STDOUT/STDERR is connected to a terminal and then just assume that everyone is using an ANSI-compatible one these days...
@@ -112,7 +112,8 @@ def find_rel_test(): | |||
zip_safe=False, | |||
install_requires=[ | |||
'setuptools >= 0.6', | |||
"vsc-base >= 2.4.18", | |||
"vsc-base >= 2.5.0", | |||
'humanfriendly', # determine whether terminal supports ANSI color |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be moved down into extras_require
, only the packages that are strictly required to make eb
work should be listed in install_requires
Jenkins: ok to test |
EasyBuild framework unit test suite FAILed. See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2912/console for more details. Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do. |
@@ -208,7 +233,8 @@ def main(args=None, logfile=None, do_build=None, testing=False): | |||
|
|||
# initialise logging for main | |||
global _log | |||
_log, logfile = init_logging(logfile, logtostdout=options.logtostdout, silent=testing or options.terse) | |||
_log, logfile = init_logging(logfile, logtostdout=options.logtostdout, | |||
silent=(testing or options.terse)), color=options.color) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ))
here should be )
, syntax error
@riccardomurri you didn't test this, did you? Did you?! ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Kenneth Hoste, Fri, Mar 25, 2016 at 04:07:15PM -0700:)
@@ -208,7 +233,8 @@ def main(args=None, logfile=None, do_build=None, testing=False):
# initialise logging for main global _log
- _log, logfile = init_logging(logfile, logtostdout=options.logtostdout, silent=testing or options.terse)
- _log, logfile = init_logging(logfile, logtostdout=options.logtostdout,
silent=(testing or options.terse)), color=options.color)
the
))
here should be)
, syntax error@riccardomurri you didn't test this, did you? Did you?! ;-)
Damn Jenkins, you caught me!
+1 for this! |
EasyBuild framework unit test suite FAILed. See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2918/console for more details. Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do. |
EasyBuild framework unit test suite FAILed. See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2919/console for more details. Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do. |
for their meaning. | ||
""" | ||
# turn color=auto/yes/no into a boolean value | ||
if options.color == 'auto': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@riccardomurri this should use colorize
rather than options.color
?
EasyBuild framework unit test suite FAILed. See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2920/console for more details. Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do. |
@boegel I cannot reproduce the failure that Jenkins reported on my laptop, and I cannot understand what part of the code has actually failed from the traceback.... help? |
@riccardomurri The failing test is probably because the PR is not being tested against the updated In other words: #225 needs to be merged first. |
EasyBuild framework unit test suite FAILed. See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2921/console for more details. Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do. |
@riccardomurri please merge riccardomurri#26 to sync this with current |
sync with develop & resolve conflicts in main.py
@boegel done. |
@@ -126,6 +126,11 @@ def find_rel_test(): | |||
], | |||
extras_require = { | |||
'yeb': ["PyYAML >= 3.11"], | |||
'coloredlogs': [ | |||
'vsc-base[coloredlogs] >= 2.5.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@riccardomurri please bump to 2.5.3 as minimal required version
Version 2.5.3 of `vsc-base` adds log colorization support.
lgtm, thanks @riccardomurri! |
The option values are as in
ls --color
andgrep --color
,except that "auto" is the default which colorizes logs and output
whenever EB's STDOUT is connected to a terminal.
Note that this requires PR
hpcugent/vsc-base#225to be merged!(Otherwise
fancylogger.logToScreen()
does not have acolor
parameter.)