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() - local-recipes — pybind11, C++ dep with no ConanCenter recipe, built from a recipe in the project
- cibw-example — pybind11 + cibuildwheel
License
MIT — see LICENSE.
Metadata
Release files for conan-py-build 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| conan_py_build-0.7.0.tar.gz | 28.0 kB | With provenance | Details for conan_py_build-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| conan_py_build-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for conan_py_build-0.7.0-py3-none-any.whl |
Total release size: 44.5 kB
Release files / conan_py_build-0.7.0.tar.gz
| Download URL | conan_py_build-0.7.0.tar.gz |
|---|---|
| Size | 28.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cabf8dfdd910df1d463952cfc4372d7376177906f3333c3f03a1cf81bee5edbc
|
|
BLAKE2b-256 checksum How to use checksums |
bff88ec867dcf3f45185511cb4febc2614529e8acc7b9d654692471e0d61d57b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / conan_py_build-0.7.0-py3-none-any.whl
| Download URL | conan_py_build-0.7.0-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10229556838a8f09070149618d0f4bd50295d76b3b88786dde03c61f899f2247
|
|
BLAKE2b-256 checksum How to use checksums |
6088f6a80b45e54d5e71bf8df27a808a3dbac3a767ebe96cc699c0b1d39a5e3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logSecurity for conan-py-build 0.7.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for conan_py_build-0.7.0.tar.gz
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 Nov 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.