cupy-xarray
cupy-xarray copied to clipboard
add API to docs build
autodoc/autosummary import the package to automatically add the docstrings.
This means cupy-xarray and cupy are imported. importing cupy fails on RTD saying it can't find libcuda.
It'd be nice to find a workaround.
Worst case, I guess we can run autodoc locally and then push the generated html?
(note that installing cuda brings in cudatoolkit which is a 800MB download; it'd be nice to just not do that)
@keewis, @andersy005 Do either of you have an opinion on how to proceed?
RTD recommends mocking libraries that you can't install easily, maybe that's worth investigating?
Edit: you might also be able to apt
-install it, not sure
actually, cupy
is using RTD as well, so you might be able to copy their setup?
cc @jacobtomlinson
@leofang do you have any quick advice on building sphinx docs for RTD for cupy without having to install everything?
I see. I'd suggest to build a "NO CUDA" CuPy in your RTD env, and then import cupy
. They tailored this option specifically for RTD to use it to generate docs. See https://github.com/cupy/cupy/blob/9d439227f1a53bbd9ebb16784e40bcce44bc8042/.github/workflows/pretest.yml#L37-L41
Looks like CuPy 13 now supports lazy import (https://github.com/cupy/cupy/issues/7620), and there is a cupy-core
package on conda-forge
that doesn't require CUDA (https://github.com/conda-forge/cupy-feedstock/issues/229#issuecomment-1905162534)! I've opened a PR at #44 to render the API docs.