Skip to main content

Build helpers and PEP 517 backend for IVPM-managed Python extension projects

Project description

ivpm-build

Build tooling for Python packages that wrap native C/C++ extensions, with IVPM integration for cross-package dependency resolution.

ivpm-build handles the full native-extension build pipeline:

  1. CMake build — configure, build, and install native code via CmakeBuilder
  2. Python extension compile — Cython/C++ extension compilation via a BuildExt command that injects include and library paths from IVPM-managed dependencies
  3. Shared-library packagingInstallLib copies native .so/.dll/.dylib files into the wheel alongside the Python extension module
  4. IVPM dependency resolution — queries the IVPM package registry (PkgInfoRgy) to obtain include dirs, library dirs, and Cython .pxd files from other IVPM-managed native packages listed in ivpm.yaml

When to use ivpm-build

Use ivpm-build when your Python package:

  • wraps a C/C++ library built with CMake, and/or
  • exposes a Cython extension that links against native libraries from other IVPM-managed packages (e.g. debug-mgr, ciostream, antlr4-runtime)

Installation

pip install ivpm-build

Quick Start

pyproject.toml (recommended)

[build-system]
requires = ["setuptools>=64", "wheel", "cython", "ivpm-build", "ivpm"]
build-backend = "setuptools.build_meta"

setup.py

from ivpm_build.setup import setup   # replaces ivpm.setup.setup
from setuptools import Extension

ext = Extension("mypkg._core", sources=["python/core.pyx"], language="c++")

setup(
    name="mypkg",
    ext_modules=[ext],
    ivpm_extdep_pkgs=["debug-mgr", "ciostream"],   # IVPM deps → include/lib paths
    ivpm_extra_data={
        "mypkg": [
            ("build/{libdir}/{libpref}mypkg{dllext}", ""),  # bundle native lib
        ]
    },
)

BuildExt (injected by setup()) automatically resolves include directories, library directories, and Cython .pxd search paths from each package listed in ivpm_extdep_pkgs via the IVPM registry.

CMake-only build

from ivpm_build.cmake import CmakeBuilder

builder = CmakeBuilder(proj_dir="/path/to/project")
builder.run()   # cmake configure → build → install

Integration paths

Path When to use
Path 1 — swap from ivpm.setup import setupfrom ivpm_build.setup import setup Existing setup.py project, zero-change migration
Path 2apply_ivpm_setup() in setup.py + pyproject.toml metadata Fine-grained control over extension descriptors
Path 3 — pure pyproject.toml with build-backend = "ivpm_build.backend" New projects or full modernisation

See the migration guide for step-by-step instructions.

Documentation

Full documentation: https://fvutils.github.io/ivpm-build

License

Apache 2.0 — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ivpm_build-0.2.0.27908268978.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ivpm_build-0.2.0.27908268978-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file ivpm_build-0.2.0.27908268978.tar.gz.

File metadata

  • Download URL: ivpm_build-0.2.0.27908268978.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ivpm_build-0.2.0.27908268978.tar.gz
Algorithm Hash digest
SHA256 3cd7f640875e36cc677393999debd90cfa6698b3f5ead12d1b86730d5c597ea5
MD5 3ebda9e5a9fb285eb2f994f0766dadd0
BLAKE2b-256 6fa86b711ec5d7740254d7a94d90dbbbbe691164f94583c643fc5092ad91f417

See more details on using hashes here.

File details

Details for the file ivpm_build-0.2.0.27908268978-py3-none-any.whl.

File metadata

File hashes

Hashes for ivpm_build-0.2.0.27908268978-py3-none-any.whl
Algorithm Hash digest
SHA256 208edc10d9dfda8ae216959ad436744d23cee3a46ca592b3871fa23cb165c56e
MD5 bf07ff185837e86030d9ca0b48a25b7c
BLAKE2b-256 cf42742857d2d06939c50995eda0d20fea68077a731e93fd858093501a187ed3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page