break: drop Python 3.8 (#2686)
This commit is contained in:
@@ -26,12 +26,6 @@ def pytest_addoption(parser: pytest.Parser) -> None:
|
||||
choices=("all", *EMULATED_ARCHS),
|
||||
)
|
||||
parser.addoption("--run-podman", action="store_true", default=False, help="run podman tests")
|
||||
parser.addoption(
|
||||
"--run-cp38-universal2",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="macOS cp38 uses the universal2 installer",
|
||||
)
|
||||
parser.addoption(
|
||||
"--enable",
|
||||
action="store",
|
||||
|
||||
@@ -197,7 +197,7 @@ def test_abi_none(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": f"{utils.invoke_pytest()} {{project}}/test",
|
||||
# limit the number of builds for test performance reasons
|
||||
"CIBW_BUILD": "cp38-* cp{}{}-* cp314t-* pp310-*".format(*utils.SINGLE_PYTHON_VERSION),
|
||||
"CIBW_BUILD": "cp39-* cp{}{}-* cp314t-* pp310-*".format(*utils.SINGLE_PYTHON_VERSION),
|
||||
"CIBW_ENABLE": "all",
|
||||
},
|
||||
)
|
||||
|
||||
@@ -50,6 +50,6 @@ def test(tmp_path: Path) -> None:
|
||||
for w in utils.expected_wheels(
|
||||
"spam", "0.1.0", manylinux_versions=manylinux_versions, musllinux_versions=[]
|
||||
)
|
||||
if "-cp38-" in w or "-cp39-" in w
|
||||
if "-cp39-" in w
|
||||
]
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import json
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
import textwrap
|
||||
@@ -77,7 +76,7 @@ def get_versions_from_constraint_file(constraint_file: Path) -> dict[str, str]:
|
||||
return dict(re.findall(VERSION_REGEX, constraint_file_text))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("python_version", ["3.8", "3.13"])
|
||||
@pytest.mark.parametrize("python_version", ["3.9", "3.13"])
|
||||
def test_pinned_versions(
|
||||
tmp_path: Path, python_version: str, build_frontend_env_nouv: dict[str, str]
|
||||
) -> None:
|
||||
@@ -85,12 +84,6 @@ def test_pinned_versions(
|
||||
pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead")
|
||||
if python_version != "3.13" and utils.get_platform() == "pyodide":
|
||||
pytest.skip(f"pyodide does not support Python {python_version}")
|
||||
if (
|
||||
python_version == "3.8"
|
||||
and utils.get_platform() == "windows"
|
||||
and platform.machine() == "ARM64"
|
||||
):
|
||||
pytest.skip(f"Windows ARM64 does not support Python {python_version}")
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
test_projects.new_c_project().generate(project_dir)
|
||||
|
||||
@@ -213,72 +213,3 @@ def test_universal2_testing_on_arm64(
|
||||
python_tag = "cp{0}{1}-cp{0}{1}-".format(*utils.SINGLE_PYTHON_VERSION)
|
||||
expected_wheels = [w for w in ALL_MACOS_WHEELS if python_tag in w and "universal2" in w]
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
|
||||
def test_cp38_arm64_testing(
|
||||
tmp_path: Path, capfd: pytest.CaptureFixture[str], request: pytest.FixtureRequest
|
||||
) -> None:
|
||||
if utils.get_platform() != "macos":
|
||||
pytest.skip("this test is only relevant to macos")
|
||||
if utils.get_xcode_version() < (12, 2):
|
||||
pytest.skip("this test only works with Xcode 12.2 or greater")
|
||||
if platform.machine() != "arm64":
|
||||
pytest.skip("this test only works on arm64")
|
||||
if request.config.getoption("--run-cp38-universal2"):
|
||||
pytest.skip("--run-cp38-universal2 option skips this test")
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project.generate(project_dir)
|
||||
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_BUILD": "cp38-*",
|
||||
"CIBW_TEST_COMMAND": '''python -c "import platform; print('running tests on ' + platform.machine())"''',
|
||||
"CIBW_ARCHS": "x86_64,universal2,arm64",
|
||||
},
|
||||
)
|
||||
|
||||
captured = capfd.readouterr()
|
||||
|
||||
assert "running tests on x86_64" in captured.out
|
||||
assert "running tests on arm64" not in captured.out
|
||||
|
||||
warning_message = "While cibuildwheel can build CPython 3.8 universal2/arm64 wheels, we cannot test the arm64 part of them"
|
||||
assert warning_message in captured.err
|
||||
|
||||
expected_wheels = [w for w in ALL_MACOS_WHEELS if "cp38" in w]
|
||||
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
|
||||
def test_cp38_arm64_testing_universal2_installer(
|
||||
tmp_path: Path, capfd: pytest.CaptureFixture[str], request: pytest.FixtureRequest
|
||||
) -> None:
|
||||
if not request.config.getoption("--run-cp38-universal2"):
|
||||
pytest.skip("needs --run-cp38-universal2 option to run")
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project.generate(project_dir)
|
||||
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_BUILD": "cp38-*",
|
||||
"CIBW_TEST_COMMAND": '''python -c "import platform; print('running tests on ' + platform.machine())"''',
|
||||
"CIBW_ARCHS": "x86_64,universal2,arm64",
|
||||
"MACOSX_DEPLOYMENT_TARGET": "11.0",
|
||||
},
|
||||
)
|
||||
|
||||
captured = capfd.readouterr()
|
||||
|
||||
assert "running tests on x86_64" in captured.out
|
||||
assert "running tests on arm64" in captured.out
|
||||
|
||||
warning_message = "While cibuildwheel can build CPython 3.8 universal2/arm64 wheels, we cannot test the arm64 part of them"
|
||||
assert warning_message not in captured.err
|
||||
|
||||
expected_wheels = [w.replace("10_9", "11_0") for w in ALL_MACOS_WHEELS if "cp38" in w]
|
||||
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
@@ -167,11 +167,6 @@ def test_failing_test(tmp_path: Path) -> None:
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": f"{utils.invoke_pytest()} {{project}}/test",
|
||||
# CPython 3.8 when running on macOS arm64 is unusual. The build
|
||||
# always runs in x86_64, so the arm64 tests are not run. See
|
||||
# #1169 for reasons why. That means the build succeeds, which
|
||||
# we don't want. So we skip that build.
|
||||
"CIBW_SKIP": "cp38-macosx_arm64",
|
||||
},
|
||||
)
|
||||
|
||||
@@ -199,9 +194,6 @@ def test_bare_pytest_invocation(
|
||||
"CIBW_TEST_COMMAND": (
|
||||
"python -m pytest" if test_runner == "pytest" else "python -m unittest"
|
||||
),
|
||||
# Skip CPython 3.8 on macOS arm64, see comment above in
|
||||
# 'test_failing_test'
|
||||
"CIBW_SKIP": "cp38-macosx_arm64",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
+2
-11
@@ -280,7 +280,6 @@ def _expected_wheels(
|
||||
]
|
||||
elif python_abi_tags is None:
|
||||
python_abi_tags = [
|
||||
"cp38-cp38",
|
||||
"cp39-cp39",
|
||||
"cp310-cp310",
|
||||
"cp311-cp311",
|
||||
@@ -297,7 +296,6 @@ def _expected_wheels(
|
||||
|
||||
if EnableGroup.PyPyEoL in enable_groups:
|
||||
python_abi_tags += [
|
||||
"pp38-pypy38_pp73",
|
||||
"pp39-pypy39_pp73",
|
||||
"pp310-pypy310_pp73",
|
||||
]
|
||||
@@ -312,10 +310,6 @@ def _expected_wheels(
|
||||
"graalpy312-graalpy250_312_native",
|
||||
]
|
||||
|
||||
if machine_arch == "ARM64" and platform == "windows":
|
||||
# no CPython 3.8 on Windows ARM64
|
||||
python_abi_tags = [t for t in python_abi_tags if not t.startswith("cp38")]
|
||||
|
||||
if machine_arch not in PYPY_ARCHS:
|
||||
python_abi_tags = [tag for tag in python_abi_tags if not tag.startswith("pp")]
|
||||
|
||||
@@ -360,12 +354,9 @@ def _expected_wheels(
|
||||
|
||||
elif platform == "macos":
|
||||
if python_abi_tag.startswith("pp"):
|
||||
if python_abi_tag.startswith("pp38"):
|
||||
min_macosx = macosx_deployment_target
|
||||
else:
|
||||
min_macosx = _floor_macosx(macosx_deployment_target, "10.15")
|
||||
min_macosx = _floor_macosx(macosx_deployment_target, "10.15")
|
||||
elif python_abi_tag.startswith("cp"):
|
||||
if python_abi_tag.startswith(("cp38", "cp39", "cp310", "cp311")):
|
||||
if python_abi_tag.startswith(("cp39", "cp310", "cp311")):
|
||||
min_macosx = macosx_deployment_target
|
||||
elif python_abi_tag.startswith(("cp312", "cp313")):
|
||||
min_macosx = _floor_macosx(macosx_deployment_target, "10.13")
|
||||
|
||||
Reference in New Issue
Block a user