SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.73k stars 8.02k forks source link

Added requirements.txt to doc build environment #14171

Closed emanlove closed 1 week ago

emanlove commented 1 week ago

User description

For the API documentation as sphinx autogenerates the api docs from the code it needs the dependent Python packages. This change adds those to the tox docs build environment.

Description

This adds the requirments.txt to the tox docs build environment.

Motivation and Context

The Sphinx Python API docs are built by "reading the code". That is as if Python were importing or running it. Thus the required dependencies to run the Python bindings are also require to build the API documentation.

Types of changes

Checklist


PR Type

Bug fix, Documentation


Description


Changes walkthrough ๐Ÿ“

Relevant files
Configuration changes
tox.ini
Include `requirements.txt` in tox documentation build environment

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

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

    codiumai-pr-agent-pro[bot] commented 1 week ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review [1-5] 1
    ๐Ÿงช Relevant tests No
    ๐Ÿ”’ Security concerns No
    โšก Key issues to review None
    codiumai-pr-agent-pro[bot] commented 1 week ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Ensure the path to requirements.txt is correct to avoid file not found errors ___ **Ensure that the requirements.txt file is located in the correct directory relative to the
    tox.ini file, or provide an absolute path to avoid potential file not found errors.** [py/tox.ini [9]](https://github.com/SeleniumHQ/selenium/pull/14171/files#diff-27d219400d7f64afbf3d9bceb197e20b299fdd58fb4e84c9b7c2ee7c4e828177R9-R9) ```diff --r requirements.txt +-r path/to/requirements.txt ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 7 Why: This suggestion is relevant as it addresses a potential runtime error if the `requirements.txt` file is not found. It's a practical improvement for ensuring the build process does not fail.
    7
    Best practice
    Pin versions of dependencies in requirements.txt to ensure consistent builds ___ **Consider pinning the versions of the dependencies listed in requirements.txt to ensure
    consistent builds across different environments.** [py/tox.ini [9]](https://github.com/SeleniumHQ/selenium/pull/14171/files#diff-27d219400d7f64afbf3d9bceb197e20b299fdd58fb4e84c9b7c2ee7c4e828177R9-R9) ```diff -r requirements.txt +# Ensure versions are pinned in requirements.txt ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 6 Why: The suggestion to pin versions in `requirements.txt` is a good practice to ensure consistent environments, although it does not directly modify the PR code but rather the contents of another file. It's indirectly related to the PR changes.
    6
    iampopovich commented 1 week ago

    @emanlove I applied the changes in my PR, and the documentation was generated without any dependency errors. Thank you.