Hello, I am trying to define a dependency of a `py...
# general
a
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
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
Ok, will do! Thanks šŸ‘
h
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
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
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
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