scikit_build_core.build package¶
This is the entry point for the build backend. Items in this module are designed for the build backend API.
- scikit_build_core.build.build_editable(wheel_directory, config_settings=None, metadata_directory=None)[source]¶
- Return type:
- scikit_build_core.build.build_wheel(wheel_directory, config_settings=None, metadata_directory=None)[source]¶
- Return type:
- scikit_build_core.build.prepare_metadata_for_build_editable(metadata_directory, config_settings=None)[source]¶
Prepare metadata for building a wheel. Does not build the wheel. Returns the dist-info directory.
- Return type:
- scikit_build_core.build.prepare_metadata_for_build_wheel(metadata_directory, config_settings=None)[source]¶
Prepare metadata for building a wheel. Does not build the wheel. Returns the dist-info directory.
- Return type:
Submodules¶
scikit_build_core.build.common_wheel_helpers module¶
Shared CMake-build orchestration for the wheel backend (build/wheel.py) and
the hatchling plugin (hatch/plugin.py).
These helpers cover the band that is identical between the two callers: tag
computation, build/wheel/install directory layout, and running
configure/build/install. The wheel-assembly side (WheelWriter vs hatchling
build_data delegation) deliberately stays in each caller.
- scikit_build_core.build.common_wheel_helpers.build_install_extra_build_types(builder, *, settings, wheel_dirs, install_dir, state, name, version, editable, extra_cache_entries=None)[source]¶
Build and install build types beyond the primary into the same wheel.
Single-config generators (Ninja, Makefiles) are reconfigured into a fresh builder for each extra build type; multi-config generators just build the extra
--configwith the original builder. Everything installs to the same prefix. Call this after the primary build and install.- Return type:
- scikit_build_core.build.common_wheel_helpers.build_wheel(builder)[source]¶
Build the configured CMake project.
- Return type:
- scikit_build_core.build.common_wheel_helpers.configure_wheel(*, cmake, settings, wheel_dirs, install_dir, build_dir, state, name, version, extra_cache_entries=None, build_type=None)[source]¶
Configure the CMake project, returning the
Builderto build with.Defaults to the primary (first) build type. It is rerunnable: pass an extra
build_typeto reconfigure a single-config generator into a fresh builder for that build type (seebuild_install_extra_build_types()).- Return type:
- scikit_build_core.build.common_wheel_helpers.editable_rebuild_options(builder)[source]¶
Flags so an editable rebuild reproduces this build’s config selection.
Returns
(build_options, install_options)for the redirect shim’s runtimecmake --build/cmake --install. Deliberately a subset: it excludes--prefix(the shim supplies its own),--strip, and components.
- scikit_build_core.build.common_wheel_helpers.get_build_dir(settings, *, tags, state, editable, has_cmake, fallback, name)[source]¶
Where CMake configures and builds: the source dir for inplace editable builds, the (formatted) configured
build-dir, orfallbackotherwise.nameis the normalized project name, used to fill a{name}placeholder inbuild-dir.- Return type:
- scikit_build_core.build.common_wheel_helpers.get_editable_rebuild_dir(settings, *, build_dir, targetlib, tags, state, name)[source]¶
Persistent install tree for a rebuildable redirect editable.
editable.rebuild-dir(formatted likebuild-dir) overrides the defaultinstall/<targetlib>tree insidebuild-dir. The redirect references the compiled artifacts here by absolute path, so it must be stable between build and run time (#1135).- Return type:
- scikit_build_core.build.common_wheel_helpers.get_install_dir(settings, *, wheel_dirs, targetlib)[source]¶
Resolve
wheel.install-dirto an absolute path inside the wheel tree.- Return type:
- scikit_build_core.build.common_wheel_helpers.get_targetlib(settings)[source]¶
The wheel lib directory the build targets.
wheel.platlibforces the choice; otherwise a CMake build is platlib and a Python-only build purelib.- Return type:
Literal['platlib','purelib']
- scikit_build_core.build.common_wheel_helpers.get_wheel_tag(settings, *, targetlib)[source]¶
Compute the best wheel tag for the current environment.
- Return type:
- scikit_build_core.build.common_wheel_helpers.install_wheel(builder, *, install_dir, editable)[source]¶
Install the built project into the wheel tree.
Skipped for editable inplace builds, which load from the build tree directly.
- Return type:
- scikit_build_core.build.common_wheel_helpers.prepare_editable_rebuild_dir(targetlib_dir, *, guard)[source]¶
Clean and (re)create the persistent install tree for a rebuildable editable.
The tree is wiped so stale artifacts from a previous build don’t linger (a
cmake --installonly ever adds files). The default tree lives insidebuild-dirand is fully owned by scikit-build-core, so wiping is always safe (guard=False).A user-chosen
editable.rebuild-dir(guard=True) may accidentally point at a populated directory – e.g. the package’s own source tree. Wiping that would delete the user’s source (#1135), so refuse unless the directory is empty or carries the cache-tag we drop on a tree we created ourselves. A guarded tree also gets a.gitignoreso its compiled artifacts stay out of version control.- Return type: