🚀 feature request
Relevant Rules
Gazelle
Description
New directive: # gazelle:python_generate_pyi_srcs true or similar
If a manually-generated .pyi file is present, it should be added to the pyi_srcs target attribute:
py_library(
name = "foo",
srcs = ["foo.py"],
pyi_srcs = ["foo.pyi"],
)
Describe the solution you'd like
New directive: # gazelle:python_generate_pyi_srcs true or similar
At a very high level, the logic is basically just looking for a file with the same name as the python module but a different extension:
# pseudocode
for python_file in list_of_files:
pyi_file = python_file.with_ext(".pyi") # foo.py --> foo.pyi
if pyi_file.exists():
pyi_srcs.append(pyi_file)
# rest of the target generation
Describe alternatives you've considered
None 😜
🚀 feature request
Relevant Rules
Gazelle
Description
New directive:
# gazelle:python_generate_pyi_srcs trueor similarIf a manually-generated
.pyifile is present, it should be added to thepyi_srcstarget attribute:Describe the solution you'd like
New directive:
# gazelle:python_generate_pyi_srcs trueor similarAt a very high level, the logic is basically just looking for a file with the same name as the python module but a different extension:
Describe alternatives you've considered
None 😜