Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions py/docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,45 @@ build:
os: ubuntu-24.04
tools:
python: "3.12"

commands:
- pip install -r py/requirements_lock.txt
- cd py && python3 generate_api_module_listing.py && cd
- PYTHONPATH=py sphinx-autogen -o $READTHEDOCS_OUTPUT/html py/docs/source/api.rst
- PYTHONPATH=py sphinx-build -b html -d build/docs/doctrees py/docs/source $READTHEDOCS_OUTPUT/html
- |
set -euo pipefail
Comment thread
cgoldberg marked this conversation as resolved.

REPO_DIR="$(pwd)"
PACKAGE="selenium"
VERSION="$(
curl -fsSL "https://test.pypi.org/pypi/${PACKAGE}/json" |
sed -n 's/.*"version":"\([^"]*\)".*/\1/p' |
head -n1
)"
URL="$(
curl -fsSL "https://test.pypi.org/pypi/${PACKAGE}/${VERSION}/json" |
sed -n 's/.*"url":"\([^"]*\.tar\.gz\)".*/\1/p' |
head -n1
)"
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
SDIST="$(basename "${URL}")"
Comment thread
cgoldberg marked this conversation as resolved.

# install dependencies
pip install -r "${REPO_DIR}/py/requirements_lock.txt"

# fetch latest nightly sdist tarball from TestPyPI
curl -fsSLOJ "${URL}"

# overlay packaged/generated code from the sdist into the repo checkout
tar -xzf "${SDIST}"
cp -a "${SDIST%.tar.gz}/selenium/." "${REPO_DIR}/py/${PACKAGE}/"
Comment thread
qodo-code-review[bot] marked this conversation as resolved.

Comment thread
cgoldberg marked this conversation as resolved.
# remove extracted sdist contents
rm -rf "${SDIST%.tar.gz}" "${SDIST}"

# generate new .rst with API modules
cd "${REPO_DIR}/py" && python3 "generate_api_module_listing.py" && cd ..

export PYTHONPATH="${REPO_DIR}/py:${PYTHONPATH:-}"
Comment thread
cgoldberg marked this conversation as resolved.

# generate doc stubs
sphinx-autogen -o "${READTHEDOCS_OUTPUT}/html" "py/docs/source/api.rst"

sphinx:
configuration: py/docs/source/conf.py
# build docs
sphinx-build -b html -d build/docs/doctrees py/docs/source ${READTHEDOCS_OUTPUT}/html
Comment thread
cgoldberg marked this conversation as resolved.
Loading