def run(self):
if not has_system_lib():
raise DistutilsError(
"This library is not usable in 'develop' mode when using the "
'bundled libsecp256k1. See README for details.')
_develop.run(self)
python类run()的实例源码
def run(self):
try:
self._setup_extensions()
build_ext.run(self)
except DistutilsPlatformError as exc:
sys.stderr.write('%s\n' % str(exc))
warnings.warn(self.error_message % "C extensions.")
def run(self):
try:
build_ext.run(self)
except Exception:
e = sys.exc_info()[1]
sys.stdout.write('%s\n' % str(e))
warnings.warn(self.warning_message % ("Extension modules",
"There was an issue with "
"your platform configuration"
" - see above."))
def run(self):
if self.test:
path = "docs/_build/doctest"
mode = "doctest"
else:
path = "docs/_build/%s" % __version__
mode = "html"
try:
os.makedirs(path)
except:
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 io extension 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],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as exc:
raise RuntimeError("Documentation step '%s' failed: %s: %s" % (mode, exc, exc.output))
else:
print(output)
print("")
print("Documentation step '%s' performed, results here:" % mode)
print(" file://%s/%s/index.html" % (os.path.dirname(os.path.realpath(__file__)), path))
def run(self):
if self.test:
path = "docs/_build/doctest"
mode = "doctest"
else:
path = "docs/_build/%s" % __version__
mode = "html"
try:
os.makedirs(path)
except:
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("dse/*.so"):
print("Removing '%s' to allow docs to run on pure python modules." %(f,))
os.unlink(f)
# Build io extension 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],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as exc:
raise RuntimeError("Documentation step '%s' failed: %s: %s" % (mode, exc, exc.output))
else:
print(output)
print("")
print("Documentation step '%s' performed, results here:" % mode)
print(" file://%s/%s/index.html" % (os.path.dirname(os.path.realpath(__file__)), path))