high-yak-85899
05/24/2022, 11:41 PMpip install ansible, I get a binary in my venv like venv/bin/ansible. When I package ansible into a pex_binary, is there a place I could still access that binary?high-yak-85899
05/24/2022, 11:43 PMansible_runner and it has to find the executable on the system so I need to point PATH where that binary livesfast-nail-55400
05/24/2022, 11:44 PMfast-nail-55400
05/24/2022, 11:45 PMhigh-yak-85899
05/24/2022, 11:45 PMhigh-yak-85899
05/24/2022, 11:45 PMfast-nail-55400
05/24/2022, 11:46 PMpex expands your pex onto disk in its cache.fast-nail-55400
05/24/2022, 11:46 PMfast-nail-55400
05/24/2022, 11:47 PMPEX_ROOT (~/.pex)fast-nail-55400
05/24/2022, 11:48 PMPEX_VENV_BIN_PATHfast-nail-55400
05/24/2022, 11:48 PMPEX_VENV_BIN_PATH
String (false|prepend|append).
When running in PEX_VENV mode, optionally add the scripts and console scripts of
distributions in the PEX file to the $PATH.
fast-nail-55400
05/24/2022, 11:48 PMhigh-yak-85899
05/24/2022, 11:49 PMhigh-yak-85899
05/24/2022, 11:50 PMexecution_mode has to be set to venv when packaging ithigh-yak-85899
05/24/2022, 11:50 PMPEX_VENV_BIN_PATH=prepend when running the apphigh-yak-85899
05/24/2022, 11:58 PMvenv is enough to get what I needhigh-yak-85899
05/24/2022, 11:58 PMsubprocess.run(['which', 'ansible']) in that modehigh-yak-85899
05/24/2022, 11:58 PMwide-midnight-78598
05/25/2022, 12:02 AMhigh-yak-85899
05/25/2022, 12:02 AMhigh-yak-85899
05/25/2022, 12:02 AMansible. So if it doesn't have an executable in PATH, things complain.wide-midnight-78598
05/25/2022, 12:05 AMenough-analyst-54434
05/25/2022, 12:12 AMexecution_mode="venv" https://www.pantsbuild.org/docs/reference-pex_binary#codeexecution_modecode. For a long time now that also sets the same env var - but baked into the PEX metadata: https://github.com/pantsbuild/pants/pull/12664/fileshigh-yak-85899
05/25/2022, 12:13 AMenough-analyst-54434
05/25/2022, 12:13 AMenough-analyst-54434
05/25/2022, 12:14 AMfast-nail-55400
05/25/2022, 12:16 AMfwiw zip_safe is long dead,The thought it was still relevant is just my bit-rotting hazy recollection
fast-nail-55400
05/25/2022, 12:17 AMenough-analyst-54434
05/25/2022, 12:19 AM