Skip to content
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

[py] Update Documentation api.rst File List #14172

Closed

Conversation

iampopovich
Copy link
Contributor

@iampopovich iampopovich commented Jun 22, 2024

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

trying to fix documentation for current and obsolete classes according to issue #13910

Motivation and Context

Types of changes

  • 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 change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Documentation, Bug fix


Description

  • Added module-level docstring for DriverFinder implementation.
  • Updated the list of modules in api.rst to include new and reordered entries, ensuring alphabetical order.
  • Added NoSuchDriverException to the exceptions list in selenium.common.exceptions.
  • Added new documentation files for selenium.webdriver.common.driver_finder and selenium.webdriver.common.selenium_manager.
  • Added PageLoadStrategy to the autosummary list in selenium.webdriver.common.options.
  • Removed obsolete documentation for selenium.webdriver.firefox.extension_connection.
  • Added requirements.txt to the dependencies list in tox.ini.

Changes walkthrough 📝

Relevant files
Documentation
driver_finder.py
Add module-level docstring for DriverFinder                           

py/selenium/webdriver/common/driver_finder.py

  • Added module-level docstring for DriverFinder implementation.
+1/-0     
api.rst
Update and reorder module list in api.rst                               

py/docs/source/api.rst

  • Updated the list of modules in api.rst to include new and reordered
    entries.
  • Ensured alphabetical order for module listings.
  • +36/-14 
    selenium.common.exceptions.rst
    Add NoSuchDriverException to exceptions list                         

    py/docs/source/common/selenium.common.exceptions.rst

  • Added NoSuchDriverException to the exceptions list.
  • Minor formatting adjustments.
  • +15/-15 
    selenium.webdriver.common.driver_finder.rst
    Add documentation for selenium.webdriver.common.driver_finder

    py/docs/source/webdriver/selenium.webdriver.common.driver_finder.rst

  • Added new documentation file for
    selenium.webdriver.common.driver_finder.
  • +29/-0   
    selenium.webdriver.common.options.rst
    Add PageLoadStrategy to options documentation                       

    py/docs/source/webdriver/selenium.webdriver.common.options.rst

    • Added PageLoadStrategy to the autosummary list.
    +1/-0     
    selenium.webdriver.common.selenium_manager.rst
    Add documentation for selenium.webdriver.common.selenium_manager

    py/docs/source/webdriver/selenium.webdriver.common.selenium_manager.rst

  • Added new documentation file for
    selenium.webdriver.common.selenium_manager.
  • +29/-0   
    selenium.webdriver.firefox.extension_connection.rst
    Remove obsolete firefox extension connection documentation

    py/docs/source/webdriver_firefox/selenium.webdriver.firefox.extension_connection.rst

  • Removed obsolete documentation for
    selenium.webdriver.firefox.extension_connection.
  • +0/-35   
    Configuration changes
    tox.ini
    Add requirements.txt to tox dependencies                                 

    py/tox.ini

    • Added requirements.txt to the dependencies list in tox.ini.
    +1/-0     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @iampopovich iampopovich changed the title [py] fix documentation in issue 13910 [py] Update Documentation api.rst File List Jun 22, 2024
    @iampopovich iampopovich marked this pull request as ready for review June 22, 2024 03:58
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 3
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review Documentation Consistency:
    Ensure that the documentation updates are consistent with the actual API changes and that all new classes and methods are properly documented. The PR should be checked for completeness and accuracy in the documentation.
    Removal of Content:
    The removal of certain files and sections, such as selenium.webdriver.firefox.extension_connection, should be validated to ensure that they are indeed obsolete and that their removal does not affect other parts of the documentation or the actual functionality.

    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Verify the existence and accuracy of requirements.txt to prevent build issues

    Ensure that requirements.txt exists and contains the necessary dependencies to avoid
    potential build failures.

    py/tox.ini [9]

    --r requirements.txt
    +-r requirements.txt  # Ensure this file exists and is up-to-date
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion to ensure the existence and accuracy of requirements.txt is practical and helps prevent build failures, which is important for maintaining a reliable build process.

    7

    @titusfortner
    Copy link
    Member

    @iampopovich was this code automatically generated?

    @iampopovich
    Copy link
    Contributor Author

    No, I think we should close this pull request and continue figuring out how to fix the document generation globally using Sphinx.

    @titusfortner
    Copy link
    Member

    If this is going to generate the right things for 4.22, though, I'd like to get something updated and then we can figure out the automated way to do this going forward?

    @iampopovich
    Copy link
    Contributor Author

    iampopovich commented Jun 22, 2024

    Hm

    After I manually added new classes and removed non-existent ones, new .rst documents were generated automatically.

    When I ran it locally, I got a dialog asking, "Do you want to update the documentation?"

    I declined, but I think even if I had agreed, I wouldn't have had the write permissions to update the documentation in production.

    Is there a way to check the validity of the created documents without updating the existing documentation? I saw that sphinx can generate HTML, but unfortunately, I'm not at my computer right now.

    @iampopovich
    Copy link
    Contributor Author

    Some documents that were generated locally were not included in the commits.
    I deliberately didn't add them because I thought they could be created automatically when the documentation update action runs.

    These are the files with documentation for bidi.

    This can be checked by running ./go py:docs locally.

    @titusfortner
    Copy link
    Member

    titusfortner commented Jun 22, 2024

    You can't break anything. The current code

    1. Deletes relevant /build/docs/api/py directory
    2. Generates new docs to that directory
    3. Checks out gh-pages branch
    4. Deletes current /docs/api/py/ directory
    5. copies from /build/docs/api/py to /docs/api/py
    6. Commit/Push and Github does the build/publish

    So we just need to get tox -c py/tox.ini -e docs (or the equivalent) to generate the right files into buid/docs/api/py directory and compare it to the directory in gh-pages.

    @titusfortner
    Copy link
    Member

    Oh yeah, I just changed what ./go py:docs does. It used to try to do everything for you, now it just generates and makes the commit. Trying to get all the docs stuff done in Github actions now: https://github.com/SeleniumHQ/selenium/blob/trunk/.github/workflows/update-documentation.yml

    @iampopovich iampopovich force-pushed the 13910-fix-documentation branch from 311d79a to d842e44 Compare June 22, 2024 14:45
    @iampopovich
    Copy link
    Contributor Author

    @titusfortner you can see in my latest commit that new documents were generated according to the list of files in api.rst
    In the screenshot, I provided an example of the previously missing class wpewebkit.
    4.21.0
    Screenshot 2024-06-22 at 21 48 51
    my local build
    Screenshot 2024-06-22 at 21 46 31

    guess we can use manually updated api.rst for the 4.22.0 documentation

    @titusfortner
    Copy link
    Member

    Closing this in favor of #14173

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants