Skip to content

Commit b5006fc

Browse files
committed
minor fixes including python3 fix
+ In linux environment, if there was no matching python configurations for a particular architecture (i.e. if that architecture was skipped) the docker build script would just crash. The offending line: for whl in /tmp/linux_wheels/*.whl; do would result in whl being equal to the unexpanded glob expression. Rather than checking this in the bash script, python checks whether there are any actual wheels to build and skips the script if there are none. + added universal_newlines=True when making the call to grab the package name - this fix is required for python3 since other a bytes prefix (b'') will be added to the package name + In the linux/docker environment, added a try/catch statement around the docker script for KeyboardInterrupt that will kill the docker subprocess in cases where cibuildwheel is being run interactively.
1 parent c28e85d commit b5006fc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cibuildwheel/__main__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def main():
7777

7878
try:
7979
project_setup_py = os.path.join(project_dir, 'setup.py')
80-
name_output = subprocess.check_output([sys.executable, project_setup_py, '--name'])
80+
name_output = subprocess.check_output([sys.executable, project_setup_py, '--name'],
81+
universal_newlines=True)
8182
# the last line of output is the name
8283
package_name = name_output.strip().splitlines()[-1]
8384
except subprocess.CalledProcessError as err:

cibuildwheel/linux.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
4646

4747
for platform_tag, docker_image in platforms:
4848
platform_configs = [c for c in python_configurations if c.identifier.endswith(platform_tag)]
49+
if not platform_configs:
50+
continue
4951

5052
bash_script = '''
5153
set -o errexit
@@ -113,7 +115,11 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
113115
'/bin/bash'],
114116
stdin=subprocess.PIPE, universal_newlines=True)
115117

116-
docker_process.communicate(bash_script)
118+
try:
119+
docker_process.communicate(bash_script)
120+
except KeyboardInterrupt:
121+
docker_process.kill()
122+
docker_process.wait()
117123

118124
if docker_process.returncode != 0:
119125
exit(1)

0 commit comments

Comments
 (0)