Skip to content

[py] Fix API doc generation script and include BiDi Emulation docs #16037

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 3 commits into from
Jul 12, 2025

Conversation

cgoldberg
Copy link
Contributor

@cgoldberg cgoldberg commented Jul 10, 2025

User description

💥 What does this PR do?

This PR fixes the py/generate_api_module_listing.py script used in generating the Python API documentation. It was creating duplicate module names in some areas of the table of contents.

For example, it was creating an entry for all the selenium.webdriver.common.actions modules under both the webdriver.common.actions and webdriver.common sections.

This PR also includes a newly generated py/docs/source/api.rst file that includes the new selenium.webdriver.common.bidi.emulation module from #15819

🔄 Types of changes

  • Bug fix (backwards compatible)
  • Documentation

PR Type

Bug fix, Documentation


Description

  • Fix duplicate module entries in Python API documentation

  • Include new BiDi Emulation module in documentation

  • Clean up module listing generation logic


Changes diagram

flowchart LR
  A["API Doc Generator"] --> B["Fix Duplicate Logic"]
  B --> C["Clean Module Listing"]
  C --> D["Add BiDi Emulation"]
  D --> E["Updated API Docs"]
Loading

Changes walkthrough 📝

Relevant files
Bug fix
generate_api_module_listing.py
Fix duplicate module generation logic                                       

py/generate_api_module_listing.py

  • Add depth check to prevent duplicate module entries
  • Fix logic to only include direct child modules
  • +2/-1     
    Documentation
    api.rst
    Update API documentation with clean module listing             

    py/docs/source/api.rst

  • Remove duplicate module entries from webdriver.common section
  • Add selenium.webdriver.common.bidi.emulation module
  • Clean up module organization structure
  • +1/-24   

    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 Jul 10, 2025
    Copy link
    Contributor

    qodo-merge-pro bot commented Jul 10, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    @cgoldberg cgoldberg changed the title [py] Fix api doc generation and include BiDi Emulation docs [py] Fix API doc generation script and include BiDi Emulation docs Jul 10, 2025
    @SeleniumHQ SeleniumHQ deleted a comment from qodo-merge-pro bot Jul 10, 2025
    Copy link
    Member

    @navin772 navin772 left a comment

    Choose a reason for hiding this comment

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

    Thanks for adding this, I always forget to add an entry for a new module. Can we add this script in format.sh so it runs automatically?

    @cgoldberg
    Copy link
    Contributor Author

    It actually runs automatically when the docs are generated, so we could just remove api.rst from the repo. I just keep an updated copy in the repo for the (unlikely) chance that someone tries to generate the docs without running the script.

    @cgoldberg cgoldberg merged commit b9dac0b into SeleniumHQ:trunk Jul 12, 2025
    16 checks passed
    @cgoldberg cgoldberg deleted the py-fix-api-docs branch July 12, 2025 01:25
    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.

    3 participants