- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 635
Labels
Description
🚀 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:
foo.py
foo.pyi
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 generationDescribe alternatives you've considered
None 😜