quaint-telephone-89068
12/06/2022, 8:03 AM./pants freeze --resolve=xyz. # like pip freeze
./pants freeze --resolve=xyz --secured # like pex3 lock export
or
./pants import --resolve=xyz # in that way, we do not need to pip install
Describe alternatives you've considered
Workaround 1
https://github.com/da-tubi/pants-minimal-freeze
Workaround 2
The following command line is similar to pip freeze
pex3 lock export 3rdparty/python/xxx.lock
Then we can use the exported requirements.txt in the specific virtual env:
pex3 lock export 3rdparty/python/xxx.lock > /tmp/requirements.txt
# pyenv activate xxx or conda activate xxx
pip install -r /tmp/requirements.txt
And pex3 lock export does not work for pants' lockfile, because there are // leading parts. For now, we can use command line to strip the leading //.
Additional context
None
pantsbuild/pants