From c3565d5025566dcf4b795eef8d40f38a12872151 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 13 Apr 2017 15:02:04 +0100 Subject: [PATCH] Add fancy preamble for the log files --- cibuildwheel/__init__.py | 1 + cibuildwheel/__main__.py | 33 +++++++++++++++++++++++++++------ cibuildwheel/util.py | 3 +++ setup.cfg | 2 ++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/cibuildwheel/__init__.py b/cibuildwheel/__init__.py index e69de29b..8ce9b362 100644 --- a/cibuildwheel/__init__.py +++ b/cibuildwheel/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1.3' diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index 79509dd7..b156da3d 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -1,7 +1,8 @@ from __future__ import print_function -import argparse, os, subprocess, sys +import argparse, os, subprocess, sys, textwrap -from cibuildwheel import linux, windows, macos +import cibuildwheel +import cibuildwheel.linux, cibuildwheel.windows, cibuildwheel.macos from cibuildwheel.util import BuildSkipper def get_option_from_environment(option_name, platform=None): @@ -93,7 +94,7 @@ def main(): file=sys.stderr) exit(2) - build_args = dict( + build_options = dict( project_dir=project_dir, package_name=package_name, output_dir=output_dir, @@ -103,14 +104,34 @@ def main(): skip=skip, ) + print_preamble(platform, build_options) + if platform == 'linux': - linux.build(**build_args) + cibuildwheel.linux.build(**build_options) elif platform == 'windows': - windows.build(**build_args) + cibuildwheel.windows.build(**build_options) elif platform == 'macos': - macos.build(**build_args) + cibuildwheel.macos.build(**build_options) else: raise Exception('Unsupported platform') +def print_preamble(platform, build_options): + print(textwrap.dedent(''' + _ _ _ _ _ _ _ + ___|_| |_ _ _|_| |_| |_ _ _| |_ ___ ___| | + | _| | . | | | | | . | | | | | -_| -_| | + |___|_|___|___|_|_|___|_____|_|_|___|___|_| + ''')) + + print('cibuildwheel version %s\n' % cibuildwheel.__version__) + + + print('Build options:') + print(' platform: %r' % platform) + for option, value in build_options.items(): + print(' %s: %r' % (option, value)) + + print('\nHere we go!\n') + if __name__ == '__main__': main() diff --git a/cibuildwheel/util.py b/cibuildwheel/util.py index b660831f..d20f986a 100644 --- a/cibuildwheel/util.py +++ b/cibuildwheel/util.py @@ -19,3 +19,6 @@ class BuildSkipper(object): def __call__(self, build_id): return any(fnmatch(build_id, pattern) for pattern in self.patterns) + + def __repr__(self): + return 'BuildSkipper(%r)' % ' '.join(self.patterns) diff --git a/setup.cfg b/setup.cfg index d786f5ef..d94a2d10 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,6 +6,8 @@ message = Bump version [bumpversion:file:setup.py] +[bumpversion:file:cibuildwheel/__init__.py] + [bumpversion:file:README.md] search = cibuildwheel=={current_version} replace = cibuildwheel=={new_version}