Is it possible to use internal `pex` tool somehow ...
# general
b
Is it possible to use internal
pex
tool somehow via
pants
? I’ve tried
pants pex-cli -- blah blah blah
, but it doesn’t seems to work.
c
I think the best way is to do precisely what was described in the previous thread, that is have
pex
as a requirement, then a
pex_binary
to run it.. https://pantsbuild.slack.com/archives/C046T6T9U/p1694789865580759
hmm… maybe there’s a tool resolve you could tap into, so you could skip the requirement part.. 🤔
e
@brief-flag-35586 what @curved-television-6568 says is true, but that won't match the Pex version Pants uses. What are you trying to do exactly in more detail?
b
I’m trying to export dependencies into some kind of lock file. We have a pants generated lock file
default.lock
I would like to import it to some kind of requirements lock:
Copy code
pants pex-cli -- lock export default.lock > requiremenets.lock
e
I'd personally just not use Pants there. That's an extra layer for no real purpose.
So, @brief-flag-35586 you need a hashed requirements.txt ~lock for some other tool to use?
b
right
I just thought that as pants already have pex integrated, there should be a way to use it, but looks like my assumption wasn’t correct
e
That's right. Your assumption was incorrect. There is no easy way to use Pants's Pex directly.
1
In your favor though is, unlike Pants, Pex never breaks you. It's always backwards compatible. So you should be able to use ~any version of Pex and have it work with your Pants generated lock file.
c
n.b. that pants adds a comment header to the lockfile that needs to be stripped before being handed to pex.
e
Ah, yes. See, Pants breaks you! That really, really is unfortunate.
😄 2
2
b
Got it, thank you guys for your help, appreciate it 🙂
👍 1
b
I've said we should support you running Pants's tools at the CLI level
🙏 1
Not hard, but never enough momentum to do it
g
With the
SubSystem.rules()
workflow that's now standard, I wonder if one could "inject" an enum that way and have a
tool
goal or similar dispatch through that...
🤔 1
(Which I guess is what you mean by "not hard", someone just has to do it :P)
👍 2