In order to build in readthedocs, I need to install some requirements. One of these pip requirements needs cmake and swig to build.
Is it still possible to use readthedocs in this scenario?
Seems there is a filed issue about this already: https://github.com/rtfd/readthedocs.org/issues/2094
It contains a workaround:
For anyone else running into this it seems you can also hack around it using the 'READTHEDOCS' env var to conditionally modify
install_requires
in yoursetup.py
.
This points to:
When RTD builds your project, it sets the
READTHEDOCS
environment variable to the string True. So within your Sphinxconf.py
file, you can vary the behavior based on this. For example:
import os
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
html_theme = 'default'
else:
html_theme = 'nature'
OTOH, the last comment claims it should work fine with the current RTD version.