Merge pull request #24 from YannickJadoul/windows-output
Unbuffered stdout for Windows and displaying the output of subprocess calls Fix #23
This commit is contained in:
+3
-1
@@ -1,3 +1,5 @@
|
|||||||
build_script:
|
build_script:
|
||||||
- pip install .
|
- 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
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ from .util import prepare_command
|
|||||||
|
|
||||||
|
|
||||||
def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, skip):
|
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
|
# 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')
|
run_with_env = os.path.join(tempfile.gettempdir(), 'appveyor_run_with_env.cmd')
|
||||||
if not os.path.exists(run_with_env):
|
if not os.path.exists(run_with_env):
|
||||||
@@ -22,7 +26,7 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
|
|||||||
# print the command executing for the logs
|
# print the command executing for the logs
|
||||||
print('+ ' + ' '.join(args))
|
print('+ ' + ' '.join(args))
|
||||||
args = ['cmd', '/E:ON', '/V:ON', '/C', run_with_env] + 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'])
|
PythonConfiguration = namedtuple('PythonConfiguration', ['version', 'arch', 'identifier', 'path'])
|
||||||
python_configurations = [
|
python_configurations = [
|
||||||
|
|||||||
Reference in New Issue
Block a user