<#21876 Option to run a `run_shell_command` target...
# github-notifications
c
#21876 Option to run a `run_shell_command` target inside the sandbox Issue created by jsimonrichard Is your feature request related to a problem? Please describe. I need a way to run multiple python dev servers at the same time (+ a reverse proxy to route requests to one or the other). My multiplexer of choice is `mprocs`. There's currently no way to achieve this with pants, as far as I can tell (see the alternatives below). Describe the solution you'd like I think the most straightforward solution would be to add some kind of
run_in_sandbox
option to
run_shell_command
. Describe alternatives you've considered • Use
run_shell_command
. This doesn't work because it runs the command outside of the sandbox, and my python dev servers depend on pants-managed pip packages. • Use
run_shell_command
after activating an exported python venv. This doesn't work because one of my python servers depends on a first-party library, and that library isn't included in the venv. • Use
shell_command
. This target type is intended for build-step tasks like codegen, and expects things like output files (which my dev servers don't produce). • Use
pants run ./dev-server-1.py
and
pants run ./dev-server-2.py
inside the mprocs config, and then run mprocs directly. This doesn't work because pants only allows one instance to run at a time. • Compile to a PEX binary, then run directly. This doesn't allow hot-reloading. • Use a separate dependency manager like
uv
. This is not ideal because it forces the use of a requirements.txt (to avoid code duplication). It also requires a manual install of first-party dependencies. • Docker orchestration. This could potentially work, but it forgoes the use of mprocs (which is really nice). It also would require the maintenance of a separate dev image to enable hot-reloading (not sure this would even work). pantsbuild/pants