Skip to content

Commit a4a882c

Browse files
committed
Docs: Migrate to UV
1 parent 587be0c commit a4a882c

File tree

6 files changed

+1272
-1601
lines changed

6 files changed

+1272
-1601
lines changed

.github/workflows/docs-pages.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ jobs:
2222
ref: ${{ github.event.repository.default_branch }}
2323
persist-credentials: false
2424
fetch-depth: 0
25-
- name: Set up Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: '3.10'
2925

30-
- name: Set up env
31-
run: make -C docs setupenv
26+
- name: Install doxygen
27+
run: sudo apt-get update && sudo apt-get install -y doxygen
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v7
31+
with:
32+
enable-cache: true
33+
cache-dependency-glob: "docs/uv.lock"
3234

3335
- name: Build docs
3436
run: make -C docs multiversion

.github/workflows/docs-pr.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ jobs:
2121
persist-credentials: false
2222
fetch-depth: 0
2323

24-
- name: Set up Python
25-
uses: actions/setup-python@v5
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v7
2626
with:
27-
python-version: '3.10'
27+
working-directory: docs
28+
enable-cache: true
2829

29-
- name: Set up env
30-
run: make -C docs setupenv
30+
- name: Install doxygen
31+
run: sudo apt-get update && sudo apt-get install -y doxygen
3132

3233
- name: Build docs
3334
run: make -C docs test

docs/Makefile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Global variables
22
# You can set these variables from the command line.
3-
POETRY = poetry
3+
UV = uv
44
SPHINXOPTS = -j auto
5-
SPHINXBUILD = $(POETRY) run sphinx-build
5+
SPHINXBUILD = $(UV) run --frozen sphinx-build
66
PAPER =
77
BUILDDIR = _build
88
SOURCEDIR = source
@@ -17,20 +17,14 @@ TESTSPHINXOPTS = $(ALLSPHINXOPTS) -W --keep-going
1717
all: dirhtml
1818

1919
# Setup commands
20-
.PHONY: setupenv
21-
setupenv:
22-
pip install -q poetry
23-
sudo apt-get install doxygen
24-
2520
.PHONY: setup
2621
setup:
27-
$(POETRY) install
28-
$(POETRY) update
22+
$(UV) sync
2923
cd .. && doxygen Doxyfile.in
3024

3125
.PHONY: update
3226
update:
33-
$(POETRY) update
27+
$(UV) lock --upgrade
3428

3529
# Clean commands
3630
.PHONY: pristine
@@ -68,24 +62,24 @@ epub3: setup
6862

6963
.PHONY: multiversion
7064
multiversion: setup
71-
$(POETRY) run sphinx-multiversion source $(BUILDDIR)/dirhtml
65+
$(UV) run --frozen sphinx-multiversion source $(BUILDDIR)/dirhtml
7266
@echo
7367
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
7468

7569
.PHONY: redirects
7670
redirects: setup
77-
$(POETRY) run redirects-cli fromfile --yaml-file _utils/redirects.yaml --output-dir $(BUILDDIR)/dirhtml
71+
$(UV) run --frozen redirects-cli fromfile --yaml-file _utils/redirects.yaml --output-dir $(BUILDDIR)/dirhtml
7872
@echo
7973
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
8074

8175
# Preview commands
8276
.PHONY: preview
8377
preview: setup
84-
$(POETRY) run sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500 --ignore "*/source/api/*"
78+
$(UV) run --frozen sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500 --ignore "*/source/api/*"
8579

8680
.PHONY: multiversionpreview
8781
multiversionpreview: multiversion
88-
$(POETRY) run python -m http.server 5500 --directory $(BUILDDIR)/dirhtml
82+
$(UV) run --frozen python -m http.server 5500 --directory $(BUILDDIR)/dirhtml
8983

9084
# Test commands
9185
.PHONY: test

0 commit comments

Comments
 (0)