Skip to content

Commit 4326088

Browse files
committed
Swapped poetry for uv.
1 parent 598f116 commit 4326088

7 files changed

Lines changed: 744 additions & 977 deletions

File tree

‎api-docs/cppdocs/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile for C++ documentation
22

3-
PYTHON ?= poetry run python
3+
PYTHON ?= uv run --locked python
44

55
.PHONY: help
66
help:

‎api-docs/cppdocs/make.bat‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
set PYTHON=poetry run python
2+
set PYTHON=uv run --locked python
33

44
if "%1" == "help" (
55
echo Please use `make <target>` where <target> is one of
@@ -10,10 +10,11 @@ if "%1" == "help" (
1010
)
1111

1212
if "%1" == "clean" (
13-
rmdir /s /q html
14-
rmdir /s /q docset
15-
rmdir /s /q xml
16-
exit /b
13+
for %%d in (html docset xml) do (
14+
if exist "%%d" rmdir /s /q "%%d"
15+
if exist "%%d" exit /b 1
16+
)
17+
exit /b 0
1718
)
1819

1920
if "%1" == "html" (
@@ -28,4 +29,3 @@ if "%1" == "docset" (
2829

2930
echo Unknown target: %1
3031
exit /b 1
31-

‎api-docs/make.bat‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ if "%1" == "help" (
4848
)
4949

5050
if "%1" == "clean" (
51-
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
52-
del /q /s %BUILDDIR%\*
53-
goto end
51+
if exist "%BUILDDIR%" rmdir /q /s "%BUILDDIR%"
52+
if exist "%BUILDDIR%" exit /b 1
53+
exit /b 0
5454
)
5555

5656

‎docs/dev/documentation.md‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,42 @@ To contribute to the Binary Ninja documentation, first sign the [contribution li
66

77
## Prerequisites
88

9-
The Python documentation tools are managed with [poetry]. Building every documentation surface requires:
9+
The Python documentation tools are managed with [uv]. Building every documentation surface requires:
1010

11-
- Python 3.10 or newer and [poetry].
11+
- Python 3.10 or newer and [uv].
1212
- Doxygen 1.12 or newer available on `PATH` for the C++ API reference.
1313
- A matching Binary Ninja installation whose `binaryninja` Python module can be imported. The API revision must match the installation's `api_REVISION.txt`.
1414

15-
`poetry install` installs [zensical], [sphinx], and [breathe]. It does not install Doxygen or Binary Ninja.
15+
`uv sync --locked` installs [zensical], [sphinx], and [breathe]. It does not install Doxygen or Binary Ninja.
1616

1717
## Building
1818

1919
```bash
2020
git clone https://github.com/Vector35/binaryninja-api/
2121
cd binaryninja-api
22-
poetry install
23-
poetry run python scripts/zensical_build.py
22+
uv sync --locked
23+
uv run --locked python scripts/zensical_build.py
2424
echo User documentation available in site/
2525
cd api-docs
26-
poetry run make html
26+
uv run --locked make html
2727
echo Python API documentation available in build/html
2828
cd cppdocs
29-
poetry run make html
29+
uv run --locked make html
3030
echo C++ API documentation available in html/
3131
```
3232

33+
On Windows, use `uv run --locked cmd.exe /d /c .\make.bat html` in both
34+
`api-docs` and `api-docs/cppdocs` in place of `uv run --locked make html`.
35+
Use the same command with `clean` to remove the generated output.
36+
3337
`scripts/zensical_build.py` runs `zensical build` and then writes the redirect stubs described by `[project.plugins.redirects.redirect_maps]` in `zensical.toml`.
3438

3539
## Validating
3640

3741
Every build runs `zensical build --strict`, which fails on links to pages or anchors that do not exist. That covers internal references only. External URLs are checked separately by `scripts/check_links.py`, which requests every external URL in `docs/` and reports the file and line of any that fail:
3842

3943
```bash
40-
poetry run python scripts/check_links.py
44+
uv run --locked python scripts/check_links.py
4145
```
4246

4347
It is slow and depends on the network, so run it out of band rather than as part of a build. Sites that block automated requests are reported separately from broken links and do not affect the exit code unless `--strict` is passed.
@@ -46,11 +50,11 @@ It is slow and depends on the network, so run it out of band rather than as part
4650
Changing documentation for the API itself is fairly straightforward. Use [doxygen style comment blocks](https://www.doxygen.nl/manual/docblocks.html) in C++ and C, and [restructured text blocks](https://sphinx-tutorial.readthedocs.io/step-1/) for python for the source. The user documentation is located in the `docs/` folder and the API documentation is generated from the config in the `api-docs` folder.
4751

4852
!!! Tip "Tip"
49-
When updating user documentation, the `poetry run zensical serve` feature is particularly helpful for live previews.
53+
When updating user documentation, the `uv run --locked zensical serve` feature is particularly helpful for live previews.
5054

5155
[contribution license agreement]: https://binary.ninja/cla.pdf
5256
[Vector 35]: https://vector35.com/
53-
[poetry]: https://python-poetry.org/
57+
[uv]: https://docs.astral.sh/uv/
5458
[zensical]: https://zensical.org/
5559
[breathe]: https://github.com/michaeljones/breathe
5660
[sphinx]: https://www.sphinx-doc.org/en/master/

0 commit comments

Comments
 (0)