Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/scikit_build_core/program_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_cmake_program(cmake_path: Path) -> Program:
def get_cmake_programs(*, module: bool = True) -> Generator[Program, None, None]:
"""
Get the path and version for CMake. If the version cannot be determined,
yiels (path, None). Otherwise, yields (path, version). Best matches are
yields (path, None). Otherwise, yields (path, version). Best matches are
yielded first.
"""
for cmake_path in _get_cmake_path(module=module):
Expand Down
8 changes: 7 additions & 1 deletion tests/test_build_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,22 @@


@pytest.mark.parametrize("mode", ["sdist", "wheel", "editable"])
@pytest.mark.parametrize("force_make", [False, True])
def test_requires_command(
capsys: pytest.CaptureFixture[str],
monkeypatch: pytest.MonkeyPatch,
tmp_path: Path,
mode: str,
force_make: bool,
) -> None:
monkeypatch.setattr(
sys, "argv", ["scikit_build_core.build", "requires", f"--mode={mode}"]
)
monkeypatch.setattr(shutil, "which", lambda _: None)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
monkeypatch.delenv("CMAKE_ARGS", raising=False)
if force_make:
monkeypatch.setenv("CMAKE_GENERATOR", "Makefiles")
(tmp_path / "pyproject.toml").write_text(PYPROJECT_1)
monkeypatch.chdir(tmp_path)

Expand All @@ -48,7 +54,7 @@ def test_requires_command(
jout = json.loads(out)
if mode == "sdist":
assert frozenset(jout) == {"scikit-build-core", "setuptools-scm"}
elif sysconfig.get_platform().startswith("win-"):
elif sysconfig.get_platform().startswith("win-") or force_make:
assert frozenset(jout) == {
"cmake>=3.15",
"scikit-build-core",
Expand Down
Loading