feat: add deprecation warning for cpython-experimental-riscv64 enable (#2526)
This commit is contained in:
@@ -417,6 +417,13 @@ def detect_warnings(*, options: Options) -> Generator[str, None, None]:
|
||||
build_selector = options.globals.build_selector
|
||||
test_selector = options.globals.test_selector
|
||||
|
||||
if EnableGroup.CPythonExperimentalRiscV64 in build_selector.enable:
|
||||
yield (
|
||||
"'cpython-experimental-riscv64' enable is deprecated and will be removed in a future version. "
|
||||
"It should be removed from tool.cibuildwheel.enable in pyproject.toml "
|
||||
"or CIBW_ENABLE environment variable."
|
||||
)
|
||||
|
||||
all_valid_identifiers = [
|
||||
config.identifier
|
||||
for module in ALL_PLATFORM_MODULES.values()
|
||||
|
||||
@@ -665,7 +665,7 @@ class Options:
|
||||
build_config = args.only
|
||||
skip_config = ""
|
||||
architectures = Architecture.all_archs(self.platform)
|
||||
enable = set(EnableGroup)
|
||||
enable |= set(EnableGroup) - {EnableGroup.CPythonExperimentalRiscV64}
|
||||
|
||||
build_selector = BuildSelector(
|
||||
build_config=build_config,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import sys
|
||||
import tomllib
|
||||
from fnmatch import fnmatch
|
||||
@@ -141,6 +142,52 @@ def test_empty_selector(monkeypatch):
|
||||
assert e.value.code == 3
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("platform", "intercepted_build_args")
|
||||
def test_riscv64_warning1(monkeypatch, capsys):
|
||||
monkeypatch.setenv("CIBW_ENABLE", "cpython-experimental-riscv64")
|
||||
|
||||
main()
|
||||
|
||||
_, err = capsys.readouterr()
|
||||
print(err)
|
||||
assert "'cpython-experimental-riscv64' enable is deprecated" in err
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("platform", "intercepted_build_args")
|
||||
def test_riscv64_warning2(monkeypatch, capsys, tmp_path):
|
||||
local_path = tmp_path / "tmp_project"
|
||||
os.mkdir(local_path) # noqa:PTH102 Path.mkdir has been monkeypatched already
|
||||
local_path.joinpath("setup.py").touch()
|
||||
|
||||
monkeypatch.setattr(
|
||||
sys, "argv", ["cibuildwheel", "--only", "cp313-manylinux_riscv64", str(local_path)]
|
||||
)
|
||||
monkeypatch.setenv("CIBW_ENABLE", "cpython-experimental-riscv64")
|
||||
|
||||
main()
|
||||
|
||||
_, err = capsys.readouterr()
|
||||
print(err)
|
||||
assert "'cpython-experimental-riscv64' enable is deprecated" in err
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("platform", "intercepted_build_args")
|
||||
def test_riscv64_no_warning(monkeypatch, capsys, tmp_path):
|
||||
local_path = tmp_path / "tmp_project"
|
||||
os.mkdir(local_path) # noqa:PTH102 Path.mkdir has been monkeypatched already
|
||||
local_path.joinpath("setup.py").touch()
|
||||
|
||||
monkeypatch.setattr(
|
||||
sys, "argv", ["cibuildwheel", "--only", "cp313-manylinux_riscv64", str(local_path)]
|
||||
)
|
||||
|
||||
main()
|
||||
|
||||
_, err = capsys.readouterr()
|
||||
print(err)
|
||||
assert "'cpython-experimental-riscv64' enable is deprecated" not in err
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("architecture", "image", "full_image"),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user