hey there! I started testing pants 2.0.0a1 and I n...
# general
w
hey there! I started testing pants 2.0.0a1 and I noticed that
python_app
is causing chaos and there isnt
bundle
as a goal anymore. šŸ˜ž Did it become something else or we wonā€™t have support for that on v2.0?
h
Hey Thales. Yeah, for now
python_app
isnā€™t supported because we plan to redesign it in a better way. https://www.pantsbuild.org/v2.0/docs/how-to-upgrade-pants-2-0#python_app-and-the-bundle-goal-are-removed-130-vs-20 For now, the closest alternative would be running
binary
. Is this a blocker for you?
h
The distinction between
python_app
and
python_binary
, and between the
bundle
and
binary
goals, was unclear, and possibly unnecessary. You can now embed arbitrary files directly in the
.pex
file, using a
files()
target.
Do you need
python_app
and
bundle
? Or were you using it because it was idiomatic in v1?
h
You can now embed arbitrary files directly in theĀ .pexĀ file, using aĀ files()Ā target.
That would be the main difference. If the files are bundled directly in the
.pex
, vs. kept ā€œlooseā€ outside of the
.pex
w
I do need
python_app
and
bundle
. Iā€™m putting my code inside the .pex file but the ML models are kept ā€œlooseā€ as Eric, mentioned. So when I run it I normally use flags to point to those ā€œlooseā€ folders/files.
I tried embedding it inside the
.pex
file but my
entrypoint
for the
.pex
is a ML
cli
tool that canā€™t really find the config files and models if itā€™s inside the
.pex
. It tries to find it where youā€™re running it from. Thatā€™s basically the main reason why we choose
pants
. The
python_app
and
bundle
were super straightforward for our use case.
I guess all Iā€™d have to do is change my CI get the binary
.pex
and then all those ā€œlooseā€ files and put them together instead of that single
.tar.gz
for my Dockerfile.
h
Got it. Yeah, I agree weā€™ll want it back. The only reason we removed it was that the old mechanism was pretty complex, and hard to port from the v1 engine to the v2 engine. If we could redo it from the ground up, we would do it differently. We simply havenā€™t prioritized adding it back yet.
I guess all Iā€™d have to do is change my CI get the binaryĀ .pexĀ and then all those ā€œlooseā€ files and put them together instead of that singleĀ .tar.gzĀ for my Dockerfile.
Okay. Does this work okay? If not, we can re-prioritize adding back
python_app
given the importance of it to your use case.
w
Well, if I can annoy you guys with prioritizing things Iā€™d say go for the CA Cert thing not working on v2 lol. That one I have no way around it.
šŸ‘ 1
h
Opened https://github.com/pantsbuild/pants/issues/10733 to track this. If you have any thoughts on what functionality youā€™d like, itā€™d be quite helpful to comment. For example, did you use any of the
rel_mapper
stuff?