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

proud-dentist-22844

06/20/2022, 8:39 PM
How do I define
scripts
for a
python_distribution
? https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html#the-scripts-keyword-argument (scripts is not the same thing as entry_points as it can include bash scripts, or unimportable kebab-case python scripts) edit: moved from #plugins because this wasn't a plugin-development-related question
e

enough-analyst-54434

06/20/2022, 11:32 PM
That will need some code work. Although
provides
allows you to pass arbitrary extra
setup(...)
kwargs, if the values need to point to files, then Pants will need to know about that.
👍 1
p

proud-dentist-22844

06/21/2022, 12:10 AM
Thanks. I found a way to add them to both dependencies and provides via a macro.
Doh. My macro worked for including the python scripts in my python_distribution, but none of the shell scripts are making it into the chroot for setup tools to include in the wheel. How can I add shell scripts to
dependencies
of a
python_distribution
so that the scripts are available in the chroot that setuptools uses?
b

bitter-ability-32190

06/21/2022, 3:58 PM
resources
which point to the shell scripts
You're the third person to have this issue this week. It's a really convincing argument for my upcoming proposal to change Pants' understanding of dependencies 😅
1
p

proud-dentist-22844

06/21/2022, 3:58 PM
So, then I have to have two targets own the same files? Or can I have a resources target with
dependencies
on the
shell
target.
b

bitter-ability-32190

06/21/2022, 3:59 PM
I don't think it matters that much? I'd personally do two-targets -same-source
There's the BUILD file with the shell sources.
I read through the shell files to make sure dependencies were recorded between the shell scripts.
b

bitter-ability-32190

06/21/2022, 4:01 PM
Actually, I think it does matter. I think you do need two-targets-one-sources
If you arent formatting/linting the shell source you can get away with just
resources
p

proud-dentist-22844

06/21/2022, 4:03 PM
True. I'm not linting it yet, but I want to enable that later. Hmm.
b

bitter-ability-32190

06/21/2022, 4:04 PM
😭 FWIW my proposal maybe makes it in 2.15? It's q huge change, and I'm just using volunteer time
p

proud-dentist-22844

06/21/2022, 4:04 PM
ok. I'll do another target. I look forward to your proposal and the implementation.
🙌 1
And thanks for improving so much in pants!
❤️ 2
@bitter-ability-32190 I've got another use-case to add to your proposal. All of the files for my custom targets (from in-repo plugins, not macros) are NOT showing up in my sdists or wheels. So, now I have to figure how to get the python backend to reccognize my targets as resources. Inferred dependencies are working marvelously. But
./pants package
is effectively ignoring my targets.
😭 1