cupy-xarray icon indicating copy to clipboard operation
cupy-xarray copied to clipboard

add API to docs build

Open dcherian opened this issue 1 year ago • 5 comments

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)

dcherian avatar Jul 28 '22 19:07 dcherian

@keewis, @andersy005 Do either of you have an opinion on how to proceed?

dcherian avatar Jul 28 '22 19:07 dcherian

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

keewis avatar Jul 28 '22 19:07 keewis

actually, cupy is using RTD as well, so you might be able to copy their setup?

cc @jacobtomlinson

keewis avatar Jul 28 '22 19:07 keewis

@leofang do you have any quick advice on building sphinx docs for RTD for cupy without having to install everything?

jacobtomlinson avatar Jul 29 '22 16:07 jacobtomlinson

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

leofang avatar Jul 29 '22 17:07 leofang