https://pantsbuild.org/ logo
#general
Title
# general
h

high-yak-85899

02/18/2023, 12:03 AM
Have there been any examples of writing a python source that gets a binding from a C++ implementation? I know bazel supports this, but I'm guessing Pants would be difficult without dedicated C++ support.
b

bitter-ability-32190

02/18/2023, 12:53 AM
We build wheels from C++ source in our repo 🤷‍♂️
h

high-yak-85899

02/18/2023, 1:28 AM
Any more details to share? Tips or tricks on where to start would be great if you had any them.
b

bitter-ability-32190

02/18/2023, 1:31 AM
It's not a very complicated thing because all the relevant code is self-contained. Other than that we use
setup.py
and let the normal "compile this native code into a wheel" stuff take over.
h

happy-kitchen-89482

02/18/2023, 5:00 AM
Pants can build wheels that embed native code by delegating that to setuptools or whatever your pep-517 build backend is. This works great for relatively small, simple native sources where it's OK to rebuild them all naively if any of them change. And assumes that the test of the native code are written in Python. If there were large-scale native projects with tests, codegen etc. then we'd need "proper" C++ support