scikit_build_core.builder package¶
The items in this module are general tools for building wheels, useful by both the build backend and plugins.
Submodules¶
scikit_build_core.builder.builder module¶
- class scikit_build_core.builder.builder.Builder(settings, config)[source]¶
Bases:
object- configure(*, defines, cache_entries=None, name=None, version=None, limited_api=None, configure_args=())[source]¶
- Return type:
- install(install_dir, *, build_type=None)[source]¶
Install to a path.
Warning: if a package hard-codes CMAKE_INSTALL_PREFIX in the install commands, this will not rewrite those; set that variable when configuring for maximum compatibility.
- Return type:
- settings: ScikitBuildSettings¶
- scikit_build_core.builder.builder.archs_to_tags(archs)[source]¶
Convert a list of architectures to a list of tags (e.g. “universal2”).
- scikit_build_core.builder.builder.get_archs(env, cmake_args=())[source]¶
Takes macOS platform settings and returns a list of platforms.
- Example (macOS):
ARCHFLAGS=”-arch x86_64” -> [“x86_64”] ARCHFLAGS=”-arch x86_64 -arch arm64” -> [“x86_64”, “arm64”]
Returns an empty list otherwise or if ARCHFLAGS is not set.
- scikit_build_core.builder.builder.get_cmake_args_from_settings(settings, env)[source]¶
Get CMake args from the settings and environment (settings
cmake.argsplus the filteredCMAKE_ARGSenvironment variable).
- scikit_build_core.builder.builder.set_environment_from_settings(env, settings)[source]¶
Apply the
tool.scikit-build.envtable toenv(mutated in place).Each entry is resolved against
envand written back unless it is already set (setdefaultsemantics), withforce = trueoverriding. Entries that resolve to nothing are skipped.- Return type:
scikit_build_core.builder.generator module¶
- scikit_build_core.builder.generator.parse_generator(args)[source]¶
Extract the generator from a sequence of CMake arguments, handling both the joined
-GNinjaand the two-token-G Ninjaforms. Returns the last generator specified, or None if no-Gis present.
- scikit_build_core.builder.generator.set_environment_for_gen(generator, cmake, env, ninja_settings, *, env_managed_keys=())[source]¶
This function modifies the environment as needed to safely set a generator. You should have used CMAKE_GENERATOR already to get the input generator string.
A reasonable default generator is set if the environment does not already have one set; if ninja is present, ninja will be used over make on Unix.
If gen is not None, then that will be the target generator.
scikit_build_core.builder.get_requires module¶
- class scikit_build_core.builder.get_requires.GetRequires(settings=<factory>)[source]¶
Bases:
object- settings: ScikitBuildSettings¶
scikit_build_core.builder.macos module¶
- class scikit_build_core.builder.macos.MacOSVer(major, minor)[source]¶
Bases:
NamedTuple
- scikit_build_core.builder.macos.get_cmake_osx_deployment_target(cmake_defines=None, cmake_args=())[source]¶
Find an explicit
CMAKE_OSX_DEPLOYMENT_TARGETknown before the build directory exists: acmake.defineentry or a-DCMAKE_OSX_DEPLOYMENT_TARGET=incmake.args. Handles both the joined-DVAR=valueand the two-token-D VAR=valueforms (mirroringparse_generator’s-Ghandling). The args value wins over the define, mirroring CMake’s own command-line-over-cache precedence. Settings inCMakeLists.txtor a toolchain file cannot be seen here and are not honored.
- scikit_build_core.builder.macos.get_macosx_deployment_target(*, arm, cmake_defines=None, cmake_args=())[source]¶
Get the deployment target used for the wheel platform tag. An explicit
CMAKE_OSX_DEPLOYMENT_TARGETfromcmake.defineorcmake.argswins; otherwise theMACOSX_DEPLOYMENT_TARGETenvironment variable is used (this is the fallback default CMake itself applies). If neither is set, the current macOS version is used. If arm=True, then this will always return at least (11, 0). Versions after 11 will be normalized to 0 for minor version.- Return type:
scikit_build_core.builder.sysconfig module¶
- scikit_build_core.builder.sysconfig.get_abi_flags()[source]¶
Return the ABI flags for the current Python interpreter. Derived from
packaging.tags.sys_tags()since that works on Windows.- Return type:
- scikit_build_core.builder.sysconfig.get_cmake_platform(env)[source]¶
Return the CMake platform name for a platform, respecting VSCMD_ARG_TGT_ARCH.
- Return type: