Hi everyone, can someone point me in the right dir...
# general
k
Hi everyone, can someone point me in the right direction to figure out the following problem? I have a monorepo, and I'm using pants to create python distributions. Everything works great. But now I want a particular distribution to build a native extension. FWIU, I would need to create a custom setup.py script, but if I do that, I lose the ability for pants to automatically determine which files to include. I'm also not sure how to specify a specific setup.py script (what if I have two setup.py scripts, how does pants choose which one to include?). Ideally, there would be a way to customize the setup.py generation to include custom code for building the extension. Any ideas?
h
Yeah, the relevant docs are here, but you’re correct that you must write your own setup.py or equivalent if you have native extensions. Currently the generated setup.py is an all-or-nothing proposition, there is no way to merge some generated data in with some handwritten data.
But there should be! I did look at this briefly about 3 years ago, but it didn’t end up happening.
The specific setup.py chosen is the one the
python_distribution
depends on
you can have many in your repo, pants picks the one in the transitive deps of the
python_distribution
target, at the root package. There cannot be multiple of those: one will “win” when the sandbox is assembled.
k
I see, thanks!
h
But this is one more use case to justify an overhaul of the setup.py generator