summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2007-03-24 21:35:29 +0000
committerBob Ippolito <bob@redivi.com>2007-03-24 21:35:29 +0000
commit9ec6701b19648f9e5c570d7be213f2c844a2400f (patch)
tree191da21e20f9422cce9b0692820d022d76e324f1
parentdd8279f6faa3a3bb21944d245417cb6dbe00dd90 (diff)
downloadsimplejson-9ec6701b19648f9e5c570d7be213f2c844a2400f.tar.gz
tweak build_ext to not fail
git-svn-id: http://simplejson.googlecode.com/svn/trunk@50 a4795897-2c25-0410-b006-0d3caba88fa1
-rw-r--r--setup.py22
-rw-r--r--simplejson/__init__.py2
2 files changed, 22 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 4a8d7b5..83d160c 100644
--- a/setup.py
+++ b/setup.py
@@ -4,8 +4,10 @@ import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages, Extension, Feature
+from distutils.command.build_ext import build_ext
+from distutils.errors import CCompilerError
-VERSION = '1.7'
+VERSION = '1.7.1'
DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python"
LONG_DESCRIPTION = """
simplejson is a simple, fast, complete, correct and extensible
@@ -32,6 +34,23 @@ Programming Language :: Python
Topic :: Software Development :: Libraries :: Python Modules
""".splitlines()))
+
+BUILD_EXT_WARNING="""
+WARNING: The C extension could not be compiled, speedups are not enabled.
+
+Above is the output showing how the compilation failed.
+"""
+
+class ve_build_ext(build_ext):
+ # This class allows C extension building to fail.
+ def build_extension(self, ext):
+ try:
+ build_ext.build_extension(self, ext)
+ except CCompilerError, x:
+ print ('*'*70+'\n')
+ print BUILD_EXT_WARNING
+ print ('*'*70+'\n')
+
speedups = Feature(
"options C speed-enhancement modules",
standard=True,
@@ -58,4 +77,5 @@ setup(
'paste.filter_app_factory': ['json = simplejson.jsonfilter:factory'],
},
features={'speedups': speedups},
+ cmdclass={'build_ext': ve_build_ext},
)
diff --git a/simplejson/__init__.py b/simplejson/__init__.py
index 6e9e2fd..0d6f58c 100644
--- a/simplejson/__init__.py
+++ b/simplejson/__init__.py
@@ -86,7 +86,7 @@ Extending JSONEncoder::
Note that the JSON produced by this module's default settings
is a subset of YAML, so it may be used as a serializer for that as well.
"""
-__version__ = '1.7'
+__version__ = '1.7.1'
__all__ = [
'dump', 'dumps', 'load', 'loads',
'JSONDecoder', 'JSONEncoder',