Skip to content

[py] Fix python API docs publishing at readthedocs #15832

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 1 commit into from
May 30, 2025

Conversation

cgoldberg
Copy link
Contributor

@cgoldberg cgoldberg commented May 30, 2025

User description

💥 What does this PR do?

I broke our readthedocs configuration in #15828 for publishing the Python API docs.
This attempts to fix it.


PR Type

Bug fix


Description

  • Fixes Python API docs generation command for ReadTheDocs

  • Updates .readthedocs.yaml to correct script execution path


Changes walkthrough 📝

Relevant files
Documentation
.readthedocs.yaml
Fix ReadTheDocs build command for Python API docs               

py/docs/.readthedocs.yaml

  • Corrects the command to run generate_api_module_listing.py by changing
    to the py directory before execution.
  • Ensures the script is executed in the correct context for ReadTheDocs
    builds.
  • +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 C-py Python Bindings and removed Review effort 1/5 labels May 30, 2025
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

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

    Directory Navigation

    The command changes directory to 'py' but then uses 'cd' without arguments to return. This might not work as expected in all shell environments. Consider using 'cd -' or explicit 'cd ..' to return to the previous directory.

    - cd py && python3 generate_api_module_listing.py && cd
    - PYTHONPATH=py sphinx-autogen -o $READTHEDOCS_OUTPUT/html py/docs/source/api.rst

    @cgoldberg cgoldberg merged commit 679b0f3 into SeleniumHQ:trunk May 30, 2025
    7 checks passed
    @cgoldberg cgoldberg deleted the py-fix-rtd branch May 30, 2025 18:01
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix directory navigation

    The cd command without arguments doesn't properly return to the original
    directory. Use cd .. instead to ensure you return to the parent directory after
    running the script.

    py/docs/.readthedocs.yaml [17]

    -- cd py && python3 generate_api_module_listing.py && cd
    +- cd py && python3 generate_api_module_listing.py && cd ..
    • Apply / Chat
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion correctly identifies that cd without arguments goes to the home directory rather than returning to the original directory. This could cause subsequent commands to fail if they expect to be in the original working directory.

    Medium
    • More

    @cgoldberg
    Copy link
    Contributor Author

    it worked!

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    C-py Python Bindings
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants