Skip to content

Commit 3d4a6b0

Browse files
committed
Only build Python 2.7 wheel in test_cpp17_py27_modern_msvc_workaround
1 parent 7eb82bf commit 3d4a6b0

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/10_cpp_standards/cibuildwheel_test.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
project_dir = os.path.dirname(__file__)
88

99

10-
def test_cpp11(tmp_path):
10+
def test_cpp11():
1111
# This test checks that the C++11 standard is supported
1212

1313
# VC++ for Python 2.7 does not support modern standards
@@ -56,16 +56,16 @@ def test_cpp17():
5656
assert set(actual_wheels) == set(expected_wheels)
5757

5858

59-
def test_cpp17_modern_msvc_workaround(tmp_path):
60-
# This test checks the workaround for modern C++ versions, using a modern compiler
59+
def test_cpp17_py27_modern_msvc_workaround():
60+
# This test checks the workaround for building Python 2.7 wheel with MSVC 14
6161

6262
if utils.platform != 'windows':
6363
pytest.skip('the test is only relevant to the Windows build')
6464

6565
if os.environ.get('APPVEYOR_BUILD_WORKER_IMAGE', '') == 'Visual Studio 2015':
6666
pytest.skip('Visual Studio 2015 does not support C++17')
6767

68-
# VC++ for Python 2.7 and MSVC 10 do not support modern standards
68+
# VC++ for Python 2.7 (i.e., MSVC 9) does not support modern standards
6969
# This is a workaround which forces distutils/setupstools to a newer version
7070
# Wheels compiled need a more modern C++ redistributable installed, which is not
7171
# included with Python: see documentation for more info
@@ -92,13 +92,15 @@ def add_vcvars(prev_env, platform):
9292
return env
9393

9494
add_env_x86 = add_vcvars(add_env, 'x86')
95-
add_env_x86['CIBW_BUILD'] = '*-win32'
95+
add_env_x86['CIBW_BUILD'] = '?p27-win32'
9696
actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env_x86)
9797

9898
add_env_x64 = add_vcvars(add_env, 'x64')
99-
add_env_x64['CIBW_BUILD'] = '*-win_amd64'
99+
add_env_x64['CIBW_BUILD'] = 'cp27-win_amd64'
100100
actual_wheels += utils.cibuildwheel_run(project_dir, add_env=add_env_x64)
101101

102-
expected_wheels = utils.expected_wheels('spam', '0.1.0')
102+
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
103+
if 'cp27-cp27m-win' in w
104+
or 'pp27-pypy_73-win32' in w]
103105

104106
assert set(actual_wheels) == set(expected_wheels)

0 commit comments

Comments
 (0)