Hi there,
I'm working on a Python module (simplejson) that comes with a C extension that
can optionally speed up some of its operations. It is however ok for this
extension to fail to build, in which case the module will use Python
fallbacks.
How can I allow for this failure? Bob Ippolito, the original author, has this
implemented as follows:
8< ------------------------------------------------------
class ve_build_ext(build_ext):
# This class allows C extension building to fail.
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError, x:
self._unavailable(x)
def build_extension(self, ext):
try:
build_ext.build_extension(self, ext)
except (CCompilerError, DistutilsExecError), x:
self._unavailable(x)
def _unavailable(self, exc):
print '*'*70
print BUILD_EXT_WARNING
print exc
print '*'*70
...
setup(cmdclass={'build_ext': ve_build_ext},)
8< ------------------------------------------------------
On current setuptools, this fails with
** error: Setup script exited with error: can't
copy 'simplejson.egg-info\native_libs.txt': doesn't exist or not a regular
file
How can I fix this?
Andreas