Skip to content

Commit

Permalink
Merge pull request #43 from gtback/restore-speedups-feature
Browse files Browse the repository at this point in the history
Restore speedups feature
  • Loading branch information
mitsuhiko committed Jan 13, 2016
2 parents 3daebaa + 0ad6290 commit d2001bb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,14 +13,13 @@
is_pypy = hasattr(sys, 'pypy_version_info')


# Remove old arguments that were once supported. Thanks setuptools
# 3.0 for just randomly removing functionality.
for arg in '--with-speedups', '--without-speedups':
try:
sys.argv.remove(arg)
except ValueError:
pass

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):
Expand Down Expand Up @@ -62,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',
Expand All @@ -90,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,
)


Expand Down

0 comments on commit d2001bb

Please sign in to comment.