fast-xylophone-56613
04/16/2025, 9:05 AMpants export? I have several console scripts that I'd like to make easily accessible for development. I saw in the docs you can declare console scripts via python_distribution, but this doesn't seem to have any effect on pants export
If necessary I suppose I can manually hack in the stuff I need but it would be useful to have this properly automatedelegant-florist-94385
04/16/2025, 10:50 AMpython_sources you can run them with pants run /path/to/file
or as pants run --args="all args going to the script" /path/to/file
and they will follow the standard dependency inference and sandboxing behavior.
(You can also use shell_source if you want sh/bash scripts instead, but you'll have to manually specify dependencies on whatever python files it needs to call, so they end up in the sandbox)elegant-florist-94385
04/16/2025, 11:11 AMfast-xylophone-56613
04/16/2025, 11:52 AM. activate already adds that directory to the PATH. But if that's not possible I can look at other workaroundselegant-florist-94385
04/16/2025, 12:06 PMexport_venv.sh script that looks something like:
pants export --whatever
# make symlinks of scripts to venv/binelegant-florist-94385
04/16/2025, 12:07 PMelegant-florist-94385
04/16/2025, 12:08 PMsrc/tools/scripts location, you could have your export_venv.sh script update the exported activate script to also add this directory to the PATHacceptable-balloon-2043
04/16/2025, 2:50 PMpants run path/to/file --args is shorthanded as pants cool_script