boundless-monitor-67068
12/11/2024, 11:19 AMrun_shell_command
target, however the tool must be already available in my path (e.g., using an exported venv ) for this to work. That beats the purpose IMO as I can interact with the tool directly in that case. Any suggestions on how to do this? Thanks in advance!dazzling-pizza-75442
12/11/2024, 3:41 PMpex_binary
targets in a tools/BUILD
file. Then we can do pants run tools:$tool_name
. e.g. something like:
pex_binary(
name="http",
entry_point="httpie.__main__:main",
dependencies=[
"3rdparty/python#httpie",
]
)
and then pants run tools:http
. Theoretically, you could also invoke it directly with pants run "3rdparty/python#httpie"
but that doesn't always work if pex doesn't know the right entrypoint. It's also useful to have the ability to specify multiple dependencies/plugins.
An annoyance is that you have to put all the args after --
e.g.:
pants run tools:http -- PUT <http://httpbin.org/put|httpbin.org/put> hello=world
boundless-monitor-67068
12/12/2024, 8:40 AMImportError: No module named feast.__main__; 'feast' is a package and cannot be directly executed
my current (dirty) workaround is a python script invoking the cli with subprocess.run
dazzling-pizza-75442
12/12/2024, 11:50 AMboundless-monitor-67068
12/12/2024, 3:35 PMpex_binary(
name="feast",
entry_point="feast.cli",
execution_mode="venv",
dependencies=["python/feast:reqs"],
)
Awesome, thanks for the help @dazzling-pizza-75442 ๐