From 0ad6290c19867a300a27e9a0dd9f74d411f103af Mon Sep 17 00:00:00 2001 From: Greg Back Date: Tue, 14 Jul 2015 13:58:39 -0500 Subject: [PATCH] Revert "Remove use of setuptools Feature. Fixes #23" This reverts commit b74cfd1f7ab5a82b2d0bf96f750998bc66324034. --- setup.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index dbfeef34..96d3d92d 100644 --- a/setup.py +++ b/setup.py @@ -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_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 @@ def echo(msg=''): 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, )