skbuild.command package

Collection of objects allowing to customize behavior of standard distutils and setuptools commands.

class skbuild.command.CommandMixinProtocol(*args, **kwargs)[source]

Bases: Protocol

Protocol for commands that use CMake.

build_base: str
distribution: Distribution
finalize_options(*args: object, **kwargs: object) None[source]
install_lib: str | None
install_platlib: str
outfiles: list[str]
class skbuild.command.set_build_base_mixin[source]

Bases: object

Mixin allowing to override distutils and setuptools commands.

finalize_options(*args: object, **kwargs: object) None[source]

Override built-in function and set a new build_base.

Submodules

skbuild.command.bdist module

This module defines custom implementation of bdist setuptools command.

class skbuild.command.bdist.bdist(dist)[source]

Bases: set_build_base_mixin, bdist

Custom implementation of bdist setuptools command.

skbuild.command.bdist_wheel module

This module defines custom implementation of bdist_wheel setuptools command.

class skbuild.command.bdist_wheel.bdist_wheel(dist, **kw)[source]

Bases: set_build_base_mixin, bdist_wheel

Custom implementation of bdist_wheel setuptools command.

run(*args: object, **kwargs: object) None[source]

Handle –hide-listing option.

write_wheelfile(wheelfile_base: str, _: None = None) None[source]

Write skbuild <version> as a wheel generator. See PEP-0427 for more details.

skbuild.command.build module

This module defines custom implementation of build setuptools command.

class skbuild.command.build.build(dist, **kw)[source]

Bases: set_build_base_mixin, build

Custom implementation of build setuptools command.

skbuild.command.build_ext module

This module defines custom implementation of build_ext setuptools command.

class skbuild.command.build_ext.build_ext(dist, **kw)[source]

Bases: set_build_base_mixin, build_ext

Custom implementation of build_ext setuptools command.

copy_extensions_to_source() None[source]

This function is only-called when doing inplace build.

It is customized to ensure the extensions compiled using distutils are copied back to the source tree instead of the skbuild.constants.CMAKE_INSTALL_DIR().

skbuild.command.build_py module

This module defines custom implementation of build_py setuptools command.

class skbuild.command.build_py.build_py(dist, **kw)[source]

Bases: set_build_base_mixin, build_py

Custom implementation of build_py setuptools command.

build_module(module: str | list[str] | tuple[str, ...], module_file: str, package: str) None[source]

Handle –hide-listing option.

Increments outfiles_count.

find_modules() list[tuple[str, str, str]][source]

Finds individually-specified Python modules, ie. those listed by module name in ‘self.py_modules’. Returns a list of tuples (package, module_base, filename): ‘package’ is a tuple of the path through package-space to the module; ‘module_base’ is the bare (no packages, no dots) module name, and ‘filename’ is the path to the “.py” file (relative to the distribution root) that implements the module.

initialize_options() None[source]

Handle –hide-listing option.

Initializes outfiles_count.

run(*args: object, **kwargs: object) None[source]

Handle –hide-listing option.

Display number of copied files. It corresponds to the value of outfiles_count.

skbuild.command.clean module

This module defines custom implementation of clean setuptools command.

class skbuild.command.clean.clean(dist, **kw)[source]

Bases: set_build_base_mixin, clean

Custom implementation of clean setuptools command.

run() None[source]

After calling the super class implementation, this function removes the directories specific to scikit-build.

skbuild.command.egg_info module

This module defines custom implementation of egg_info setuptools command.

class skbuild.command.egg_info.egg_info(dist, **kw)[source]

Bases: set_build_base_mixin, egg_info

Custom implementation of egg_info setuptools command.

finalize_options(*args: Any, **kwargs: Any) None[source]

Override built-in function and set a new build_base.

skbuild.command.generate_source_manifest module

This module defines custom generate_source_manifest setuptools command.

class skbuild.command.generate_source_manifest.generate_source_manifest(dist)[source]

Bases: set_build_base_mixin, Command

Custom setuptools command generating a MANIFEST file if not already provided.

description = 'generate source MANIFEST'
finalize_options(*args: object, **kwargs: object) None[source]

Set final values for all the options that this command supports.

initialize_options() None[source]

Set default values for all the options that this command supports.

run() None[source]

If neither a MANIFEST, nor a MANIFEST.in file is provided, and we are in a git repo, try to create a MANIFEST.in file from the output of git ls-tree –name-only -r HEAD.

We need a reliable way to tell if an existing MANIFEST file is one we’ve generated. distutils already uses a first-line comment to tell if the MANIFEST file was generated from MANIFEST.in, so we use a dummy file, _skbuild_MANIFEST, to avoid confusing distutils.

skbuild.command.install module

This module defines custom implementation of install setuptools command.

class skbuild.command.install.install(dist, **kw)[source]

Bases: set_build_base_mixin, install

Custom implementation of install setuptools command.

finalize_options(*args: Any, **kwargs: Any) None[source]

Ensure that if the distribution is non-pure, all modules are installed in self.install_platlib.

Note

setuptools.dist.Distribution.has_ext_modules() is overridden in setuptools_wrap.setup().

skbuild.command.install_lib module

This module defines custom implementation of install_lib setuptools command.

class skbuild.command.install_lib.install_lib(dist, **kw)[source]

Bases: set_build_base_mixin, install_lib

Custom implementation of install_lib setuptools command.

install() list[str][source]

Handle –hide-listing option.

skbuild.command.install_scripts module

This module defines custom implementation of install_scripts setuptools command.

class skbuild.command.install_scripts.install_scripts(dist, **kw)[source]

Bases: set_build_base_mixin, install_scripts

Custom implementation of install_scripts setuptools command.

run(*args: Any, **kwargs: Any) None[source]

Handle –hide-listing option.

skbuild.command.sdist module

This module defines custom implementation of sdist setuptools command.

class skbuild.command.sdist.sdist(dist, **kw)[source]

Bases: set_build_base_mixin, sdist

Custom implementation of sdist setuptools command.

make_archive(base_name: str, _format: str, root_dir: str | None = None, base_dir: str | None = None, owner: str | None = None, group: str | None = None) str[source]

Handle –hide-listing option.

make_release_tree(base_dir: str, files: Sequence[str]) None[source]

Handle –hide-listing option.

run(*args: object, **kwargs: object) None[source]

Force egg_info.egg_info command to run.

skbuild.command.test module