proud-dentist-22844
06/15/2022, 5:42 PMpex_binary
target in a BUILD file (a utility script used to maintain an in-repo file). I want a @rule
to run that target. What's the best way to get that pex? Surely there's a way to request a pex from a given target, right?
The only slightly related thing I found in the docs was https://www.pantsbuild.org/docs/rules-api-installing-tools#pex-install-binaries-through-pip
But this is not an external / installed tool. It's entirely in-repo.bitter-ability-32190
06/15/2022, 5:56 PMawait
the BuiltPackage
to get the built thing.
Or if you just wanna run it you could request a RunRequest
and run it yourself (similar to how the run
goal worksbitter-ability-32190
06/15/2022, 5:57 PMproud-dentist-22844
06/15/2022, 6:14 PMpex_binary
target will make ./pants package ::
build it?bitter-ability-32190
06/15/2022, 6:14 PMproud-dentist-22844
06/15/2022, 6:14 PMbitter-ability-32190
06/15/2022, 6:15 PMpex_binary
was the only way to run "scripts". But once thats in that will change (after a deprecation cycle)proud-dentist-22844
06/15/2022, 6:16 PMproud-dentist-22844
06/15/2022, 6:17 PMpex_binary
in BUILD? If so, got any hints for building a pex from local files + deps?bitter-ability-32190
06/15/2022, 6:21 PM./pants run path/to/file.py
and if there's a pex_binary
with the entry_point
set to the file, you're golden
⢠If you want to run this in a plugin, then the world is your oyster, but you have to do the groundworkproud-dentist-22844
06/15/2022, 6:22 PMrun
goal doesn't help me here.proud-dentist-22844
06/15/2022, 6:22 PMbitter-ability-32190
06/15/2022, 6:22 PMpex_binary
targetproud-dentist-22844
06/15/2022, 6:23 PMbitter-ability-32190
06/15/2022, 6:23 PMbitter-ability-32190
06/15/2022, 6:24 PMPexFromTargetsRequest
and turning it into a PEXproud-dentist-22844
06/15/2022, 6:25 PMPexFromTargetsRequest
which I haven't seen before. Thank you for the tip!bitter-ability-32190
06/15/2022, 6:25 PMVenvPex
-> VenvPexProcess
-> Process
-> ProcessResult
bitter-ability-32190
06/15/2022, 6:28 PMproud-dentist-22844
06/15/2022, 6:33 PM