comparison setup.py @ 929:1a86e0af2ae1

Merge r1137 from py3k: add 2to3 build infrastructure to setup.py (this pulls the tests into the source distribution so that tests can be run after building with 2to3)
author hodgestar
date Fri, 18 Mar 2011 09:02:22 +0000
parents 89f4a6a31dbf
children
comparison
equal deleted inserted replaced
925:7dae2a055543 929:1a86e0af2ae1
39 class optional_build_ext(build_ext): 39 class optional_build_ext(build_ext):
40 # This class allows C extension building to fail. 40 # This class allows C extension building to fail.
41 def run(self): 41 def run(self):
42 try: 42 try:
43 build_ext.run(self) 43 build_ext.run(self)
44 except DistutilsPlatformError, e: 44 except DistutilsPlatformError:
45 _etype, e, _tb = sys.exc_info()
45 self._unavailable(e) 46 self._unavailable(e)
46 47
47 def build_extension(self, ext): 48 def build_extension(self, ext):
48 try: 49 try:
49 build_ext.build_extension(self, ext) 50 build_ext.build_extension(self, ext)
50 global _speedup_available 51 global _speedup_available
51 _speedup_available = True 52 _speedup_available = True
52 except CCompilerError, e: 53 except CCompilerError:
54 _etype, e, _tb = sys.exc_info()
53 self._unavailable(e) 55 self._unavailable(e)
54 56
55 def _unavailable(self, exc): 57 def _unavailable(self, exc):
56 print('*' * 70) 58 print('*' * 70)
57 print("""WARNING: 59 print("""WARNING:
84 'build_ext': optional_build_ext} 86 'build_ext': optional_build_ext}
85 if bdist_egg: 87 if bdist_egg:
86 cmdclass['bdist_egg'] = my_bdist_egg 88 cmdclass['bdist_egg'] = my_bdist_egg
87 89
88 90
91 # Use 2to3 if we're running under Python 3 (with Distribute)
92 extra = {}
93 if sys.version_info >= (3,):
94 extra['use_2to3'] = True
95 extra['convert_2to3_doctests'] = []
96 extra['use_2to3_fixers'] = ['fixes']
97 # include tests for python3 setup.py test
98 packages = [
99 'genshi', 'genshi.filters', 'genshi.template',
100 'genshi.tests', 'genshi.filters.tests',
101 'genshi.template.tests',
102 'genshi.template.tests.templates',
103 ]
104 # Install genshi template tests
105 extra['include_package_data'] = True
106 else:
107 packages = ['genshi', 'genshi.filters', 'genshi.template']
108
109
89 setup( 110 setup(
90 name = 'Genshi', 111 name = 'Genshi',
91 version = '0.7', 112 version = '0.7',
92 description = 'A toolkit for generation of output for the web', 113 description = 'A toolkit for generation of output for the web',
93 long_description = \ 114 long_description = \
106 'Environment :: Web Environment', 127 'Environment :: Web Environment',
107 'Intended Audience :: Developers', 128 'Intended Audience :: Developers',
108 'License :: OSI Approved :: BSD License', 129 'License :: OSI Approved :: BSD License',
109 'Operating System :: OS Independent', 130 'Operating System :: OS Independent',
110 'Programming Language :: Python', 131 'Programming Language :: Python',
132 'Programming Language :: Python :: 3',
111 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 133 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
112 'Topic :: Software Development :: Libraries :: Python Modules', 134 'Topic :: Software Development :: Libraries :: Python Modules',
113 'Topic :: Text Processing :: Markup :: HTML', 135 'Topic :: Text Processing :: Markup :: HTML',
114 'Topic :: Text Processing :: Markup :: XML' 136 'Topic :: Text Processing :: Markup :: XML'
115 ], 137 ],
116 keywords = ['python.templating.engines'], 138 keywords = ['python.templating.engines'],
117 packages = ['genshi', 'genshi.filters', 'genshi.template'], 139 packages = packages,
118 test_suite = 'genshi.tests.suite', 140 test_suite = 'genshi.tests.suite',
119 141
120 extras_require = { 142 extras_require = {
121 'i18n': ['Babel>=0.8'], 143 'i18n': ['Babel>=0.8'],
122 'plugin': ['setuptools>=0.6a2'] 144 'plugin': ['setuptools>=0.6a2']
130 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] 152 genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin]
131 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin] 153 genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin]
132 """, 154 """,
133 155
134 features = {'speedups': speedups}, 156 features = {'speedups': speedups},
135 cmdclass = cmdclass 157 cmdclass = cmdclass,
158
159 **extra
136 ) 160 )
Copyright (C) 2012-2017 Edgewall Software