Route warnings and error messages to stderr, not stdout.

This commit is contained in:
Joe Rickerby
2021-01-08 17:25:07 +00:00
parent a99726f477
commit dbb6d80a72
2 changed files with 5 additions and 16 deletions
+4 -12
View File
@@ -116,26 +116,18 @@ class Logger:
self.error(error)
def warning(self, message: str) -> None:
print()
if self.fold_mode == 'github':
print(f'::warning::{message}')
print(f'::warning::{message}\n', file=sys.stderr)
else:
c = self.colors
print(f'{c.yellow}Warning{c.end} {message}')
print()
print(f'{c.yellow}Warning{c.end}: {message}\n', file=sys.stderr)
def error(self, error: Union[BaseException, str]) -> None:
print()
if self.fold_mode == 'github':
print(f'::error::{error}')
print(f'::error::{error}\n', file=sys.stderr)
else:
c = self.colors
print(f'{c.bright_red}Error{c.end} {error}')
print()
print(f'{c.bright_red}Error{c.end}: {error}\n', file=sys.stderr)
def _start_fold_group(self, name: str) -> None:
self._end_fold_group()
+1 -4
View File
@@ -37,10 +37,7 @@ def cibuildwheel_get_build_identifiers(project_path, env=None):
env=env,
)
lines = cmd_output.strip().split('\n')
# ignore warning lines in output
return [l for l in lines if l != '' and not l.startswith('Warning ')]
return cmd_output.strip().split('\n')
def cibuildwheel_run(project_path, package_dir='.', env=None, add_env=None, output_dir=None):