chore: rework single python tests (#1835)
* chore: rework single python tests * chore(tests): limit number of builds in test_abi3 * chore(tests): limit number of builds in test_before_all * apply review suggestion use `os.path.samefile` rather than comparing `os.stat` directly.
This commit is contained in:
+10
-21
@@ -33,6 +33,8 @@ def cibuildwheel_from_sdist_run(sdist_path, add_env=None, config_file=None):
|
||||
if add_env:
|
||||
env.update(add_env)
|
||||
|
||||
env["CIBW_BUILD"] = "cp{}{}-*".format(*utils.SINGLE_PYTHON_VERSION)
|
||||
|
||||
with TemporaryDirectory() as tmp_output_dir:
|
||||
subprocess.run(
|
||||
[
|
||||
@@ -73,15 +75,11 @@ def test_simple(tmp_path):
|
||||
|
||||
# build the wheels from sdist
|
||||
actual_wheels = cibuildwheel_from_sdist_run(
|
||||
sdist_path,
|
||||
add_env={
|
||||
"CIBW_BEFORE_BUILD": setup_py_assertion_cmd,
|
||||
"CIBW_BUILD": "cp39-*",
|
||||
},
|
||||
sdist_path, add_env={"CIBW_BEFORE_BUILD": setup_py_assertion_cmd}
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [w for w in utils.expected_wheels("spam", "0.1.0") if "cp39" in w]
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0", single_python=True)
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
|
||||
@@ -105,14 +103,10 @@ def test_external_config_file_argument(tmp_path, capfd):
|
||||
)
|
||||
|
||||
# build the wheels from sdist
|
||||
actual_wheels = cibuildwheel_from_sdist_run(
|
||||
sdist_path,
|
||||
add_env={"CIBW_BUILD": "cp39-*"},
|
||||
config_file=str(config_file),
|
||||
)
|
||||
actual_wheels = cibuildwheel_from_sdist_run(sdist_path, config_file=str(config_file))
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [w for w in utils.expected_wheels("spam", "0.1.0") if "cp39" in w]
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0", single_python=True)
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
# check that before-all was run
|
||||
@@ -136,13 +130,10 @@ def test_config_in_pyproject_toml(tmp_path, capfd):
|
||||
sdist_path = make_sdist(project, sdist_dir)
|
||||
|
||||
# build the wheels from sdist
|
||||
actual_wheels = cibuildwheel_from_sdist_run(
|
||||
sdist_path,
|
||||
add_env={"CIBW_BUILD": "cp39-*"},
|
||||
)
|
||||
actual_wheels = cibuildwheel_from_sdist_run(sdist_path)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [w for w in utils.expected_wheels("spam", "0.1.0") if "cp39" in w]
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0", single_python=True)
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
# check that before-build was run
|
||||
@@ -174,13 +165,11 @@ def test_internal_config_file_argument(tmp_path, capfd):
|
||||
|
||||
# build the wheels from sdist, referencing the config file inside
|
||||
actual_wheels = cibuildwheel_from_sdist_run(
|
||||
sdist_path,
|
||||
add_env={"CIBW_BUILD": "cp39-*"},
|
||||
config_file="{package}/wheel_build_config.toml",
|
||||
sdist_path, config_file="{package}/wheel_build_config.toml"
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [w for w in utils.expected_wheels("spam", "0.1.0") if "cp39" in w]
|
||||
expected_wheels = utils.expected_wheels("spam", "0.1.0", single_python=True)
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
# check that before-all was run
|
||||
|
||||
Reference in New Issue
Block a user