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
14 changes: 13 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

### What's Changed

Fixes:

- Windows non-default generators by @henryiii in #137
- Compute the correct default generator for CMake by @henryiii in #139

Testing:

- Support make missing by @henryiii in #140
- Clear `CMAKE_GENERATOR` by @henryiii in #141

## Version 0.1.0

First non-prerelease! Scikit-build-core is ready to be used. The remaining
Expand All @@ -12,7 +24,7 @@ released.

Still preparing for release. One small addition to the error printout.

# ## What's Changed
### What's Changed

Features:

Expand Down
9 changes: 9 additions & 0 deletions src/scikit_build_core/builder/get_requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from .._compat import tomllib
from .._compat.typing import Literal
from .._logging import logger
from ..program_search import (
best_program,
get_cmake_programs,
Expand Down Expand Up @@ -54,6 +55,8 @@ def cmake_ninja_for_build_wheel(
cmake = best_program(get_cmake_programs(module=False), minimum_version=cmake_min)
if cmake is None:
packages.append(f"cmake>={cmake_min}")
else:
logger.debug("Found system CMake: {} - not requiring PyPI package", cmake)

if (
not sys.platform.startswith("win")
Expand All @@ -71,5 +74,11 @@ def cmake_ninja_for_build_wheel(
or not list(get_make_programs())
):
packages.append(f"ninja>={ninja_min}")
else:
logger.debug(
"Found system Make & not on known platform - not requiring PyPI package for Ninja"
)
else:
logger.debug("Found system Ninja: {} - not requiring PyPI package", ninja)

return packages
4 changes: 4 additions & 0 deletions tests/test_get_requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ def which_mock(name: str) -> str | None:
def test_get_requires_for_build_wheel(fp, monkeypatch):
cmake = Path("cmake/path").resolve()
monkeypatch.setattr(shutil, "which", which_mock)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
fp.register([os.fspath(cmake), "--version"], stdout="3.14.0")
assert cmake_ninja_for_build_wheel() == ["cmake>=3.15", *ninja]


def test_get_requires_for_build_wheel_uneeded(fp, monkeypatch):
cmake = Path("cmake/path").resolve()
monkeypatch.setattr(shutil, "which", which_mock)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
fp.register([os.fspath(cmake), "--version"], stdout="3.18.0")
assert cmake_ninja_for_build_wheel() == [*ninja]


def test_get_requires_for_build_wheel_settings(fp, monkeypatch):
cmake = Path("cmake/path").resolve()
monkeypatch.setattr(shutil, "which", which_mock)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
fp.register([os.fspath(cmake), "--version"], stdout="3.18.0")
config = {"cmake.minimum-version": "3.20"}
assert cmake_ninja_for_build_wheel(config) == [
Expand All @@ -53,5 +56,6 @@ def test_get_requires_for_build_wheel_pyproject(fp, monkeypatch, tmp_path):
)
cmake = Path("cmake/path").resolve()
monkeypatch.setattr(shutil, "which", which_mock)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
fp.register([os.fspath(cmake), "--version"], stdout="3.18.0")
assert cmake_ninja_for_build_wheel() == ["cmake>=3.21", *ninja]