Skip to content
Merged
Changes from all 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
44 changes: 6 additions & 38 deletions py/docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,11 @@ build:
os: ubuntu-24.04
tools:
python: "3.12"

commands:
- |
REPO_DIR="$(pwd)"
PACKAGE="selenium"
VERSION="$(
curl -fsSL "https://test.pypi.org/pypi/${PACKAGE}/json" |
sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' |
head -n1
)"
URL="$(
curl -fsSL "https://test.pypi.org/pypi/${PACKAGE}/${VERSION}/json" |
sed -n 's/.*"url"[[:space:]]*:[[:space:]]*"\([^"]*\.tar\.gz\)".*/\1/p' |
head -n1
)"
SDIST="$(basename "${URL}")"

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

# fetch latest nightly sdist tarball from TestPyPI
curl -fsSL -o "${SDIST}" "${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}/"

# 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:-}"

# generate doc stubs
sphinx-autogen -o "${READTHEDOCS_OUTPUT}/html" "py/docs/source/api.rst"
- 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

# build docs
sphinx-build -b html -d build/docs/doctrees py/docs/source ${READTHEDOCS_OUTPUT}/html
sphinx:
configuration: py/docs/source/conf.py
Loading