Is it possible to generate a requirements.txt-styl...
# general
c
Is it possible to generate a requirements.txt-style file listing the exact packages that are used in a given pex?
e
There are 18 ways. Here's one with an example:
Copy code
$ pex fabric -o fabric.pex                        $ unzip -qc fabric.pex PEX-INFO | jq -r '.distributions | keys[]'
Deprecated-1.2.14-py2.py3-none-any.whl
PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
bcrypt-4.0.1-cp36-abi3-manylinux_2_28_x86_64.whl
cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
cryptography-41.0.3-cp37-abi3-manylinux_2_28_x86_64.whl
decorator-5.1.1-py3-none-any.whl
fabric-3.2.2-py3-none-any.whl
invoke-2.2.0-py3-none-any.whl
paramiko-3.3.1-py3-none-any.whl
pycparser-2.21-py2.py3-none-any.whl
wrapt-1.15.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Now, that's not requirements.txt style, but it's all the info you need. If you just wanted the input requirements and not the actual projects used, that's:
Copy code
$ unzip -qc fabric.pex PEX-INFO | jq -r '.requirements[]'
fabric
Informally, even just
zipinfo fabric.pex
tells you all you probably need to know.