Skip to content

[py] Skip devtools when generating Python API docs #15918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2025

Conversation

cgoldberg
Copy link
Contributor

@cgoldberg cgoldberg commented Jun 19, 2025

User description

💥 What does this PR do?

This PR updates the API generation script so it doesn't auto-generate API docs for devtools modules if they exist.

This also updates the link to latest documentation on readthedocs.io.

🔄 Types of changes

  • Documentation

PR Type

Documentation


Description

• Skip devtools modules from Python API documentation generation
• Update ReadTheDocs link formatting with proper hyperlink syntax


Changes walkthrough 📝

Relevant files
Documentation
generate_api_module_listing.py
Filter devtools from API generation                                           

py/generate_api_module_listing.py

• Filter out devtools modules from API documentation generation

Optimize base_modules list comprehension with set comprehension
• Add
blank line for code formatting

+3/-2     
index.rst
Update ReadTheDocs link formatting                                             

py/docs/source/index.rst

• Convert ReadTheDocs URL to proper reStructuredText hyperlink format

• Update documentation link to use latest version endpoint

+1/-1     

Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @selenium-ci selenium-ci added the C-py Python Bindings label Jun 19, 2025
    Copy link
    Contributor

    qodo-merge-pro bot commented Jun 19, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Use robust module path filtering

    The string matching approach for filtering devtools modules is fragile and may
    miss edge cases. Consider using startswith() or endswith() methods for more
    robust module path filtering.

    py/generate_api_module_listing.py [51]

    -modules = [module for module in find_modules(package_name) if ".devtools." not in module]
    +modules = [module for module in find_modules(package_name) if not module.startswith(f"{package_name}.devtools")]
    • Apply / Chat
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion correctly points out that filtering with ".devtools." not in module is fragile. The proposed change to use not module.startswith(f"{package_name}.devtools") is more robust because it correctly handles the root devtools package itself, not just its submodules. This improves the correctness of the filtering logic.

    Medium
    • Update

    @SeleniumHQ SeleniumHQ deleted a comment from qodo-merge-pro bot Jun 19, 2025
    @cgoldberg cgoldberg merged commit d3ad2e6 into SeleniumHQ:trunk Jun 19, 2025
    8 of 9 checks passed
    @cgoldberg cgoldberg deleted the py-api-docs-skip-devtools branch June 19, 2025 21:28
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants