scikit_build_core package

Copyright (c) 2022 Henry Schreiner. All rights reserved.

scikit-build-core: PEP 517 builder for Scikit-Build

Subpackages

Submodules

scikit_build_core.cmake module

class scikit_build_core.cmake.CMake(version, cmake_path)[source]

Bases: object

cmake_path: Path
Return type:

Self

version: Version
class scikit_build_core.cmake.CMaker(cmake, source_dir, build_dir, build_type, module_dirs=<factory>, prefix_dirs=<factory>, prefix_roots=<factory>, single_config=True, file_api=None)[source]

Bases: object

build(build_args=(), *, targets=(), verbose=False)[source]
Return type:

None

build_dir: Path
build_type: str
cmake: CMake
configure(*, defines=None, cmake_args=())[source]
Return type:

None

env: dict[str, str]
file_api: Index | None = None
get_generator(*args)[source]

Try to get the generator that will be used to build the project. If it’s not set, return None (default generator will be used).

Return type:

str | None

init_cache(cache_settings)[source]
Return type:

None

init_cache_file: Path = PosixPath('.')
install(prefix, *, strip=False, components=())[source]
Return type:

None

module_dirs: list[Path]
prefix_dirs: list[Path]
prefix_roots: dict[str, list[Path]]
single_config: bool = True
source_dir: Path

scikit_build_core.errors module

exception scikit_build_core.errors.CMakeAccessError(exception, description)[source]

Bases: FailedProcessError

Error raised when CMake access fails.

exception scikit_build_core.errors.CMakeConfigError[source]

Bases: ScikitBuildError

Something is misconfigured.

exception scikit_build_core.errors.CMakeNotFoundError[source]

Bases: NotFoundError

Raised when cmake is not found.

exception scikit_build_core.errors.CMakeVersionError[source]

Bases: ScikitBuildError

Error raised when CMake version is not supported.

exception scikit_build_core.errors.FailedLiveProcessError(*args, msg='')[source]

Bases: Exception

Exception for when output was not being redirected.

exception scikit_build_core.errors.FailedProcessError(exception, description)[source]

Bases: Exception

Exception raised when an call fails.

exception scikit_build_core.errors.NinjaNotFoundError[source]

Bases: NotFoundError

Raised when ninja is not found.

exception scikit_build_core.errors.NinjaVersionError[source]

Bases: ScikitBuildError

Error raised when CMake version is not supported.

exception scikit_build_core.errors.NotFoundError[source]

Bases: ScikitBuildError

Raised when a program is not found.

exception scikit_build_core.errors.ScikitBuildError[source]

Bases: Exception

Base class for all ScikitBuildError errors.

scikit_build_core.format module

Format variables available in the pyproject.toml evaluation

class scikit_build_core.format.PyprojectFormatter[source]

Bases: TypedDict

Format helper for pyproject.toml.

Stores all known variables that can be used for evaluating a formatted string in the pyproject.toml config file.

build_type: str

Build type passed as cmake.build_type.

cache_tag: str

Tag used by the import machinery in the filenames of cached modules, i.e. sys.implementation.cache_tag.

root: RootPathResolver

Root path of the current project.

state: Literal['sdist', 'wheel', 'editable', 'metadata_wheel', 'metadata_editable']

The state of the build.

wheel_tag: str

The tags as computed for the wheel.

class scikit_build_core.format.RootPathResolver(path=<factory>)[source]

Bases: object

Handle {root:uri} like formatting similar to hatchling.

path: Path
scikit_build_core.format.pyproject_format(*, settings=None, state=None, tags=None, dummy=False)[source]

Generate PyprojectFormatter dictionary to use in f-string format.

Return type:

PyprojectFormatter | dict[str, str]