Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def globals(self) -> GlobalOptions:
build_config = args.only
skip_config = ""
architectures = Architecture.all_archs(self.platform)
enable = set(EnableGroup)
enable = (set(EnableGroup) - {EnableGroup.CPythonExperimentalRiscV64}) | enable

build_selector = BuildSelector(
build_config=build_config,
Expand Down
47 changes: 47 additions & 0 deletions unit_test/main_tests/main_options_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys
import tomllib
from fnmatch import fnmatch
Expand Down Expand Up @@ -115,6 +116,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"),
[
Expand Down