Is there a way to run a python program from a pant...
# general
g
Is there a way to run a python program from a pants lockfile via
adhoc_tool
? i.e. sphinx-build
In your pex you can reference your sphinx dependency like
3rdparty/python:reqs#sphinx
if you follow that convention rather than adding an extra requirement
g
sexyyy. thanks
Any reason I couldn't do this with system_binary as well?
b
You should be able to use a pex_binary as the
runnable
to
adhoc_tool
too (even a requirement directly “works” but I wouldn’t recommend: it led to much confusion for us due to https://github.com/pantsbuild/pants/issues/20108 )
1
g
I got it working! Thanks
If I had a command that can be pulled via curl (e.g. a go binary) -- what would be the best way to pull that in for consumption by adhoc_tool?
b
I’ve gotta go, but some bread crumbs: download via
file
and
source=http_source(…)
, and then maybe have to use
shell_command
with it as an execution dependency that first marks it as executable and adds it to PATH or similar before running the runnable dependencies. With a FIXME for https://github.com/pantsbuild/pants/issues/20491
👀 1