I'm running into an issue where my `pex_binary` ta...
# general
l
I'm running into an issue where my
pex_binary
target is not adding any of my actual code (other than <http://init.to|init__.py) to> the pex file. Any tips on debugging this?
c
yes, that sounds like an issue with you not getting dependencies inferred properly. Try
pants dependencies path/to/pex:target
to see what dependencies you have, and also for the entry point/main script of your pex target.
r
Hey if you are using the earlier code snippet I posted, you need to provide it explicitly in dependencies of
pex_binary
Copy code
# BUILD
python_sources(name="sources")

# Explicit dependency on `:sources` from above
pex_binary(
    name="service",
    entry_point="awslambdaric",
    dependencies=["3rdparty/python:default#awslambdaric", ":sources"],
)
l
ah ok, thanks, I'll give that a shot
r
Just to explain, why you need to do it, it’s because the
entry_point="awslambdaric"
is not an entry point which depends on your python sources and hence pants can’t infer the dependency on source code automatically.