Skip to content

Avoid autogenerating docs for Python files with leading underscore#2397

Merged
timmoon10 merged 5 commits into
NVIDIA:mainfrom
timmoon10:tmoon/debug-docs
Nov 19, 2025
Merged

Avoid autogenerating docs for Python files with leading underscore#2397
timmoon10 merged 5 commits into
NVIDIA:mainfrom
timmoon10:tmoon/debug-docs

Conversation

@timmoon10
Copy link
Copy Markdown
Collaborator

@timmoon10 timmoon10 commented Nov 18, 2025

Description

We've experienced CI failures due to hangs when generating docs, possibly because self imports in transformer_engine/debug/features/_test_dummy_feature.py are causing infinite recursion. This PR attempts to fix this issue by excluding this file from doc generation.

#2301 is another attempt to fix problems with documentation, although I don't think it addresses anything with _test_dummy_feature.py.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

  • Avoid generating docs for Python files with leading underscore

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@timmoon10 timmoon10 added bug Something isn't working documentation Improvements or additions to documentation labels Nov 18, 2025
@timmoon10 timmoon10 marked this pull request as ready for review November 18, 2025 22:44
@timmoon10
Copy link
Copy Markdown
Collaborator Author

timmoon10 commented Nov 18, 2025

Pipeline 38744752 is green.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Nov 18, 2025

Greptile Summary

  • Fixes CI documentation hangs by excluding private Python files (with leading underscore) from autoapi doc generation
  • Pattern */_[!_]* correctly excludes internal files like _test_dummy_feature.py, _common.py while preserving __init__.py files

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a single-line configuration addition that follows Python conventions for excluding private modules from documentation. The glob pattern correctly targets files with single underscore prefix while preserving __init__.py files. This directly addresses the CI hang issue caused by self-imports in _test_dummy_feature.py.
  • No files require special attention

Important Files Changed

Filename Overview
docs/conf.py Added glob pattern to exclude private Python files (starting with single underscore) from doc generation while preserving __init__.py files

Sequence Diagram

sequenceDiagram
    participant Dev as "Developer"
    participant Sphinx as "Sphinx Doc Builder"
    participant AutoAPI as "AutoAPI Extension"
    participant FS as "File System"
    
    Dev->>Sphinx: "Trigger doc build"
    Sphinx->>AutoAPI: "Generate API docs"
    AutoAPI->>FS: "Scan transformer_engine/"
    FS-->>AutoAPI: "Return Python files"
    AutoAPI->>AutoAPI: "Apply autoapi_ignore pattern */_[!_]*"
    AutoAPI->>AutoAPI: "Exclude _test_dummy_feature.py, _common.py, etc"
    AutoAPI->>AutoAPI: "Include __init__.py files"
    AutoAPI->>Sphinx: "Generate docs for filtered files"
    Sphinx-->>Dev: "Documentation built successfully"
Loading

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

@timmoon10 timmoon10 requested a review from pggPL November 19, 2025 00:19
Copy link
Copy Markdown
Collaborator

@pggPL pggPL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@timmoon10 timmoon10 merged commit 49f7c1d into NVIDIA:main Nov 19, 2025
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.10.0 bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants