setup: remove cython extensions and build io for proper docs

This commit is contained in:
Adam Holmberg
2015-10-21 14:19:38 -05:00
parent 8a52b87685
commit 915dc94b7c

View File

@@ -104,6 +104,23 @@ class DocCommand(Command):
pass
if has_subprocess:
# Prevent run with in-place extensions because cython-generated objects do not carry docstrings
# http://docs.cython.org/src/userguide/special_methods.html#docstrings
import glob
for f in glob.glob("cassandra/*.so"):
print("Removing '%s' to allow docs to run on pure python modules." %(f,))
os.unlink(f)
# Build murmur and io extensions to make import and docstrings work
try:
output = subprocess.check_output(
["python", "setup.py", "build_ext", "--inplace", "--force", "--no-murmur3", "--no-cython"],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as exc:
raise RuntimeError("Documentation step '%s' failed: %s: %s" % ("build_ext", exc, exc.output))
else:
print(output)
try:
output = subprocess.check_output(
["sphinx-build", "-b", mode, "docs", path],