bundle.pybind.services

Submodules

Classes

CMakeService

A utility class for running CMake commands.

PkgConfigService

Package Contents

class bundle.pybind.services.CMakeService[source]

A utility class for running CMake commands.

class BuildType(*args, **kwds)[source]

Bases: enum.Enum

Enum-like class for CMake build types.

DEBUG = 'Debug'
RELEASE = 'Release'
RELWITHDEBINFO = 'RelWithDebInfo'
MINSIZEREL = 'MinSizeRel'
static configure(source_dir: pathlib.Path, build_dir_name: str, install_prefix: pathlib.Path | None = None, build_type: BuildType = BuildType.RELEASE, extra_args: list[str] | None = None) None[source]
Async:

Configures a CMake project.

Parameters:
  • source_dir – The root directory of the source code (contains CMakeLists.txt).

  • build_dir_name – The name of the build directory, relative to source_dir.

  • install_prefix – Optional path for CMAKE_INSTALL_PREFIX.

  • extra_args – Optional list of extra arguments to pass to cmake.

static build(source_dir: pathlib.Path, build_dir_name: str, target: str | None = None, build_type: BuildType = BuildType.RELEASE, extra_args: list[str] | None = None) None[source]
Async:

Builds a CMake project.

Parameters:
  • source_dir – The root directory of the source code (used as CWD for the command).

  • build_dir_name – The name of the build directory, relative to source_dir.

  • target – Optional build target (e.g., “install”).

  • extra_args – Optional list of extra arguments to pass to cmake –build.

class bundle.pybind.services.PkgConfigService(executable: str = 'pkg-config')[source]
executable = 'pkg-config'
async query(package_name: str, option: str, extra_dirs: list[str] | None = None) list[str][source]

Runs pkg-config for a single package with the given option. Returns the output as a list of strings.

async resolve_pkgconfig(pkg_name: str, extra_dirs: list[str] | None = None) bundle.pybind.resolved.PkgConfigResult[source]
async resolve(spec: bundle.pybind.specs.PkgConfigSpec) bundle.pybind.resolved.PkgConfigResolved[source]

Resolves PkgConfigSpec to PkgConfigResolved by calling pkg-config for each package.