From f3e06f0a995a61b3ed5881d2d81aaf9a4b8fe8d3 Mon Sep 17 00:00:00 2001 From: Yannick Jadoul Date: Mon, 14 Aug 2017 14:38:48 +0200 Subject: [PATCH 1/7] Unbuffered stdout for Windows and displaying the output of subprocess calls --- cibuildwheel/windows.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 32a17853..c6805187 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -11,6 +11,9 @@ from .util import prepare_command def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, skip): + # Python under AppVeyor/Windows seems to be buffering by default, giving problems interleaving subprocess call output with unflushed calls to 'print' + sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) + # run_with_env is a cmd file that sets the right environment variables to run_with_env = os.path.join(tempfile.gettempdir(), 'appveyor_run_with_env.cmd') if not os.path.exists(run_with_env): @@ -22,7 +25,7 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be # print the command executing for the logs print('+ ' + ' '.join(args)) args = ['cmd', '/E:ON', '/V:ON', '/C', run_with_env] + args - return subprocess.check_output(' '.join(args), env=env, cwd=cwd) + return subprocess.check_call(' '.join(args), env=env, cwd=cwd) PythonConfiguration = namedtuple('PythonConfiguration', ['version', 'arch', 'identifier', 'path']) python_configurations = [ From 84c2b30676e58880a61ae9807abb40adfac296e4 Mon Sep 17 00:00:00 2001 From: Yannick Jadoul Date: Mon, 14 Aug 2017 15:12:46 +0200 Subject: [PATCH 2/7] Flushing stdout in print_preamble --- cibuildwheel/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index cf15f57c..b8eeebd6 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -136,6 +136,7 @@ def print_preamble(platform, build_options): print(' %s: %r' % (option, value)) print('\nHere we go!\n') + sys.stdout.flush() if __name__ == '__main__': main() From b7a52b502d2017eb7d6a1c031d8af361bfbecca2 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 14 Aug 2017 21:10:48 +0100 Subject: [PATCH 3/7] Move the stdout flush to the windows file, since it's only needed there --- cibuildwheel/__main__.py | 1 - cibuildwheel/windows.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index b8eeebd6..cf15f57c 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -136,7 +136,6 @@ def print_preamble(platform, build_options): print(' %s: %r' % (option, value)) print('\nHere we go!\n') - sys.stdout.flush() if __name__ == '__main__': main() diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index c6805187..feaf12be 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -12,6 +12,7 @@ from .util import prepare_command def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, skip): # Python under AppVeyor/Windows seems to be buffering by default, giving problems interleaving subprocess call output with unflushed calls to 'print' + sys.stdout.flush() sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) # run_with_env is a cmd file that sets the right environment variables to From abfbe42d6f867b6ef3ebc9b36c9473b89db3c16e Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 14 Aug 2017 21:11:04 +0100 Subject: [PATCH 4/7] Add -u flag so the test output is in the right order on Appveyor --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 2c7debeb..1f8d71f2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,5 @@ build_script: - pip install . - - python ./run_tests.py + # the '-u' flag is required so the output is in the correct order. + # See https://github.com/joerick/cibuildwheel/pull/24 for more info. + - python -u ./run_tests.py From 77ab9a7627c32bc7e3a0d7f6d8937e4a54126eb0 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 14 Aug 2017 21:37:37 +0100 Subject: [PATCH 5/7] Bump version --- README.md | 4 ++-- cibuildwheel/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 932f05bb..382b136f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Usage - os: osx script: - - pip install cibuildwheel==0.4.0 + - pip install cibuildwheel==0.4.1 - cibuildwheel --output-dir wheelhouse ``` @@ -54,7 +54,7 @@ Usage ``` build_script: - - pip install cibuildwheel==0.4.0 + - pip install cibuildwheel==0.4.1 - cibuildwheel --output-dir wheelhouse artifacts: - path: "wheelhouse\\*.whl" diff --git a/cibuildwheel/__init__.py b/cibuildwheel/__init__.py index abeeedbf..f0ede3d3 100644 --- a/cibuildwheel/__init__.py +++ b/cibuildwheel/__init__.py @@ -1 +1 @@ -__version__ = '0.4.0' +__version__ = '0.4.1' diff --git a/setup.cfg b/setup.cfg index 59cb282b..85cddc12 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.0 +current_version = 0.4.1 commit = True tag = True message = Bump version diff --git a/setup.py b/setup.py index af684db1..26e2459d 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: setup( name='cibuildwheel', - version='0.4.0', + version='0.4.1', description="Build Python wheels on CI with minimal configuration.", long_description='For readme please see http://github.com/joerick/cibuildwheel', author="Joe Rickerby", From a5a23114a9e5d5806716d9136b20a43d1d571967 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 14 Aug 2017 21:39:42 +0100 Subject: [PATCH 6/7] Update changelog --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 382b136f..160bc244 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,11 @@ Since `cibuildwheel` runs the wheel through delocate or auditwheel, it will auto Changelog ========= +### 0.4.1 + +- Fixed a bug on Windows where subprocess' output was hidden (#23) +- Fixed a bug on Appveyor where logs would appear in the wrong order due to output buffering (#24, thanks @YannickJadoul!) + ### 0.4.0 - Fixed a bug that was increasing the build time by building the wheel twice. This was a problem for large projects that have a long build time. If you're upgrading and you need the old behaviour, use `CIBW_BEFORE_BUILD={pip} install .`, or install exactly the dependencies you need in `CIBW_BEFORE_BUILD`. See #18. From e9eba3486948a77658a8d9b85441502dfb010229 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 20 Aug 2017 14:16:07 +0200 Subject: [PATCH 7/7] Add websockets to list of users. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 160bc244..5e6eb012 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,7 @@ Working examples Here are some repos that use cibuildwheel. - [pyinstrument_cext](https://github.com/joerick/pyinstrument_cext) +- [websockets](https://github.com/aaugustin/websockets) > Add repo here! Send a PR.