Skip to content

Commit 9baa5cf

Browse files
authored
Fix generated Weave Python SDK landing page (#1949)
## Description The root weave module re-exports many classes and functions from submodules (e.g., Agent from weave.agent.agent). The doc generation script was filtering these out because their __module__ attribute didn't match 'weave', resulting in an empty landing page (8 lines instead of 3000+). This fix updates the filtering logic to include all public members for the root 'weave' module while maintaining strict filtering for submodules. Fixes the python-sdk.mdx being empty/deleted in generated PRs.
1 parent c61fa7f commit 9baa5cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/reference-generation/weave/generate_python_sdk_docs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ def generate_module_docs(module, module_name: str, src_root_path: str, version:
230230
continue
231231

232232
obj = getattr(module, name)
233-
if hasattr(obj, "__module__") and obj.__module__ != module_name:
233+
234+
# For the root "weave" module, include re-exported items from submodules
235+
# Otherwise, only include items that belong to this specific module
236+
if module_name != "weave" and hasattr(obj, "__module__") and obj.__module__ != module_name:
234237
continue
235238

236239
sections.append(process_object(obj, generator, module_name))

0 commit comments

Comments
 (0)