Fix duplicate modules in generated Weave refs #2115
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fix duplicate modules in generated Weave refs
The problem
The duplication was caused by module-level aliases in the Weave source code, not a bug in the documentation generation script. In weave/trace/util.py, the library exports convenience aliases:
ThreadPoolExecutor = ContextAwareThreadPoolExecutorThread = ContextAwareThread
This means both the original class names and their shorter aliases were being documented separately, even though they're the same Python objects.
(Slack thread)
The fix:
Tracks each object's identity as it's processed
Skips any object that's already been documented (detecting aliases)
Works for any module with similar alias patterns
Validation
Regenerated the Weave refs using the updated script, in a separate commit.
Testing
mint dev)mint broken-links)