Skip to content

Replace setuptools/bundled-capnproto build with conan-py-build + CMake [looking for feedback]#404

Draft
czoido wants to merge 31 commits into
capnproto:masterfrom
czoido:conan-py-build
Draft

Replace setuptools/bundled-capnproto build with conan-py-build + CMake [looking for feedback]#404
czoido wants to merge 31 commits into
capnproto:masterfrom
czoido:conan-py-build

Conversation

@czoido

@czoido czoido commented Jun 15, 2026

Copy link
Copy Markdown

Hi from the Conan team!

We recently released conan-py-build, a PEP 517 build backend that uses Conan to manage C/C++ dependencies, and we're testing it on several popular Python extensions that we think could benefit from it.

Here's the launch blog post: https://blog.conan.io/cpp/conan/python/2026/05/05/Introducing-conan-py-build.html
And the repo and docs: https://github.com/conan-io/conan-py-build · https://conan-py-build.conan.io/

We wanted to share this port of pycapnp to conan-py-build to get some comments and feedback from the project. The capnproto C++ library is fetched from Conan Center Index instead of being downloaded as a tarball from capnproto.org at build time.

This is a draft PR for sharing the work to get your thoughts on whether this direction is interesting to the project.

Some notes about the migration:

  • No bundled tarball. setup.py previously downloaded capnproto-c++-1.0.1.tar.gz from capnproto.org at build time. Conan now fetches and builds capnproto/1.0.1 from Conan Center Index.
  • Build tools managed by Conan. Building capnproto requires autotools (m4, etc.) to be present on the system. Conan manages these build tools as well.
  • Explicit, versioned C++ dependency. Bumping the C++ library is a one-line change in conanfile.py.
  • setup.py + buildutils/ removed. ~350 lines of build machinery replaced by a minimal conanfile.py and a standard CMakeLists.txt.
  • capnp/version.py simplified. Previously generated dynamically by setup.py; now it's a static file using importlib.metadata.
  • Same CI workflow. cibuildwheel keeps driving multi-platform builds with minimal changes.
  • Equivalent wheels. We compared the output against the 2.2.3 PyPI release file-by-file across all platforms. The only differences are cosmetic metadata.

CI results: https://github.com/czoido/pycapnp/actions/runs/27526912439

Any feedback is very welcome!

Thanks a lot 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant