Ticket #252: smarter_zip_safe.patch
| File smarter_zip_safe.patch, 1.8 KB (added by jonas, 15 years ago) |
|---|
-
setup.py
20 20 import os 21 21 try: 22 22 from setuptools import setup, Extension, Feature 23 from setuptools.command.bdist_egg import bdist_egg 23 24 except ImportError: 24 25 from distutils.core import setup, Extension 25 26 Feature = None 27 bdist_egg = None 26 28 import sys 27 29 28 30 sys.path.append(os.path.join('doc', 'common')) … … 31 33 except ImportError: 32 34 build_doc = test_doc = None 33 35 36 _speedup_available = True 34 37 35 38 class optional_build_ext(build_ext): 36 39 # This class allows C extension building to fail. … … 47 50 self._unavailable() 48 51 49 52 def _unavailable(self): 53 global _speedup_available 54 _speedup_available = False 50 55 print '*' * 70 51 56 print """WARNING: 52 57 An optional C extension could not be compiled, speedups will not be … … 65 70 else: 66 71 speedups = None 67 72 73 74 # Setuptools need some help figuring out if the egg is "zip_safe" or not 75 if bdist_egg: 76 class my_bdist_egg(bdist_egg): 77 def zip_safe(self): 78 return not _speedup_available and bdist_egg.zip_safe(self) 79 80 81 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc, 82 'build_ext': optional_build_ext} 83 if bdist_egg: 84 cmdclass['bdist_egg'] = my_bdist_egg 85 68 86 setup( 69 87 name = 'Genshi', 70 88 version = '0.6', … … 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', … … 112 129 """, 113 130 114 131 features = {'speedups': speedups}, 115 cmdclass = {'build_doc': build_doc, 'test_doc': test_doc, 116 'build_ext': optional_build_ext} 132 cmdclass = cmdclass 117 133 )
