high-yak-85899
02/04/2024, 1:15 AMpip freeze from a target like a pex_binary? I know how I could do it using adhoc_tool, but I'm curious if there's a more natively supported way that does it behind the scenes for me.curved-manchester-66006
02/05/2024, 3:29 PMadhoc_tool, but I'm not ware of something that gives you that exact format "for free".high-yak-85899
02/05/2024, 11:23 PMadhoc_tool. The script looks roughly like
subprocess.check_call(['python', <pex>, 'venv', '--scope=deps', '--pip', '--collisions-ok', '--compile', <dest>])
with open(<file>, 'w+') as f:
subprocess.check_call(['pip', 'freeze'], stdout=f)
I used a python script instead of a shell script so I could easily include the hermetic python included by pants.