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

shy-advantage-49800

11/11/2022, 4:16 PM
How am I supposed to add the
py.typed
?
1
Copy code
resource(name="stubs", source="py.typed")

python_sources(dependencies=[":stubs"])
like this? It works. Is it the best way?
h

happy-kitchen-89482

11/11/2022, 4:57 PM
I think that’s correct
we should probably add it to the default globs for
python_sources
If you want to cook up a quick PR for that?
c

curved-television-6568

11/11/2022, 11:34 PM
What do you think of having a field on the
python_distribution
for instance, so when
typed=True
that file is materialized and included in the dist? Then as a user you don’t need to bother with that boiler platey stuff.. (one stub file, one target and an explicit dep)
s

shy-advantage-49800

11/12/2022, 6:20 AM
That would be cool
h

happy-kitchen-89482

11/14/2022, 8:47 PM
I.e., we generate the file?
Alongside the generated setup.py?
c

curved-television-6568

11/14/2022, 8:55 PM
yep
and suggested implementation, later closed here: https://github.com/pantsbuild/pants/pull/12751
could serve as inspiration and/or deterrent 😛
5 Views