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

abundant-hospital-56388

06/21/2022, 12:49 PM
Hello, I am trying to define a dependency of a
python_source
on a
shell_source
, which works according to the
./pants dependencies
command, but the
shell_source
is not included in the
.pex
file when running
./pants package
. When I replace the
shell_source
and use
resource
instead, I can make it work.
Can be tested by running
./pants dependencies //:bin
and
./pants package //:bin
in the attached folder
b

bitter-ability-32190

06/21/2022, 12:55 PM
Yeah, this is somewhat of a breakdown of how Pants understands consuming dependencies. Your current path forward is to keep using
resource
. I'm actively working on a proposal to make this better.
a

abundant-hospital-56388

06/21/2022, 12:57 PM
Ok, will do! Thanks šŸ‘
h

happy-kitchen-89482

06/21/2022, 1:02 PM
Good example to add to that doc!
Relevant also to @proud-dentist-22844's question in another thread about embedding non- python scripts in dists
b

bitter-ability-32190

06/21/2022, 1:06 PM
yeah @happy-kitchen-89482 I'm starting to collect these cases as my foundation for my upcoming proposal šŸ˜… Ideally our users fall into the Pit Of Success. Also, Benjy wanna jump in on https://github.com/pantsbuild/pants/discussions/15847? šŸ˜„
Oh and @abundant-hospital-56388 you can actually use both
shell_source
and
resource
if you want (if you're formatting or linting your
shell_source
for instance). Just make the dependency on the resource
a

abundant-hospital-56388

06/21/2022, 1:08 PM
ah, that's good to know! Right now we're not linting the shell scripts, but I have that on my list of things to add in after we switched over to pants fully.
šŸ™Œ 1
p

proud-dentist-22844

06/21/2022, 3:57 PM
Oh. Just saw this thread. Dang!
šŸ˜… 1
If it helps, I just wrote a macro that creates both a
shell_sources
target and a
resource
target: https://github.com/st2sandbox/st2/commit/3cd43920159a2a48f502a8cd1028be538501370d#diff-ea05987828aa291b1e3ea7dedd[ā€¦]9d470ae6339d4c649766e24a4034fR75 some of it depends on the other macros I have, but hopefully that bridges the gap until @bitter-ability-32190ā€™s dependencies proposal lands.
šŸ‘ 1