Skip to content

Commit f941ffd

Browse files
Update readthedocs config to use UV (#356)
1 parent 0cbbf04 commit f941ffd

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.readthedocs.yaml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
1+
# .readthedocs.yaml
12
# Read the Docs configuration file
23
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
34

4-
# Required
55
version: 2
66

7-
# Set the OS, Python version, and other tools you might need
87
build:
98
os: ubuntu-24.04
109
tools:
1110
python: "3.11"
11+
1212
jobs:
13-
post_create_environment:
14-
# Install poetry
15-
- python -m pip install poetry==1.8.3
16-
post_install:
17-
# Install dependencies
18-
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
13+
# 1️⃣ Install uv once before we create the virtual-env
14+
pre_create_environment:
15+
- |
16+
# Install uv via the official installer with curl
17+
curl -Ls https://astral.sh/uv/install.sh | bash
18+
19+
# 2️⃣ Create the virtual-env with uv
20+
create_environment:
21+
- ~/.local/bin/uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
22+
23+
# 3️⃣ Sync docs dependencies (uses uv.lock if present)
24+
install:
25+
- |
26+
UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" \
27+
~/.local/bin/uv sync --frozen --group docs
1928
2029
# Build documentation in the "docs/" directory with Sphinx
2130
sphinx:
22-
configuration: docs/conf.py
31+
configuration: docs/conf.py
2332

2433
formats:
2534
- pdf

0 commit comments

Comments
 (0)