Is it possible to generate the output of `pip free...
# general
h
Is it possible to generate the output of
pip 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.
c
There are probably several ways you could stitch this together with PEX_TOOLsor
adhoc_tool
, but I'm not ware of something that gives you that exact format "for free".
h
Thanks, I ended up making a python script and backing it with
adhoc_tool
. The script looks roughly like
Copy code
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.