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
- Set
conan-py-buildas your build backend:
[build-system]
requires = ["conan-py-build"]
build-backend = "conan_py_build.build"
[project]
name = "mypackage"
version = "0.1.0"
- Add a
conanfile.pywith your C++ dependencies:
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
class MyPackageConan(ConanFile):
name = "mypackage"
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()
- Your
CMakeLists.txtmust install the extension into the package directory so it ends up in the wheel:
install(TARGETS _core DESTINATION mypackage)
- 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:
- basic —
fmtextension, recipe viaconanfile-path - basic-pybind11 — pybind11 +
fmt, dynamic version, PEP 639 - basic-meson-pybind11 — pybind11 +
fmtbuilt with Meson instead of CMake - basic-nanobind — nanobind +
fmt,extra-profilefor C++17 - external-sources — pybind11, C++ dep fetched in
source() - cibw-example — pybind11 + cibuildwheel
License
MIT — see LICENSE.
Metadata
Release files for conan-py-build 0.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| conan_py_build-0.6.4.tar.gz | 24.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| conan_py_build-0.6.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.5 kB
Release files / conan_py_build-0.6.4.tar.gz
| Download URL | conan_py_build-0.6.4.tar.gz |
|---|---|
| Size | 24.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42db12f4c12f518eea809ce7788628e3000520ea8cd69d327ebf91561b4712cd
|
|
BLAKE2b-256 checksum How to use checksums |
a70800c64182d528442ad48c8d564db27ae779fa74df5f39bb2bc4b65d7bc11e
|
| 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 4, 2026.
Transparency logRelease files / conan_py_build-0.6.4-py3-none-any.whl
| Download URL | conan_py_build-0.6.4-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58d9924eccf23a72c6a3aaad6b2afaeb5af17f9e0ee9ab1234625656f6e77ffd
|
|
BLAKE2b-256 checksum How to use checksums |
59c8db75cbcf15732e948de26dd407b8d560e412189d1c25fdd45d2f14fb2cc8
|
| 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 4, 2026.
Transparency log