Skip to content

Commit 27a467f

Browse files
committed
Update doc builds for uv
This fully ties the document building to uv by instructing the user to build a virtual environment with uv. This also allows us to remove the requirements.txt, as everything should run through the pyproject.toml.
1 parent b3f758e commit 27a467f

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

.readthedocs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ sphinx:
2020
# Optionally declare the Python requirements required to build your docs
2121
python:
2222
install:
23-
- requirements: doc/requirements.txt
23+
- method: pip
24+
path: .
25+
extra_requirements:
26+
- dev

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test: check
2020
bin/test.sh
2121

2222
docs:
23-
cd doc && $(MAKE) html
23+
uv run make -C doc html
2424

2525
dist: check clean
2626
uv run python -m build

doc/Development.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,23 @@ If you are testing a project that *uses* `pyimagej` and need to see how changes
2727

2828
## Building the reference documentation
2929

30-
PyImageJ documentation is built as a [Sphinx](https://www.sphinx-doc.org/en/master/)-built [ReadTheDocs](https://about.readthedocs.com/) site. The documentation has its own `Makefile` in the `/docs` directory. From there:
30+
PyImageJ documentation is built as a [Sphinx](https://www.sphinx-doc.org/en/master/)-built [ReadTheDocs](https://about.readthedocs.com/) site.
3131

32+
To build the documentation, **you must create a `uv` virtual environment** with the additional development dependencies:
33+
34+
```bash
35+
uv run pip install -e ".[dev]"
3236
```
37+
38+
Then, you can either use the documentation's own `Makefile` in the `/docs` directory:
39+
40+
```bash
3341
make html
3442
```
3543

36-
Alternatively, from the project root:
44+
Alternatively, from the project root `Makefile`:
3745

38-
```
46+
```bash
3947
make docs
4048
```
4149

@@ -45,18 +53,18 @@ Production documentation is available online at
4553

4654
## Running the automated tests
4755

48-
```
56+
```bash
4957
make test
5058
```
5159

5260
## Formatting the code
5361

54-
```
62+
```bash
5563
make lint
5664
```
5765

5866
## Building distribution bundles
5967

60-
```
68+
```bash
6169
make dist
6270
```

doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
66
SPHINXOPTS ?=
7-
SPHINXBUILD ?= sphinx-build
7+
SPHINXBUILD ?= uv run sphinx-build
88
SOURCEDIR = .
99
BUILDDIR = _build
1010

doc/requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ dev = [
5252
"pytest",
5353
"ruff",
5454
"sphinx",
55+
"sphinx-copybutton",
5556
"sphinx_rtd_theme",
57+
"readthedocs-sphinx-search",
5658
"validate-pyproject[all]",
5759
]
5860

0 commit comments

Comments
 (0)