Skip to content

Commit 137dc1a

Browse files
committed
Rename simulate_32_bit to enforce_32_bit
1 parent 1646b08 commit 137dc1a

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

cibuildwheel/linux.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def build(options: Options, tmp_path: Path) -> None: # noqa: ARG001
423423

424424
with OCIContainer(
425425
image=build_step.container_image,
426-
simulate_32_bit=build_step.platform_tag.endswith("i686"),
426+
enforce_32_bit=build_step.platform_tag.endswith("i686"),
427427
cwd=container_project_path,
428428
engine=options.globals.container_engine,
429429
) as container:

cibuildwheel/oci_container.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(
8585
self,
8686
*,
8787
image: str,
88-
simulate_32_bit: bool = False,
88+
enforce_32_bit: bool = False,
8989
cwd: PathOrStr | None = None,
9090
engine: OCIContainerEngineConfig = DEFAULT_ENGINE,
9191
):
@@ -94,7 +94,7 @@ def __init__(
9494
raise ValueError(msg)
9595

9696
self.image = image
97-
self.simulate_32_bit = simulate_32_bit
97+
self.enforce_32_bit = enforce_32_bit
9898
self.cwd = cwd
9999
self.name: str | None = None
100100
self.engine = engine
@@ -110,7 +110,7 @@ def __enter__(self) -> OCIContainer:
110110
if detect_ci_provider() == CIProvider.travis_ci and platform.machine() == "ppc64le":
111111
network_args = ["--network=host"]
112112

113-
simulate_32_bit = self.simulate_32_bit
113+
simulate_32_bit = self.enforce_32_bit
114114
container_machine = call(
115115
self.engine.name, "run", "--rm", self.image, "uname", "-m", capture_stdout=True
116116
).strip()

unit_test/option_prepare_test.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,23 @@ def test_build_default_launches(monkeypatch):
7272
kwargs = build_in_container.call_args_list[0][1]
7373
assert "quay.io/pypa/manylinux2014_x86_64" in kwargs["container"]["image"]
7474
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
75-
assert not kwargs["container"]["simulate_32_bit"]
75+
assert not kwargs["container"]["enforce_32_bit"]
7676

7777
identifiers = {x.identifier for x in kwargs["platform_configs"]}
7878
assert identifiers == {f"{x}-manylinux_x86_64" for x in ALL_IDS}
7979

8080
kwargs = build_in_container.call_args_list[1][1]
8181
assert "quay.io/pypa/manylinux2014_i686" in kwargs["container"]["image"]
8282
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
83-
assert kwargs["container"]["simulate_32_bit"]
83+
assert kwargs["container"]["enforce_32_bit"]
8484

8585
identifiers = {x.identifier for x in kwargs["platform_configs"]}
8686
assert identifiers == {f"{x}-manylinux_i686" for x in ALL_IDS}
8787

8888
kwargs = build_in_container.call_args_list[2][1]
8989
assert "quay.io/pypa/musllinux_1_1_x86_64" in kwargs["container"]["image"]
9090
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
91-
assert not kwargs["container"]["simulate_32_bit"]
91+
assert not kwargs["container"]["enforce_32_bit"]
9292

9393
identifiers = {x.identifier for x in kwargs["platform_configs"]}
9494
assert identifiers == {
@@ -98,7 +98,7 @@ def test_build_default_launches(monkeypatch):
9898
kwargs = build_in_container.call_args_list[3][1]
9999
assert "quay.io/pypa/musllinux_1_1_i686" in kwargs["container"]["image"]
100100
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
101-
assert kwargs["container"]["simulate_32_bit"]
101+
assert kwargs["container"]["enforce_32_bit"]
102102

103103
identifiers = {x.identifier for x in kwargs["platform_configs"]}
104104
assert identifiers == {f"{x}-musllinux_i686" for x in ALL_IDS if "pp" not in x}
@@ -141,7 +141,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
141141
kwargs = build_in_container.call_args_list[0][1]
142142
assert "quay.io/pypa/manylinux2014_x86_64" in kwargs["container"]["image"]
143143
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
144-
assert not kwargs["container"]["simulate_32_bit"]
144+
assert not kwargs["container"]["enforce_32_bit"]
145145

146146
identifiers = {x.identifier for x in kwargs["platform_configs"]}
147147
assert identifiers == {"cp36-manylinux_x86_64"}
@@ -150,7 +150,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
150150
kwargs = build_in_container.call_args_list[1][1]
151151
assert "quay.io/pypa/manylinux2014_x86_64" in kwargs["container"]["image"]
152152
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
153-
assert not kwargs["container"]["simulate_32_bit"]
153+
assert not kwargs["container"]["enforce_32_bit"]
154154

155155
identifiers = {x.identifier for x in kwargs["platform_configs"]}
156156
assert identifiers == {
@@ -162,7 +162,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
162162
kwargs = build_in_container.call_args_list[2][1]
163163
assert "quay.io/pypa/manylinux_2_28_x86_64" in kwargs["container"]["image"]
164164
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
165-
assert not kwargs["container"]["simulate_32_bit"]
165+
assert not kwargs["container"]["enforce_32_bit"]
166166
identifiers = {x.identifier for x in kwargs["platform_configs"]}
167167
assert identifiers == {
168168
f"{x}-manylinux_x86_64"
@@ -172,15 +172,15 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
172172
kwargs = build_in_container.call_args_list[3][1]
173173
assert "quay.io/pypa/manylinux2014_i686" in kwargs["container"]["image"]
174174
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
175-
assert kwargs["container"]["simulate_32_bit"]
175+
assert kwargs["container"]["enforce_32_bit"]
176176

177177
identifiers = {x.identifier for x in kwargs["platform_configs"]}
178178
assert identifiers == {f"{x}-manylinux_i686" for x in ALL_IDS}
179179

180180
kwargs = build_in_container.call_args_list[4][1]
181181
assert "quay.io/pypa/musllinux_1_1_x86_64" in kwargs["container"]["image"]
182182
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
183-
assert not kwargs["container"]["simulate_32_bit"]
183+
assert not kwargs["container"]["enforce_32_bit"]
184184

185185
identifiers = {x.identifier for x in kwargs["platform_configs"]}
186186
assert identifiers == {
@@ -190,7 +190,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
190190
kwargs = build_in_container.call_args_list[5][1]
191191
assert "quay.io/pypa/musllinux_1_2_x86_64" in kwargs["container"]["image"]
192192
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
193-
assert not kwargs["container"]["simulate_32_bit"]
193+
assert not kwargs["container"]["enforce_32_bit"]
194194
identifiers = {x.identifier for x in kwargs["platform_configs"]}
195195
assert identifiers == {
196196
f"{x}-musllinux_x86_64" for x in ALL_IDS - {"cp36", "cp37", "cp38", "cp39"} if "pp" not in x
@@ -199,7 +199,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
199199
kwargs = build_in_container.call_args_list[6][1]
200200
assert "quay.io/pypa/musllinux_1_1_i686" in kwargs["container"]["image"]
201201
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
202-
assert kwargs["container"]["simulate_32_bit"]
202+
assert kwargs["container"]["enforce_32_bit"]
203203

204204
identifiers = {x.identifier for x in kwargs["platform_configs"]}
205205
assert identifiers == {f"{x}-musllinux_i686" for x in ALL_IDS if "pp" not in x}

0 commit comments

Comments
 (0)