Skip to content

Commit d0f6668

Browse files
committed
Revert "tests: rework skips to show uv vs. build (again)"
This reverts commit dbf3385.
1 parent dbf3385 commit d0f6668

File tree

2 files changed

+17
-52
lines changed

2 files changed

+17
-52
lines changed

cibuildwheel/platforms/android.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def setup_env(
227227

228228
# Install build tools
229229
if build_frontend not in {"build", "build[uv]"}:
230-
msg = f"Android requires the build frontend to be 'build' or 'build[uv'], not {build_frontend!r}"
230+
msg = "Android requires the build frontend to be 'build'"
231231
raise errors.FatalError(msg)
232232
call(*pip, "install", "build", *constraint_flags(dependency_constraint), env=build_env)
233233

test/conftest.py

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -151,64 +151,29 @@ def docker_warmup_fixture(
151151
return None
152152

153153

154-
PLATFORM = get_platform()
155-
UV_PATH = find_uv()
156-
157-
BUILD_FRONTEND_PARAMS = [
158-
pytest.param(
159-
"build[uv]",
160-
marks=[
161-
pytest.mark.skipif(
162-
PLATFORM == "pyodide",
163-
reason="Can't use uv with pyodide yet",
164-
),
165-
pytest.mark.skipif(
166-
UV_PATH is None,
167-
reason="Can't find uv, so skipping uv tests",
168-
),
169-
],
170-
id="build[uv]",
171-
),
172-
pytest.param(
173-
"build",
174-
marks=pytest.mark.skipif(
175-
UV_PATH is not None and PLATFORM not in {"android", "ios"},
176-
reason="No need to check build when build[uv] is checked (faster)",
177-
),
178-
id="build",
179-
),
180-
pytest.param(
181-
"pip",
182-
marks=pytest.mark.skipif(
183-
PLATFORM in {"pyodide", "ios", "android"},
184-
reason=f"Can't use pip as build frontend for {PLATFORM}",
185-
),
186-
id="pip",
187-
),
188-
]
189-
190-
191-
@pytest.fixture(
192-
params=[
193-
pytest.param(
194-
"pip",
195-
marks=pytest.mark.skipif(
196-
PLATFORM in {"pyodide", "ios", "android"},
197-
reason=f"Can't use pip as build frontend for {PLATFORM}",
198-
),
199-
),
200-
"build",
201-
]
202-
)
154+
@pytest.fixture(params=["pip", "build"])
203155
def build_frontend_env_nouv(request: pytest.FixtureRequest) -> dict[str, str]:
204156
frontend = request.param
157+
if get_platform() == "pyodide" and frontend == "pip":
158+
pytest.skip("Can't use pip as build frontend for pyodide platform")
159+
205160
return {"CIBW_BUILD_FRONTEND": frontend}
206161

207162

208-
@pytest.fixture(params=BUILD_FRONTEND_PARAMS)
163+
@pytest.fixture(params=["pip", "build", "build[uv]"])
209164
def build_frontend_env(request: pytest.FixtureRequest) -> dict[str, str]:
210-
print(f"{PLATFORM=}")
211165
frontend = request.param
166+
platform = get_platform()
167+
if platform in {"pyodide", "ios", "android"} and frontend == "pip":
168+
pytest.skip("Can't use pip as build frontend for pyodide/ios/android platform")
169+
if platform == "pyodide" and frontend == "build[uv]":
170+
pytest.skip("Can't use uv with pyodide yet")
171+
uv_path = find_uv()
172+
if uv_path is None and frontend == "build[uv]":
173+
pytest.skip("Can't find uv, so skipping uv tests")
174+
if uv_path is not None and frontend == "build" and platform not in {"android", "ios"}:
175+
pytest.skip("No need to check build when uv is present")
176+
212177
return {"CIBW_BUILD_FRONTEND": frontend}
213178

214179

0 commit comments

Comments
 (0)