I have a hunch I've just missed something in the d...
# general
s
I have a hunch I've just missed something in the docs or user guide, but, I'm a bit stuck trying to run a Python module installed into my repo's "universe of dependencies". Prior to using pants, I would have run
.venv/bin/python -m some_tool ...
. Is there a relevant target that I've missed?
h
Is this a module in some third-party requirement?
s
A third-party requirement
e
Are you trying to run it outside of pants? You probably need to
pants export
a virtualenv and then you could run it with
dist/<however/it/exports/the/venv -m some_tool
see https://www.pantsbuild.org/2.21/docs/using-pants/setting-up-an-ide
s
I'm hoping I can get pants to run it. Like,
pants run ...
. Of note, I'm using pants to install the dependency.
h
I think you can do this with a
pex_binary()
target whose
entry_point
field is set appropriately
You need an explicit dep from the
pex_binary()
to the requirement containing the entry point
s
Mm, thank you! Will give that a try
h
Keep in mind that this will build a pex and then run it, so it won't be fast
Or rather the first run won't be
c
If it is the default entry point of the package, you can also do something like
pants run 3rdparty/py#black