diff options
author | Greg Back <gback@mitre.org> | 2015-07-14 13:58:39 -0500 |
---|---|---|
committer | Greg Back <gback@mitre.org> | 2015-07-14 13:58:39 -0500 |
commit | 0ad6290c19867a300a27e9a0dd9f74d411f103af (patch) | |
tree | 603d331238fc97bfc9dc21621a3030f7f6e8cebc | |
parent | b6cf0169d4baaee99c931b057b5e34bf63261706 (diff) | |
download | markupsafe-0ad6290c19867a300a27e9a0dd9f74d411f103af.tar.gz |
Revert "Remove use of setuptools Feature. Fixes #23"
This reverts commit b74cfd1f7ab5a82b2d0bf96f750998bc66324034.
-rw-r--r-- | setup.py | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -1,6 +1,6 @@ import os import sys -from setuptools import setup, Extension +from setuptools import setup, Extension, Feature from distutils.command.build_ext import build_ext from distutils.errors import CCompilerError, DistutilsExecError, \ DistutilsPlatformError @@ -13,6 +13,14 @@ is_jython = 'java' in sys.platform is_pypy = hasattr(sys, 'pypy_version_info') +speedups = Feature( + 'optional C speed-enhancement module', + standard=True, + ext_modules = [ + Extension('markupsafe._speedups', ['markupsafe/_speedups.c']), + ], +) + ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError) if sys.platform == 'win32' and sys.version_info > (2, 6): # 2.6's distutils.msvc9compiler can raise an IOError when failing to @@ -53,8 +61,9 @@ readme = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() def run_setup(with_binary): - ext = Extension('markupsafe._speedups', ['markupsafe/_speedups.c']) - ext_modules = [ext] if with_binary else [] + features = {} + if with_binary: + features['speedups'] = speedups setup( name='MarkupSafe', version='0.23', @@ -81,7 +90,7 @@ def run_setup(with_binary): test_suite='markupsafe.tests.suite', include_package_data=True, cmdclass={'build_ext': ve_build_ext}, - ext_modules=ext_modules, + features=features, ) |