Skip to content

Commit 0f56290

Browse files
authored
Infra: override RTD build commands (#2728)
1 parent c75fd8f commit 0f56290

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

.github/workflows/render.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
python -m pip install --upgrade pip
2525
2626
- name: 🔧 Render PEPs
27-
run: make pages -j$(nproc)
27+
run: make pages JOBS=$(nproc)
2828

2929
# remove the .doctrees folder when building for deployment as it takes two thirds of disk space
3030
- name: 🔥 Clean up files

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
PYTHON=python3
44
VENVDIR=.venv
55
JOBS=8
6-
RENDER_COMMAND=$(VENVDIR)/bin/python3 build.py -j $(JOBS)
6+
OUTPUT_DIR=build
7+
RENDER_COMMAND=$(VENVDIR)/bin/python3 build.py -j $(JOBS) -o $(OUTPUT_DIR)
78

89
render: venv
910
$(RENDER_COMMAND)

build.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ def create_parser():
3636
parser.add_argument("-j", "--jobs", type=int, default=1,
3737
help="How many parallel jobs to run (if supported). "
3838
"Integer, default 1.")
39+
parser.add_argument(
40+
"-o",
41+
"--output-dir",
42+
default="build", # synchronise with render.yaml -> deploy step
43+
help="Output directory, relative to root. Default 'build'.",
44+
)
3945

4046
return parser.parse_args()
4147

@@ -57,7 +63,7 @@ def create_index_file(html_root: Path, builder: str) -> None:
5763

5864
root_directory = Path(".").absolute()
5965
source_directory = root_directory
60-
build_directory = root_directory / "build" # synchronise with deploy-gh-pages.yaml -> deploy step
66+
build_directory = root_directory / args.output_dir
6167
doctree_directory = build_directory / ".doctrees"
6268

6369
# builder configuration

readthedocs.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
version: 2
22

33
build:
4-
os: ubuntu-20.04
4+
os: ubuntu-22.04
55
tools:
6-
python: "3.9"
6+
python: "3.10"
77

8-
python:
9-
install:
10-
- requirements: requirements.txt
8+
commands:
9+
- make pages JOBS=$(nproc) OUTPUT_DIR=_readthedocs/html
1110

1211
sphinx:
1312
builder: dirhtml

0 commit comments

Comments
 (0)