pybind/rados: use stub implementations when building document
* setup.py: inject "BUILD_DOC" into cython build context if "BUILD_DOC"
env variable is set, this helps us to do conditional compilation.
for instance, if we are building document, there is no need to
use the header files or link against librados.so for building
the python bindings.
* mock_rados.pxi: implement the mock functinons for their C counterparts
in librados, so we can use them when building librados python
binding for creating the document. Sphinx's autodoc extension
reads annotation of the python package whose document is being
built, after importing the python package into python runtime.
but since we use Cython for creating our python binding,
we have to provide the implementation of those referenced
librados C API symbols. mock_rados.pxi implements them using Cython.
the downside of this solution is that we need to mirror every
function used by the Python binding by repeating them in both
c_rados.pxd and mock_rados.pxi. the same will apply to other
Ceph python bindings as long as they use C APIs not offered by
libc or python runtime. so next step is to develop a simple
parser which can be run at build time to create mock_*.pxi from
c_*.pxd.
* rados.pyx: use mock_rados.pxi if BUILD_DOC, otherwise use
c_rados.pyd. the latter requires a librados.so at runtime.