We have a python monorepo using pants and have som...
# general
c
We have a python monorepo using pants and have some new tools built in rust for applications where performance is an issue. Currently these tools are standalone executables however I'd also expect them to also be exposed as python libraries. What's the best way to integrate the rust code with pants? Our rust code is likely to be fairly simple for now and I'd like to keep as close to the standard cargo ecosystem as possible. Thanks!
1
h
When Pants builds a wheel it can run arbitrary setup.py code, so if that code happens to invoke cargo, produce an .so file and embed it in the python library, it should work. Of course this assumes you have cargo installed etc. Pants wouldn’t know anything about that underlying system.
Alternatively, perhaps an adhoc_tool? @fast-nail-55400 would know more about that
f
adhoc_tool
&
experimental_workspace_environment
might work well
c
Thanks I'll explore both options