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

loud-spring-35539

04/13/2023, 5:38 PM
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

curved-television-6568

04/13/2023, 5:48 PM
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

refined-addition-53644

04/13/2023, 5:50 PM
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

loud-spring-35539

04/13/2023, 5:52 PM
ah ok, thanks, I'll give that a shot
r

refined-addition-53644

04/13/2023, 5:54 PM
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.