[Python] How should I install CUDA dependencies in readthedocs build with apidoc autodoc

Discussão em 'Python' iniciado por Stack, Setembro 4, 2025.

  1. Stack

    Stack Membro Participativo

    I have a python project which uses readthedocs and its apidoc/autodoc to build API documents automatically. The project uses a third-party tool that can only be installed from source like this: pip install git+https://github.com/xxx/yyy.git (no published prebuilt wheel). Furthermore, the third-party tool needs CUDA compilation. This causes a problem for building my documentation on readthedocs because readthedocs does not have a CUDA environment on its server.

    Problems I've encountered so far:


    1. If I don't list the third-party tool in requirements.txt for readthedocs, then apidoc would throw module not found error when building the documentation. And as a result, all relevent APIs won't appear in the doc.


    2. If I add pip install git+https://github.com/xxx/yyy.git to build.jobs.install in .readthedocs.yaml, readthedocs would complain it does not have a CUDA compiler.

    Questions:


    1. How can I successfully install the CUDA-based dependency?


    2. If not, can I tell readthedocs or apidoc to ignore those import errors?


    3. Even if I were able to install yyy, it normally takes ~45min to compile. Is there anyway to use a prebuilt mirror instead of rebuilding it every time?

    Continue reading...

Compartilhe esta Página