plain-author-67175
12/02/2024, 8:24 PMexecution_mode="venv"
and venv_site_packages_copies=True
with pants run path/to/some/file.py
? I have some source file that depends on torch
and it looks like the 3rd-party libraries are explicitly looking for files in the virtual environment.plain-author-67175
12/02/2024, 8:25 PMpath/to/some/file.py
is available as a python_source
.broad-processor-92400
12/04/2024, 10:05 PMplain-author-67175
12/05/2024, 2:00 AMplain-author-67175
12/05/2024, 2:27 AMrun
goal. We have a bunch of ad-hoc / utility scripts that people run locally for various experiments and updating the BUILD file every time is a tad inconvenient for the end-users who aren’t software developers, just ML folks.plain-author-67175
12/05/2024, 2:28 AMrun-local
CLI alias with some global pex settings predefined.broad-processor-92400
12/05/2024, 2:47 AMplain-author-67175
12/05/2024, 3:09 AMrun
too? The doc doesn’t state that explicitly.broad-processor-92400
12/05/2024, 3:15 AMrun
... but you'll be poking at implementation details here, where the exact commands and invocations may change from version to version (of pants)plain-author-67175
12/05/2024, 3:15 AMplain-author-67175
12/06/2024, 2:11 AMpants --keep-sandboxes=on_failure --pex-cli-global-args="--venv --venv-copies" run //path/to/script.py
and
pants --keep-sandboxes=on_failure --pex-cli-global-args="--layout=packed --pre-install-wheels --venv --venv-copies" run //path/to/script.py
no luck. The sandbox has the following entries (changed the particular names to <name>)
.python-build-standalone -> /home/<user>/.cache/pants/named_caches/python_build_standalone/
<package>.pex_pex_shim.sh*
<package>.pex_bin_python_shim.sh*
src/
.cache/
<package>.pex/
../
__run.sh*
./
pants
or pex
didn't fail, but my script failed as before.