proud-dentist-22844
03/25/2023, 9:27 PMexport
goal, if I want to create a virtualenv with wheels built by pants, but use the versions locked in the pex lockfile, how might I do that?
I assume there's something in PEX to do that? I couldn't find anything about lockfiles in the pex docs.happy-kitchen-89482
03/25/2023, 10:32 PMenough-analyst-54434
03/26/2023, 12:55 AMPEX_TOOLS=1 pex --python /use/exactly/this/python --lock the.lock [optional requirements strings to subset the lock; otherwise you get everything] --include-tools -- venv create/it/right/here
enough-analyst-54434
03/26/2023, 12:56 AMproud-dentist-22844
03/26/2023, 1:50 AMIs this for use in a plugin?
Not necessarily. I'm thinking of a couple of different things. • When using the wheels as library (a key thing I want to allow by publishing to pypi), I want the requirements to be very broad. • When installing the wheels together as an application, I want all the requirements to be installed using the precise versions listed in the lockfile. When installing the application in a virtualenv, I can't use: • Export: because I can't specify a path in /opt, it has to be under the workspace directory. • Just install the wheels with pip, because then pip won't use the already locked deps.
enough-analyst-54434
03/26/2023, 1:52 AMpex_binary(... include_tools=True)
target and pants package
that.proud-dentist-22844
03/26/2023, 1:52 AMenough-analyst-54434
03/26/2023, 1:52 AMPEX_TOOLS=1 my.pex venv right/here
enough-analyst-54434
03/26/2023, 1:53 AMproud-dentist-22844
03/26/2023, 1:54 AMenough-analyst-54434
03/26/2023, 1:54 AMenough-analyst-54434
03/26/2023, 1:55 AMinclude_tools=True
use execution_mode="venv"
and then you can just run the PEX binary directly.proud-dentist-22844
03/26/2023, 1:55 AMenough-analyst-54434
03/26/2023, 1:56 AMenough-analyst-54434
03/26/2023, 1:56 AMproud-dentist-22844
03/26/2023, 1:56 AMenough-analyst-54434
03/26/2023, 1:57 AM--help
after the venv
tool subcommand to learn the options.proud-dentist-22844
03/26/2023, 1:59 AM