bored-energy-25252
11/23/2022, 9:19 AM./pants export ::
only supports exporting all resolves, I suggest that ./pants freeze --resolve=xyz
should be supported.
As a alternative, we can implement freeze
in the following way:
https://github.com/da-tubi/pants-minimal-freezerhythmic-morning-87313
11/23/2022, 9:28 AMbored-energy-25252
11/23/2022, 9:38 AMbored-energy-25252
11/23/2022, 9:39 AMrhythmic-morning-87313
11/23/2022, 9:39 AM./pants export
generate virtualenvs that can be used in VSCode?rhythmic-morning-87313
11/23/2022, 9:40 AMbored-energy-25252
11/23/2022, 9:40 AMbored-energy-25252
11/23/2022, 9:41 AMbored-energy-25252
11/23/2022, 9:41 AMbored-energy-25252
11/23/2022, 9:42 AMFor VSCode, there a setting: https://github.com/da-tubi/pants-minimal-freeze/blob/main/.vscode/settings.jsonWith the setting, I do not need to select the python interpreter manually.
rhythmic-morning-87313
11/23/2022, 9:48 AMrhythmic-morning-87313
11/23/2022, 9:48 AMrhythmic-morning-87313
11/23/2022, 9:49 AMrhythmic-morning-87313
11/23/2022, 9:49 AMhappy-kitchen-89482
11/23/2022, 4:10 PM--resolve
flag on export
, exactly as you suggestedbored-energy-25252
11/24/2022, 6:37 AMby “exporting to a specific virtual environment”It means, exporting to a virtual environment managed by pyenv or conda.
export
can only export to a fixed path virtualenv.happy-kitchen-89482
11/25/2022, 1:43 PMhappy-kitchen-89482
11/25/2022, 1:43 PMbored-energy-25252
11/28/2022, 3:54 PMSo “export” to an already existing virtualenv?Yes
happy-kitchen-89482
11/28/2022, 4:33 PMbored-energy-25252
11/29/2022, 1:36 AMpip freeze
equiv in pants.happy-kitchen-89482
11/29/2022, 1:43 AMhappy-kitchen-89482
11/29/2022, 1:43 AMbored-energy-25252
11/29/2022, 1:53 AMWe already have the lockfile, so we could convert that to something pip can ingestA good idea!
bored-energy-25252
11/29/2022, 1:54 AMlock
. And one could use lock install xxx.lock
to install the dependencies in the lockfile.bored-energy-25252
11/29/2022, 1:55 AMhappy-kitchen-89482
11/29/2022, 4:06 AMbored-energy-25252
11/29/2022, 5:54 AMpex --lock 3rdparty/python/default.lock
, it does not work well with the pants-generated lockfile.
pex.resolve.lockfile.json_codec.ParseError: The lock file at 3rdparty/python/default.lock does not contain valid JSON: Expecting value: line 1 column 1 (char 0)
bored-energy-25252
11/29/2022, 5:55 AMpex --freeze 3rdparty/python/default.lock
, pex --freeze xyz.pex
is a good idea?bored-energy-25252
11/29/2022, 5:57 AMpex --freeze
available, we can
pip install `pex --freeze xyz.lock`
to install the necessary dependencies in a created virtualenv.
Further more, pex --export xyz.lock
should be a better command to replace `pip install `pex --freeze xyz.lock``bored-energy-25252
11/29/2022, 4:55 PMpex3 lock export 3rdparty/bark.lock
Thanks! It is in PEX3. Now I just need some commandlinefu to strip the leading part of the lockfile generated by pants!happy-kitchen-89482
12/06/2022, 3:41 AMbored-energy-25252
12/06/2022, 3:55 AMbored-energy-25252
12/06/2022, 3:58 AM