summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Back <gback@mitre.org>2015-07-14 13:58:39 -0500
committerGreg Back <gback@mitre.org>2015-07-14 13:58:39 -0500
commit0ad6290c19867a300a27e9a0dd9f74d411f103af (patch)
tree603d331238fc97bfc9dc21621a3030f7f6e8cebc
parentb6cf0169d4baaee99c931b057b5e34bf63261706 (diff)
downloadmarkupsafe-0ad6290c19867a300a27e9a0dd9f74d411f103af.tar.gz
Revert "Remove use of setuptools Feature. Fixes #23"
This reverts commit b74cfd1f7ab5a82b2d0bf96f750998bc66324034.
-rw-r--r--setup.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index dbfeef3..96d3d92 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_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,
)