From b6cf0169d4baaee99c931b057b5e34bf63261706 Mon Sep 17 00:00:00 2001 From: Greg Back Date: Tue, 14 Jul 2015 13:58:01 -0500 Subject: [PATCH 1/2] Revert "Silently reject old arguments" This reverts commit 452aabe98bf9b25f87839481eaadea53d1b03493. --- setup.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/setup.py b/setup.py index d7bb2c3c..dbfeef34 100644 --- a/setup.py +++ b/setup.py @@ -13,15 +13,6 @@ 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 - - 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 From 0ad6290c19867a300a27e9a0dd9f74d411f103af Mon Sep 17 00:00:00 2001 From: Greg Back Date: Tue, 14 Jul 2015 13:58:39 -0500 Subject: [PATCH 2/2] 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, )