https://pantsbuild.org/ logo
#general
Title
# general
l

loud-laptop-17949

05/12/2022, 9:04 PM
Is there a way to turn a python_dependency into a pex? I have a 3rdparty dependency (semgrep) that I want to run from a shell script. It would be awesome if I could tell pants to generate a pex for me.
1
h

hundreds-father-404

05/12/2022, 9:04 PM
l

loud-laptop-17949

05/12/2022, 9:06 PM
awesome
maybe dumb question, but how do I run an example like that? I copied that into
src/bin/BUILD
in my repo and would expect
./pants run src/bin:black_bin
to work. What am I missing?
h

hundreds-father-404

05/12/2022, 10:35 PM
Is that not working? That is how you should do it. and you can use passthrough args like
./pants run src/bin:black -- --version
l

loud-laptop-17949

05/12/2022, 10:35 PM
i think it is due to something in how we have lock files set up
👀 1
i will figure it out
h

hundreds-father-404

05/12/2022, 10:35 PM
you can also
./pants package
it then run from
dist
hm, whats going on?
l

loud-laptop-17949

05/12/2022, 11:23 PM
this may reveal my ignorance more than anything - but when I use a version of black we have in our lock file it works, but if I use a different version it doesn't
and this is relevant because I was trying to work around some version conflicts in our lock file
h

hundreds-father-404

05/12/2022, 11:25 PM
a) By lockfile, do you mean a lockfile from
[python].resolves
? Or
[black].lockfile
? b) What do you mean with different versions? Like a
python_requirement
target?