Skip to content
Open
Changes from 1 commit
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
64 changes: 55 additions & 9 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
# This is a dummy config file so that readthedocs.org doesn't fail on security branches.
# Note that this won't result in docs actually getting built;
# clicking on the docs preview link on a PR will result in a 404.
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Project page: https://readthedocs.org/projects/cpython-previews/

version: 2
formats: []

sphinx:
configuration: Doc/conf.py
configuration: Doc/conf.py

build:
os: "ubuntu-22.04"
os: ubuntu-24.04
tools:
python: "3.11"
python: "3"
Comment thread
hugovk marked this conversation as resolved.
Outdated
apt_packages:
- jq

jobs:
post_checkout:
- exit 183
post_system_dependencies:
# https://docs.readthedocs.com/platform/stable/guides/build/skip-build.html#skip-builds-based-on-conditions
#
# Cancel building pull requests when there are no changes in the Doc
# directory or RTD configuration, or if we can't cleanly merge the base
# branch.
- |
set -eEux;
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
then
base_branch=$(wget -qO- "https://api.github.com/repos/python/cpython/pulls/$READTHEDOCS_VERSION" | jq -er ".base.ref");
git fetch --depth=50 origin $base_branch:origin-$base_branch;
for attempt in $(seq 10);
do
if ! git merge-base HEAD origin-$base_branch;
then
git fetch --deepen=50 origin $base_branch;
else
break;
fi;
done;
if ! git -c "user.name=rtd" -c "user.email=no-reply@readthedocs.org" merge --no-stat --no-edit origin-$base_branch;
then
echo "Unsuccessful merge with '$base_branch' branch, skipping the build";
exit 183;
fi;
if git diff --exit-code --stat origin-$base_branch -- Doc/ .readthedocs.yml;
then
echo "No changes to Doc/ - skipping the build.";
exit 183;
fi;
fi;
create_environment:
- echo "Skipping default environment creation"
install:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
build:
html:
- make -C Doc venv html
- mkdir -p "$READTHEDOCS_OUTPUT"
- mv Doc/build/html "$READTHEDOCS_OUTPUT/"
Loading