-
Couldn't load subscription status.
- Fork 292
Assert that build will fail if there is no configuration to build #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bbda204
assert that build will fail if there is no configuration to build
Czaki 3af48ab
use universal_newlines to get string instead of bytes
Czaki a059f3a
remove python 3.4 from travis matrix build
Czaki f00f9d1
Change text of exception, replace test spam module for more generic
Czaki 26ad60e
remove suggestion to check documentation.
Czaki 02b2fe4
fail only in CIBW_BUILD match no python configuration
Czaki 85068a3
fix python convention
Czaki 99f8318
return to assumption to check empty list per system
Czaki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import pytest | ||
| import os | ||
| import sys | ||
| import subprocess | ||
| import utils | ||
|
|
||
|
|
||
| def test_wrong_identifier_py2_py34(): | ||
| if not (sys.version_info[0] == 2 or (sys.version_info[0] == 3 and sys.version_info[1] == 4)): | ||
| pytest.skip("test for python 2.7 and 3.4") | ||
| project_dir = os.path.dirname(__file__) | ||
|
|
||
| with pytest.raises(subprocess.CalledProcessError) as excinfo: | ||
| utils.cibuildwheel_run(project_dir, add_env={'CIBW_BUILD':'py368-*'}) | ||
|
|
||
| def test_wrong_identifier(): | ||
| if sys.version_info[0] == 2: | ||
| pytest.skip("test not running on python 2.7") | ||
| if sys.version_info[0] == 3 and sys.version_info[1] == 4: | ||
| pytest.skip("test not running on python 3.4") | ||
| project_dir = os.path.dirname(__file__) | ||
| env = os.environ.copy() | ||
| env['CIBW_BUILD'] = 'py368-*' | ||
|
|
||
| with pytest.raises(subprocess.CalledProcessError) as excinfo: | ||
| subprocess.run( | ||
| [sys.executable, '-m', 'cibuildwheel', project_dir], | ||
| env=env, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, | ||
| universal_newlines=True | ||
| ) | ||
|
|
||
| assert "configuration to build. Check 'CIBW_BUILD' environment variable" in excinfo.value.stderr | ||
|
|
||
| def skip_all(tmp_path): | ||
| tmp_path = str(tmp_path) | ||
| project_dir = os.path.dirname(__file__) | ||
| utils.cibuildwheel_run(project_dir, add_env={'CIBW_SKIP':'*'}, output_dir=tmp_path) | ||
| assert len(os.listdir(tmp_path)) == 0 | ||
|
|
||
|
|
||
| def test_old_manylinux(): | ||
| if sys.version_info[0] == 2: | ||
| pytest.skip("test not running on python 2.7") | ||
| if sys.version_info[0] == 3 and sys.version_info[1] == 4: | ||
| pytest.skip("test not running on python 3.4") | ||
| if utils.platform != 'linux': | ||
| pytest.skip('the old manylinux test is only relevant to the linux build') | ||
|
|
||
| project_dir = os.path.dirname(__file__) | ||
|
|
||
| env = os.environ.copy() | ||
| env['CIBW_BUILD'] = "*-manylinux1_x86_64 py36-*" | ||
|
|
||
| res = subprocess.run( | ||
| [sys.executable, '-m', 'cibuildwheel', project_dir], | ||
| env=env, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, | ||
| universal_newlines=True | ||
| ) | ||
|
|
||
| assert "Build identifiers with 'manylinux1' been deprecated. Replacing all occurences of"\ | ||
| " 'manylinux1' by 'manylinux' in the option 'CIBW_BUILD'" in res.stderr | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from setuptools import setup, Extension | ||
|
|
||
| setup( | ||
| name="spam", | ||
| ext_modules=[Extension('spam', sources=['spam.c'])], | ||
| version="0.1.0", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #include <Python.h> | ||
|
|
||
| static PyObject * | ||
| spam_system(PyObject *self, PyObject *args) | ||
| { | ||
| const char *command; | ||
| int sts; | ||
|
|
||
| if (!PyArg_ParseTuple(args, "s", &command)) | ||
| return NULL; | ||
| sts = system(command); | ||
| return PyLong_FromLong(sts); | ||
| } | ||
|
|
||
| /* Module initialization */ | ||
|
|
||
| #if PY_MAJOR_VERSION >= 3 | ||
| #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void) | ||
| #define MOD_DEF(m, name, doc, methods, module_state_size) \ | ||
| static struct PyModuleDef moduledef = { \ | ||
| PyModuleDef_HEAD_INIT, name, doc, module_state_size, methods, }; \ | ||
| m = PyModule_Create(&moduledef); | ||
| #define MOD_RETURN(m) return m; | ||
| #else | ||
| #define MOD_INIT(name) PyMODINIT_FUNC init##name(void) | ||
| #define MOD_DEF(m, name, doc, methods, module_state_size) \ | ||
| m = Py_InitModule3(name, methods, doc); | ||
| #define MOD_RETURN(m) return; | ||
| #endif | ||
|
|
||
| static PyMethodDef module_methods[] = { | ||
| {"system", (PyCFunction)spam_system, METH_VARARGS, | ||
| "Execute a shell command."}, | ||
| {NULL} /* Sentinel */ | ||
| }; | ||
|
|
||
| MOD_INIT(spam) | ||
| { | ||
| PyObject* m; | ||
|
|
||
| MOD_DEF(m, | ||
| "spam", | ||
| "Example module", | ||
| module_methods, | ||
| -1) | ||
|
|
||
| MOD_RETURN(m) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.