gecko/python/simplejson-2.1.1/setup.py
Gregory Szorc 944423d6ec Bug 777068 - Move simplejson to python/; r=glandium
--HG--
rename : other-licenses/simplejson-2.1.1/CHANGES.txt => python/simplejson-2.1.1/CHANGES.txt
rename : other-licenses/simplejson-2.1.1/LICENSE.txt => python/simplejson-2.1.1/LICENSE.txt
rename : other-licenses/simplejson-2.1.1/PKG-INFO => python/simplejson-2.1.1/PKG-INFO
rename : other-licenses/simplejson-2.1.1/conf.py => python/simplejson-2.1.1/conf.py
rename : other-licenses/simplejson-2.1.1/docs/_sources/index.txt => python/simplejson-2.1.1/docs/_sources/index.txt
rename : other-licenses/simplejson-2.1.1/docs/_static/contents.png => python/simplejson-2.1.1/docs/_static/contents.png
rename : other-licenses/simplejson-2.1.1/docs/_static/default.css => python/simplejson-2.1.1/docs/_static/default.css
rename : other-licenses/simplejson-2.1.1/docs/_static/doctools.js => python/simplejson-2.1.1/docs/_static/doctools.js
rename : other-licenses/simplejson-2.1.1/docs/_static/file.png => python/simplejson-2.1.1/docs/_static/file.png
rename : other-licenses/simplejson-2.1.1/docs/_static/interface.js => python/simplejson-2.1.1/docs/_static/interface.js
rename : other-licenses/simplejson-2.1.1/docs/_static/jquery.js => python/simplejson-2.1.1/docs/_static/jquery.js
rename : other-licenses/simplejson-2.1.1/docs/_static/minus.png => python/simplejson-2.1.1/docs/_static/minus.png
rename : other-licenses/simplejson-2.1.1/docs/_static/navigation.png => python/simplejson-2.1.1/docs/_static/navigation.png
rename : other-licenses/simplejson-2.1.1/docs/_static/plus.png => python/simplejson-2.1.1/docs/_static/plus.png
rename : other-licenses/simplejson-2.1.1/docs/_static/pygments.css => python/simplejson-2.1.1/docs/_static/pygments.css
rename : other-licenses/simplejson-2.1.1/docs/_static/rightsidebar.css => python/simplejson-2.1.1/docs/_static/rightsidebar.css
rename : other-licenses/simplejson-2.1.1/docs/_static/searchtools.js => python/simplejson-2.1.1/docs/_static/searchtools.js
rename : other-licenses/simplejson-2.1.1/docs/_static/sphinxdoc.css => python/simplejson-2.1.1/docs/_static/sphinxdoc.css
rename : other-licenses/simplejson-2.1.1/docs/_static/stickysidebar.css => python/simplejson-2.1.1/docs/_static/stickysidebar.css
rename : other-licenses/simplejson-2.1.1/docs/_static/traditional.css => python/simplejson-2.1.1/docs/_static/traditional.css
rename : other-licenses/simplejson-2.1.1/docs/genindex.html => python/simplejson-2.1.1/docs/genindex.html
rename : other-licenses/simplejson-2.1.1/docs/index.html => python/simplejson-2.1.1/docs/index.html
rename : other-licenses/simplejson-2.1.1/docs/objects.inv => python/simplejson-2.1.1/docs/objects.inv
rename : other-licenses/simplejson-2.1.1/docs/search.html => python/simplejson-2.1.1/docs/search.html
rename : other-licenses/simplejson-2.1.1/docs/searchindex.js => python/simplejson-2.1.1/docs/searchindex.js
rename : other-licenses/simplejson-2.1.1/docs/searchindex.json => python/simplejson-2.1.1/docs/searchindex.json
rename : other-licenses/simplejson-2.1.1/ez_setup.py => python/simplejson-2.1.1/ez_setup.py
rename : other-licenses/simplejson-2.1.1/index.rst => python/simplejson-2.1.1/index.rst
rename : other-licenses/simplejson-2.1.1/scripts/make_docs.py => python/simplejson-2.1.1/scripts/make_docs.py
rename : other-licenses/simplejson-2.1.1/setup.cfg => python/simplejson-2.1.1/setup.cfg
rename : other-licenses/simplejson-2.1.1/setup.py => python/simplejson-2.1.1/setup.py
rename : other-licenses/simplejson-2.1.1/simplejson/__init__.py => python/simplejson-2.1.1/simplejson/__init__.py
rename : other-licenses/simplejson-2.1.1/simplejson/_speedups.c => python/simplejson-2.1.1/simplejson/_speedups.c
rename : other-licenses/simplejson-2.1.1/simplejson/decoder.py => python/simplejson-2.1.1/simplejson/decoder.py
rename : other-licenses/simplejson-2.1.1/simplejson/encoder.py => python/simplejson-2.1.1/simplejson/encoder.py
rename : other-licenses/simplejson-2.1.1/simplejson/ordered_dict.py => python/simplejson-2.1.1/simplejson/ordered_dict.py
rename : other-licenses/simplejson-2.1.1/simplejson/scanner.py => python/simplejson-2.1.1/simplejson/scanner.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/__init__.py => python/simplejson-2.1.1/simplejson/tests/__init__.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_check_circular.py => python/simplejson-2.1.1/simplejson/tests/test_check_circular.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_decimal.py => python/simplejson-2.1.1/simplejson/tests/test_decimal.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_decode.py => python/simplejson-2.1.1/simplejson/tests/test_decode.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_default.py => python/simplejson-2.1.1/simplejson/tests/test_default.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_dump.py => python/simplejson-2.1.1/simplejson/tests/test_dump.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_encode_basestring_ascii.py => python/simplejson-2.1.1/simplejson/tests/test_encode_basestring_ascii.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_encode_for_html.py => python/simplejson-2.1.1/simplejson/tests/test_encode_for_html.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_fail.py => python/simplejson-2.1.1/simplejson/tests/test_fail.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_float.py => python/simplejson-2.1.1/simplejson/tests/test_float.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_indent.py => python/simplejson-2.1.1/simplejson/tests/test_indent.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_pass1.py => python/simplejson-2.1.1/simplejson/tests/test_pass1.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_pass2.py => python/simplejson-2.1.1/simplejson/tests/test_pass2.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_pass3.py => python/simplejson-2.1.1/simplejson/tests/test_pass3.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_recursion.py => python/simplejson-2.1.1/simplejson/tests/test_recursion.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_scanstring.py => python/simplejson-2.1.1/simplejson/tests/test_scanstring.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_separators.py => python/simplejson-2.1.1/simplejson/tests/test_separators.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_speedups.py => python/simplejson-2.1.1/simplejson/tests/test_speedups.py
rename : other-licenses/simplejson-2.1.1/simplejson/tests/test_unicode.py => python/simplejson-2.1.1/simplejson/tests/test_unicode.py
rename : other-licenses/simplejson-2.1.1/simplejson/tool.py => python/simplejson-2.1.1/simplejson/tool.py
2012-07-26 13:07:28 -07:00

118 lines
3.4 KiB
Python

#!/usr/bin/env python
import sys
try:
import setuptools
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages, Extension, Feature
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError
VERSION = '2.1.1'
DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python"
LONG_DESCRIPTION = """
simplejson is a simple, fast, complete, correct and extensible
JSON <http://json.org> encoder and decoder for Python 2.5+. It is
pure Python code with no dependencies, but includes an optional C
extension for a serious speed boost.
simplejson is the externally maintained development version of the
json library included with Python 2.6 and Python 3.0, but maintains
backwards compatibility with Python 2.5.
The encoder may be subclassed to provide serialization in any kind of
situation, without any special support by the objects to be serialized
(somewhat like pickle).
The decoder can handle incoming JSON strings of any specified encoding
(UTF-8 by default).
"""
CLASSIFIERS = filter(None, map(str.strip,
"""
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Topic :: Software Development :: Libraries :: Python Modules
""".splitlines()))
speedups = Feature(
"optional C speed-enhancement module",
standard=True,
ext_modules = [
Extension("simplejson._speedups", ["simplejson/_speedups.c"]),
],
)
if sys.platform == 'win32' and sys.version_info > (2, 6):
# 2.6's distutils.msvc9compiler can raise an IOError when failing to
# find the compiler
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError,
IOError)
else:
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
class BuildFailed(Exception):
pass
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:
raise BuildFailed()
def build_extension(self, ext):
try:
build_ext.build_extension(self, ext)
except ext_errors, x:
raise BuildFailed()
def run_setup(with_binary):
if with_binary:
features = {'speedups': speedups}
else:
features = {}
setup(
name="simplejson",
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
classifiers=CLASSIFIERS,
author="Bob Ippolito",
author_email="bob@redivi.com",
url="http://undefined.org/python/#simplejson",
license="MIT License",
packages=find_packages(exclude=['ez_setup']),
platforms=['any'],
test_suite="simplejson.tests.all_tests_suite",
zip_safe=True,
features=features,
cmdclass={'build_ext': ve_build_ext},
)
try:
run_setup(False)
except BuildFailed:
BUILD_EXT_WARNING = "WARNING: The C extension could not be compiled, speedups are not enabled."
print '*' * 75
print BUILD_EXT_WARNING
print "Failure information, if any, is above."
print "I'm retrying the build without the C extension now."
print '*' * 75
run_setup(False)
print '*' * 75
print BUILD_EXT_WARNING
print "Plain-Python installation succeeded."
print '*' * 75