Skip to content

Commit 118e182

Browse files
authored
Add --include-docstrings to generate_stubs.py
This feature was added to stubgen in 2023 and would improve developer experience with depthai. Bellow is quote from the original issue (on stubgen repo): I think this would be most useful for external C or C++ modules, because some IDEs don't look for signatures or docstrings in compiled modules. Using stubgen at least fixes autocomplete for compiled modules, but if the stub files don't include docstrings, IDEs might not show any documentation when hovering over the function/class/variable in the editor (unlike with plain Python modules). For example, Pylance in VSCode doesn't show documentation for functions in compiled modules, even with stub files generated by stubgen.
1 parent a16efa1 commit 118e182

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

generate_stubs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
print(f'Could not import depthai: {ex}')
3030

3131
print(f'PYTHONPATH set to {env["PYTHONPATH"]}')
32-
subprocess.check_call(['stubgen', '-p', MODULE_NAME, '-o', f'{DIRECTORY}'], cwd=DIRECTORY, env=env)
32+
subprocess.check_call(['stubgen', '--include-docstrings', '-p', MODULE_NAME, '-o', f'{DIRECTORY}'], cwd=DIRECTORY, env=env)
3333

3434
# Add py.typed
3535
open(f'{DIRECTORY}/depthai/py.typed', 'a').close()

0 commit comments

Comments
 (0)