Skip to main content

conan-py-build

A PEP 517 build backend that uses Conan to build Python C/C++ extensions.

Documentation · PyPI · Examples

Install

pip install conan-py-build

Quick start

[!NOTE] The steps below use CMake, but the backend is build-system agnostic — it works with anything Conan can drive. For a Meson version, see basic-meson-pybind11.

  1. Set conan-py-build as your build backend:
[build-system]
requires = ["conan-py-build"]
build-backend = "conan_py_build.build"

[project]
name = "mypackage"
version = "0.1.0"
  1. Add a conanfile.py with your C++ dependencies:
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout

class MyPackageConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeToolchain", "CMakeDeps"

    def layout(self):
        cmake_layout(self)

    def requirements(self):
        self.requires("fmt/12.1.0")

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()

    def package(self):
        cmake = CMake(self)
        cmake.install()
  1. Your CMakeLists.txt must install the extension into the package directory so it ends up in the wheel:
install(TARGETS _core DESTINATION mypackage)
  1. Build:
pip wheel . -w dist/ -vvv

See the documentation for the full getting started guide, configuration, profiles, dynamic versioning, and more.

Examples

See the examples/ directory:

License

MIT — see LICENSE.

Metadata

Release files for conan-py-build 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for conan-py-build 0.6.3
File Size Uploaded
conan_py_build-0.6.3.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for conan-py-build 0.6.3
File Interpreter ABI Platform
conan_py_build-0.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / conan_py_build-0.6.3.tar.gz

Download URL conan_py_build-0.6.3.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ef28f0de99848e81d39c430016b43fcd783c58c704a036b19d978103ac6a77bb
BLAKE2b-256 checksum
How to use checksums
51d1bf9acd7cbf00138d9d2629d976a1ddbb11605822b583ebfbf9ecff56e2f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / conan_py_build-0.6.3-py3-none-any.whl

Download URL conan_py_build-0.6.3-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc086dd481c0034136bfcc0724cc8a0fe33a9ef99c9f5c74461afcc87b53adcd
BLAKE2b-256 checksum
How to use checksums
aa681080ff2b41b2ba235ff780462374c076d8fac40cf71509c650558347a45d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.4

2 release files

This release

0.6.3 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page