nice-florist-5595807/13/2022, 1:50 PM
bitter-ability-3219007/13/2022, 1:53 PM
to convert the lockfile to a
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
for each tool, so I can run them in Pants. So for me the command would look like
. Would recommend
./pants run 3rdparty/python/tools:pex -- <pex_args>
enough-analyst-5443407/13/2022, 2:27 PM
... it would be easier to ...@nice-florist-55958 is the difficulty slowness of the export afresh?
. 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.
pex3 lock export --python path/to/venvs/python my.lock
an initial time, then, in the exported venv
2. When updating the venv, from within the venv (which has pex3 installed)
pip install pex
- the right interpreter will be used automatically.
pex3 lock export my.lock
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.
./pants export --lockfiles
nice-florist-5595807/13/2022, 2:38 PM
enough-analyst-5443407/13/2022, 2:39 PM
polite-garden-5064107/13/2022, 3:28 PM
bitter-ability-3219007/13/2022, 3:30 PM
polite-garden-5064107/13/2022, 3:31 PM
bitter-ability-3219007/13/2022, 3:33 PM
polite-garden-5064107/13/2022, 3:34 PM
nice-florist-5595807/14/2022, 12:25 PM
target be exported (for metadata compliance purposes) 3. Can the list of requirements for a
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
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
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?)