fix: review from @joerick

This commit is contained in:
Henry Schreiner
2021-01-22 13:01:00 -05:00
parent 5762aa5e3b
commit cc0e7ec0a1
4 changed files with 10 additions and 15 deletions
+5 -5
View File
@@ -257,6 +257,11 @@ def main() -> None:
print_preamble(platform, build_options)
if not identifiers:
print(f'cibuildwheel: No build identifiers selected: {build_selector}', file=sys.stderr)
if not args.allow_empty:
sys.exit(3)
if not output_dir.exists():
output_dir.mkdir(parents=True)
@@ -269,11 +274,6 @@ def main() -> None:
else:
assert_never(platform)
if not identifiers:
print(f'cibuildwheel: No build identifiers selected: {build_selector}', file=sys.stderr)
if not args.allow_empty:
sys.exit(3)
def detect_obsolete_options() -> None:
# Check the old 'MANYLINUX1_*_IMAGE' options
+1 -1
View File
@@ -202,7 +202,7 @@ def test_cpp17_py27_modern_msvc_workaround(tmp_path):
add_env_x64['CIBW_BUILD'] = 'cp27-win_amd64'
actual_wheels += utils.cibuildwheel_run(project_dir, add_env=add_env_x64)
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0', filter_27=False)
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0', exclude_27=False)
if 'cp27-cp27m-win' in w
or 'pp27-pypy_73-win32' in w]
+4 -3
View File
@@ -77,7 +77,7 @@ def cibuildwheel_run(project_path, package_dir='.', env=None, add_env=None, outp
def expected_wheels(package_name, package_version, manylinux_versions=None,
macosx_deployment_target='10.9', machine_arch=None, *,
filter_27=IS_WINDOWS_RUNNING_ON_TRAVIS):
exclude_27=IS_WINDOWS_RUNNING_ON_TRAVIS):
'''
Returns a list of expected wheels from a run of cibuildwheel.
'''
@@ -135,8 +135,9 @@ def expected_wheels(package_name, package_version, manylinux_versions=None,
for platform_tag in platform_tags:
wheels.append(f'{package_name}-{package_version}-{python_abi_tag}-{platform_tag}.whl')
if filter_27:
# Python 2.7 isn't supported on Travis.
# Travis on Windows does not support using the default Python 2.7 compiler,
# so we support skipping here.
if exclude_27:
wheels = [w for w in wheels if '-cp27-' not in w and '-pp2' not in w]
return wheels
@@ -1,4 +1,3 @@
import platform as platform_module
import sys
import pytest
@@ -68,7 +67,6 @@ def test_platform_environment(platform, intercepted_build_args, monkeypatch):
def test_archs_default(platform, intercepted_build_args, monkeypatch):
monkeypatch.setattr(platform_module, 'machine', lambda: 'AMD64' if platform == 'windows' else 'x86_64')
main()
build_options = intercepted_build_args.args[0]
@@ -86,7 +84,6 @@ def test_archs_argument(platform, intercepted_build_args, monkeypatch, use_env_v
if platform == 'windows':
pytest.skip('Will have empty build selectors on Windows')
monkeypatch.setattr(platform_module, 'machine', lambda: 'x86_64')
if use_env_var:
monkeypatch.setenv('CIBW_ARCHS', 'ppc64le')
else:
@@ -100,7 +97,6 @@ def test_archs_argument(platform, intercepted_build_args, monkeypatch, use_env_v
def test_archs_platform_specific(platform, intercepted_build_args, monkeypatch):
monkeypatch.setattr(platform_module, 'machine', lambda: 'x86_64')
monkeypatch.setenv('CIBW_ARCHS', 'unused')
monkeypatch.setenv('CIBW_ARCHS_LINUX', 'ppc64le')
monkeypatch.setenv('CIBW_ARCHS_WINDOWS', 'x86')
@@ -118,7 +114,6 @@ def test_archs_platform_specific(platform, intercepted_build_args, monkeypatch):
def test_archs_platform_native(platform, intercepted_build_args, monkeypatch):
monkeypatch.setattr(platform_module, 'machine', lambda: 'AMD64' if platform == 'windows' else 'x86_64')
monkeypatch.setenv('CIBW_ARCHS', 'native')
main()
@@ -133,7 +128,6 @@ def test_archs_platform_native(platform, intercepted_build_args, monkeypatch):
def test_archs_platform_all(platform, intercepted_build_args, monkeypatch):
monkeypatch.setattr(platform_module, 'machine', lambda: 'x86_64')
monkeypatch.setenv('CIBW_ARCHS', 'all')
main()