Ticket #165: genshi.diff
| File genshi.diff, 3.8 KB (added by njriley+genshi.edgewall.org@…, 16 years ago) |
|---|
-
setup.py
14 14 15 15 from distutils.cmd import Command 16 16 from distutils.command.build_ext import build_ext 17 from distutils.errors import CCompilerError, Distutils PlatformError17 from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError 18 18 import doctest 19 19 from glob import glob 20 20 import os … … 22 22 from setuptools import setup, Extension, Feature 23 23 except ImportError: 24 24 from distutils.core import setup, Extension 25 Feature = None 25 extra = {} 26 else: 27 speedups = Feature( 28 "optionial C speed-enhancements", 29 standard = True, 30 ext_modules = [ 31 Extension('genshi._speedups', ['genshi/_speedups.c']), 32 ], 33 ) 34 35 extra = dict( 36 zip_safe = True, 37 extras_require = { 38 'i18n': ['Babel>=0.8'], 39 'plugin': ['setuptools>=0.6a2'] 40 }, 41 entry_points = """ 42 [babel.extractors] 43 genshi = genshi.filters.i18n:extract[i18n] 44 45 [python.templating.engines] 46 genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] 47 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] 48 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin] 49 """, 50 test_suite = 'genshi.tests.suite', 51 features = {'speedups': speedups} 52 ) 26 53 import sys 27 54 28 55 sys.path.append(os.path.join('doc', 'common')) … … 37 64 def run(self): 38 65 try: 39 66 build_ext.run(self) 40 except DistutilsPlatformError :41 self._unavailable( )67 except DistutilsPlatformError, e: 68 self._unavailable(e) 42 69 43 70 def build_extension(self, ext): 44 71 try: 45 72 build_ext.build_extension(self, ext) 46 except CCompilerError, x:47 self._unavailable( )73 except (CCompilerError, DistutilsExecError), e: 74 self._unavailable(e) 48 75 49 def _unavailable(self ):50 print '*' * 7051 print """WARNING:76 def _unavailable(self, e): 77 print >> sys.stderr, '*' * 80 78 print >> sys.stderr, """WARNING: 52 79 An optional C extension could not be compiled, speedups will not be 53 80 available.""" 54 print '*' * 70 81 print >> sys.stderr 82 print >> sys.stderr, e 83 print >> sys.stderr, '*' * 80 55 84 56 85 57 if Feature:58 speedups = Feature(59 "optionial C speed-enhancements",60 standard = True,61 ext_modules = [62 Extension('genshi._speedups', ['genshi/_speedups.c']),63 ],64 )65 else:66 speedups = None67 68 86 setup( 69 87 name = 'Genshi', 70 88 version = '0.5', … … 79 97 license = 'BSD', 80 98 url = 'http://genshi.edgewall.org/', 81 99 download_url = 'http://genshi.edgewall.org/wiki/Download', 82 zip_safe = True,83 100 84 101 classifiers = [ 85 102 'Development Status :: 4 - Beta', … … 95 112 ], 96 113 keywords = ['python.templating.engines'], 97 114 packages = ['genshi', 'genshi.filters', 'genshi.template'], 98 test_suite = 'genshi.tests.suite',99 115 100 extras_require = {101 'i18n': ['Babel>=0.8'],102 'plugin': ['setuptools>=0.6a2']103 },104 entry_points = """105 [babel.extractors]106 genshi = genshi.filters.i18n:extract[i18n]107 108 [python.templating.engines]109 genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]110 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]111 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin]112 """,113 114 features = {'speedups': speedups},115 116 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc, 116 'build_ext': optional_build_ext} 117 'build_ext': optional_build_ext}, 118 **extra 117 119 )
