Build the documentation from gallery/ and docs/. By default this builds only the Python docs without any tutorials. arguments: full -- Build all language docs, not just Python (cannot be used with --cpu) cpu -- Use the 'ci_cpu' Docker image (useful for building docs on a machin
(
tutorial_pattern: str | None = None,
cpu: bool = False,
full: bool = False,
interactive: bool = False,
skip_build: bool = False,
docker_image: str | None = None,
)
| 232 | |
| 233 | |
| 234 | def docs( |
| 235 | tutorial_pattern: str | None = None, |
| 236 | cpu: bool = False, |
| 237 | full: bool = False, |
| 238 | interactive: bool = False, |
| 239 | skip_build: bool = False, |
| 240 | docker_image: str | None = None, |
| 241 | ) -> None: |
| 242 | """ |
| 243 | Build the documentation from gallery/ and docs/. By default this builds only |
| 244 | the Python docs without any tutorials. |
| 245 | |
| 246 | arguments: |
| 247 | full -- Build all language docs, not just Python (cannot be used with --cpu) |
| 248 | cpu -- Use the 'ci_cpu' Docker image (useful for building docs on a machine without a GPU) |
| 249 | tutorial-pattern -- Regex for which tutorials to execute when building docs (cannot be used with --cpu) |
| 250 | skip_build -- skip build and setup scripts |
| 251 | interactive -- start a shell after running build / test scripts |
| 252 | docker-image -- manually specify the docker image to use |
| 253 | """ |
| 254 | build_dir = get_build_dir("gpu") |
| 255 | |
| 256 | extra_setup = [] |
| 257 | image = "ci_gpu" if docker_image is None else docker_image |
| 258 | if cpu: |
| 259 | # TODO: Change this to tlcpack/docs once that is uploaded |
| 260 | image = "ci_cpu" if docker_image is None else docker_image |
| 261 | build_dir = get_build_dir("cpu") |
| 262 | config_script = " && ".join( |
| 263 | [ |
| 264 | f"mkdir -p {build_dir}", |
| 265 | f"pushd {build_dir}", |
| 266 | "cp ../cmake/config.cmake .", |
| 267 | "popd", |
| 268 | ] |
| 269 | ) |
| 270 | |
| 271 | # These are taken from the ci-gpu image via pip freeze, consult that |
| 272 | # if there are any changes: https://github.com/apache/tvm/tree/main/docs#native |
| 273 | requirements = [ |
| 274 | "Sphinx==4.2.0", |
| 275 | "tlcpack-sphinx-addon==0.2.1", |
| 276 | "image==1.5.33", |
| 277 | # Temporary git link until a release is published |
| 278 | "git+https://github.com/sphinx-gallery/sphinx-gallery.git@6142f1791151849b5bec4bf3959f75697ba226cd", |
| 279 | "sphinx-rtd-theme==1.0.0", |
| 280 | "matplotlib==3.3.4", |
| 281 | "commonmark==0.9.1", |
| 282 | "Pillow==8.3.2", |
| 283 | "autodocsumm==0.2.7", |
| 284 | "docutils==0.16", |
| 285 | ] |
| 286 | |
| 287 | extra_setup = [ |
| 288 | "uv pip install " + " ".join(requirements), |
| 289 | ] |
| 290 | else: |
| 291 | check_gpu() |
nothing calls this directly
no test coverage detected
searching dependent graphs…