Skip to content

Commit f49c025

Browse files
committed
feat: support Windows workaround on Travis CI
1 parent b386ad5 commit f49c025

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

cibuildwheel/windows.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def get_python_configurations(
7070
'64': Architecture.AMD64,
7171
}
7272

73-
if IS_RUNNING_ON_TRAVIS:
73+
custom_compiler = os.environ.get('DISTUTILS_USE_SDK') and os.environ.get('MSSdk')
74+
if IS_RUNNING_ON_TRAVIS and not custom_compiler:
7475
# cannot install VCForPython27.msi which is needed for compiling C software
7576
# try with (and similar): msiexec /i VCForPython27.msi ALLUSERS=1 ACCEPT=YES /passive
7677
python_configurations = [c for c in python_configurations if not c.version.startswith('2.7')]

docs/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To build Linux, Mac, and Windows wheels on Travis CI, create a `.travis.yml` fil
4444
{% include "../examples/travis-ci-minimal.yml" %}
4545
```
4646

47-
Note that building Windows Python 2.7 wheels on Travis is unsupported.
47+
Note that building Windows Python 2.7 wheels on Travis is unsupported unless using a newer compiler [via a workaround](cpp-standards.md).
4848

4949
Commit this file, enable building of your repo on Travis CI, and push.
5050

test/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ def expected_wheels(package_name, package_version, manylinux_versions=None,
134134
for platform_tag in platform_tags:
135135
wheels.append(f'{package_name}-{package_version}-{python_abi_tag}-{platform_tag}.whl')
136136

137-
if IS_WINDOWS_RUNNING_ON_TRAVIS:
137+
custom_compiler = os.environ.get('DISTUTILS_USE_SDK') and os.environ.get('MSSdk')
138+
if IS_WINDOWS_RUNNING_ON_TRAVIS and not custom_compiler:
138139
# Python 2.7 isn't supported on Travis.
139140
wheels = [w for w in wheels if '-cp27-' not in w and '-pp2' not in w]
140141

0 commit comments

Comments
 (0)