Skip to content

Commit

Permalink
Revert "Remove use of setuptools Feature. Fixes #23"
Browse files Browse the repository at this point in the history
This reverts commit b74cfd1.
  • Loading branch information
gtback committed Jul 14, 2015
1 parent b6cf016 commit 0ad6290
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 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,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
Expand Down Expand Up @@ -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',
Expand All @@ -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,
)


Expand Down

0 comments on commit 0ad6290

Please sign in to comment.