Skip to content

Commit 02bd0a1

Browse files
committed
Fix documention build on RTD
Added post_create_environment job to generate requirements.txt using uv, and updated python install method to use the generated requirements file. Signed-off-by: John Strunk <jstrunk@redhat.com>
1 parent 8700555 commit 02bd0a1

File tree

4 files changed

+44
-14
lines changed

4 files changed

+44
-14
lines changed

.readthedocs.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55

66
# Required
77
version: 2
8-
build:
8+
build:
99
os: ubuntu-22.04 # <- add this line
1010
tools:
1111
python: "3.10"
12+
jobs:
13+
post_create_environment:
14+
# Use uv to create a requirements file that RTD can install
15+
- pip install uv
16+
- uv export --format requirements.txt --only-group docs -o requirements.txt
1217

1318
# Build documentation in the docs/ directory with Sphinx
1419
sphinx:
@@ -24,12 +29,8 @@ formats: all
2429
# Optionally set the version of Python and requirements required to build your docs
2530
python:
2631
install:
27-
- method: pip
28-
path: .
29-
extra_requirements:
30-
- dev
31-
- method: setuptools
32-
path: .
32+
# Install the requirements file created during the post_create_environment job
33+
- requirements: requirements.txt
3334

3435
# build:
3536
# os: ubuntu-22.04

Makefile

+11-3
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,20 @@ test-api:
124124
# @ bash -c 'tox -e ALL'
125125

126126

127+
#
128+
# UV installation
129+
#
130+
.PHONY: uv
131+
uv:
132+
@ command -v uv >/dev/null 2>&1 || { echo "Installing uv..."; pip install --user uv; }
133+
127134
#
128135
# Documentation
129136
#
130137
.PHONY: docs docs-view
131-
docs:
132-
@ bash -c 'cd docs/ && rm -rf build/ && make html;'
138+
docs: uv
139+
-rm -rf docs/build
140+
uv run --only-group docs make -C docs html
133141

134142
docs-view: docs
135143
@ bash -c 'open docs/build/html/index.html'
@@ -184,4 +192,4 @@ docker-run-database:
184192
docker-run-rabbitmq:
185193
@ - docker stop augur_rabbitmq
186194
@ - docker rm augur_rabbitmq
187-
docker run -p 5434:5432 --name augur_rabbitmq augurlabs/augur:rabbitmq
195+
docker run -p 5434:5432 --name augur_rabbitmq augurlabs/augur:rabbitmq

pyproject.toml

+7-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ dependencies = [
8888
"tornado==6.4.1",
8989
"typing-extensions==4.7.1",
9090
"Werkzeug~=2.0.0",
91-
"wheel",
9291
"xgboost==1.4.2",
9392
"xlrd==2.0.1",
9493
"xlsxwriter==1.3.7",
@@ -100,11 +99,17 @@ dev = [
10099
"pytest==6.2.5",
101100
"toml>=0.10.2",
102101
"ipdb==0.13.9",
102+
{include-group = "docs"},
103+
]
104+
docs = [
105+
"docutils==0.20.1",
106+
# setuptools is needed for pkg_resources due to sphinxcontrib-redoc
107+
# See: https://github.com/sphinx-contrib/redoc/issues/47
108+
"setuptools",
103109
"sphinx==7.2.6",
104110
"sphinx_rtd_theme==2.0.0",
105111
"sphinxcontrib-openapi==0.8.3",
106112
"sphinxcontrib-redoc==1.6.0",
107-
"docutils==0.20.1"
108113
]
109114

110115
[project.scripts]

uv.lock

+18-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)