Files

36 lines
1.0 KiB
Python
Raw Permalink Normal View History

2020-05-02 22:50:52 +01:00
import textwrap
2021-01-06 13:50:58 -05:00
from . import test_projects, utils
2020-05-02 16:54:19 +01:00
project_with_skip_asserts = test_projects.new_c_project(
2021-04-30 17:56:34 -04:00
setup_py_add=textwrap.dedent(
2021-05-03 11:45:43 -04:00
r"""
2020-05-02 22:42:35 +01:00
# explode if run on Python 2.7 or Python 3.7 (these should be skipped)
2020-05-02 16:54:19 +01:00
if sys.version_info[0:2] == (2, 7):
raise Exception("Python 2.7 should not be built")
2020-05-02 22:42:35 +01:00
if sys.version_info[0:2] == (3, 7):
raise Exception("Python 3.7 should be skipped")
2021-05-03 11:45:43 -04:00
"""
2021-04-30 17:56:34 -04:00
)
2020-05-02 16:54:19 +01:00
)
2020-05-02 22:50:52 +01:00
2020-05-03 14:08:57 +01:00
def test(tmp_path):
2021-05-03 11:45:43 -04:00
project_dir = tmp_path / "project"
2020-05-02 16:54:19 +01:00
project_with_skip_asserts.generate(project_dir)
# build the wheels
2021-04-30 17:56:34 -04:00
actual_wheels = utils.cibuildwheel_run(
project_dir,
add_env={
2021-05-03 11:45:43 -04:00
"CIBW_BUILD": "cp3?-*",
"CIBW_SKIP": "cp37-*",
2021-04-30 17:56:34 -04:00
},
)
2020-05-02 16:54:19 +01:00
# check that we got the right wheels. There should be no 2.7 or 3.7.
2021-04-30 17:56:34 -04:00
expected_wheels = [
2021-05-03 11:45:43 -04:00
w for w in utils.expected_wheels("spam", "0.1.0") if ("-cp3" in w) and ("-cp37" not in w)
2021-04-30 17:56:34 -04:00
]
2020-05-02 16:54:19 +01:00
assert set(actual_wheels) == set(expected_wheels)