From 5d6028d89ad9f89f1e9fddd77ca6eb7535966ff7 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Mon, 4 Nov 2019 00:32:18 +0100 Subject: [PATCH] Change text of exception, replace test spam module for more generic --- cibuildwheel/linux.py | 2 +- cibuildwheel/macos.py | 2 +- cibuildwheel/windows.py | 2 +- .../cibuildwheel_test.py | 3 +-- test/09_platform_selector_problem/spam.c | 13 ++----------- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 32087dff8..9ad1d2d29 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -42,7 +42,7 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef python_configurations = get_python_configurations(build_selector) if len(python_configurations) == 0: - raise ValueError("Empty list of configuration to build. Check 'CIBW_BUILD' and 'CIBW_SKIP' environment variables. " \ + raise ValueError("No linux build identifiers are selected after applying 'CIBW_BUILD' and 'CIBW_SKIP'. " \ "Check documentation if python version identifier do not change") platforms = [ ('manylinux_x86_64', manylinux_images['x86_64']), diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index 9d15db5b9..e94ea5dae 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -28,7 +28,7 @@ def get_python_configurations(build_selector): def build(project_dir, output_dir, test_command, test_requires, test_extras, before_build, build_verbosity, build_selector, environment): python_configurations = get_python_configurations(build_selector) if len(python_configurations) == 0: - raise ValueError("Empty list of configuration to build. Check 'CIBW_BUILD' and 'CIBW_SKIP' environment variables " \ + raise ValueError("No macosx build identifiers are selected after applying 'CIBW_BUILD' and 'CIBW_SKIP'. " \ "Check documentation if python version identifier do not change") get_pip_url = 'https://bootstrap.pypa.io/get-pip.py' get_pip_script = '/tmp/get-pip.py' diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index c07c37acc..87fd4ead5 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -116,7 +116,7 @@ def shell(args, env=None, cwd=None): python_configurations = get_python_configurations(build_selector) if len(python_configurations) == 0: - raise ValueError("Empty list of configuration to build. Check 'CIBW_BUILD' and 'CIBW_SKIP' environment variables " \ + raise ValueError("No windows build identifiers are selected after applying 'CIBW_BUILD' and 'CIBW_SKIP'. " \ "Check documentation if python version identifier do not change") for config in python_configurations: config_python_path = get_python_path(config) diff --git a/test/09_platform_selector_problem/cibuildwheel_test.py b/test/09_platform_selector_problem/cibuildwheel_test.py index dd78d5a03..e2f176036 100644 --- a/test/09_platform_selector_problem/cibuildwheel_test.py +++ b/test/09_platform_selector_problem/cibuildwheel_test.py @@ -29,8 +29,7 @@ def test_wrong_identifier(): universal_newlines=True ) - assert "Empty list of configuration to build" in excinfo.value.stderr - + assert "build identifiers are selected after applying 'CIBW_BUILD' and 'CIBW_SKIP'" in excinfo.value.stderr def test_old_manylinux(): diff --git a/test/09_platform_selector_problem/spam.c b/test/09_platform_selector_problem/spam.c index 0e50eba9d..d1ab0f225 100644 --- a/test/09_platform_selector_problem/spam.c +++ b/test/09_platform_selector_problem/spam.c @@ -1,23 +1,14 @@ #include -#if defined(__linux__) -#include -#endif static PyObject * spam_system(PyObject *self, PyObject *args) { const char *command; - int sts = 0; + int sts; if (!PyArg_ParseTuple(args, "s", &command)) return NULL; - -#if defined(__linux__) - sts = malloc_info(0, stdout); -#endif - if (sts == 0) { - sts = system(command); - } + sts = system(command); return PyLong_FromLong(sts); }