nice-florist-55958
07/13/2022, 1:50 PMbitter-ability-32190
07/13/2022, 1:53 PMpex
to convert the lockfile to a requirements.txt
file.
I forget the exact command, so you'll wanna poke around `pex`'s CLI.
I also have a separate Pants resolve for my tools, and then declare a pex_binary
for each tool, so I can run them in Pants. So for me the command would look like ./pants run 3rdparty/python/tools:pex -- <pex_args>
. Would recommendenough-analyst-54434
07/13/2022, 2:27 PM... it would be easier to ...@nice-florist-55958 is the difficulty slowness of the export afresh?
pex3 lock export --python path/to/venvs/python my.lock
. Unfortunately, Pants sticks invalid json on the top of the Pex lock file (comments); so you need to script in removal of those comments 1st before passing the lock file to Pex../pants export
an initial time, then, in the exported venv pip install pex
2. When updating the venv, from within the venv (which has pex3 installed) pex3 lock export my.lock
- the right interpreter will be used automatically../pants export --lockfiles
where it can export lockfiles with the headers it adds having been stripped so that you can then use the unadulterated lockfiles as you please without having to worry about Pantisms.nice-florist-55958
07/13/2022, 2:38 PMenough-analyst-54434
07/13/2022, 2:39 PMpolite-garden-50641
07/13/2022, 3:28 PMbitter-ability-32190
07/13/2022, 3:30 PMpolite-garden-50641
07/13/2022, 3:31 PMbitter-ability-32190
07/13/2022, 3:33 PMpolite-garden-50641
07/13/2022, 3:34 PMnice-florist-55958
07/14/2022, 12:25 PMpex_binary
target be exported (for metadata compliance purposes)
3. Can the list of requirements for a python_distribution
target be exported (same reason)? This list should include first-party distributions (that are now third party from the package user's perspective) and third-party distributions, but not transitive (see this https://pantsbuild.slack.com/archives/C046T6T9U/p1651234825508789 for some discussion). (As an aside, I'll point out something I learned from testing: Pants will not complain about incompatible resolves if a python_distribution
has dependencies w/ different resolves, so you can easily end up with a setup.py that has incompatible requirements -- understandably Pants does not attempt to build a lock for a python_distribution
as that would probably be overkill, but it might want to check that targets all have a compatible resolve, or provide options for all behaviors?)