forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.readthedocs.yml
More file actions
58 lines (54 loc) · 1.81 KB
/
.readthedocs.yml
File metadata and controls
58 lines (54 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 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
sphinx:
configuration: Doc/conf.py
build:
os: ubuntu-24.04
tools:
python: "3"
jobs:
post_checkout:
# https://docs.readthedocs.com/platform/stable/guides/build/skip-build.html#skip-builds-based-on-conditions
#
# Cancel building pull requests when there aren't 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=main;
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/"