1 # -*- coding: utf-8 -*-
6 ez_setup.use_setuptools()
8 from distutils.command.build_ext import build_ext
9 from distutils.errors import CCompilerError, DistutilsError
10 from setuptools import setup, Extension, Feature
11 from inspect import getdoc
15 for fn in os.listdir(path):
16 if fn.startswith('.'):
18 fn = os.path.join(path, fn)
19 if os.path.isfile(fn):
23 class optional_build_ext(build_ext):
28 except DistutilsError, e:
32 def build_extension(self, ext):
34 if self.compiler is None:
35 raise self._setup_error
36 build_ext.build_extension(self, ext)
37 except CCompilerError, e:
40 print ' the speedup extension could not be compiled, Jinja will'
41 print ' fall back to the native python classes.'
47 print ' could not compile optional speedup extension. This is'
48 print ' is not a real problem because Jinja provides a native'
49 print ' implementation of those classes but for best performance'
50 print ' you could try to reinstall Jinja after fixing this'
51 print ' problem: %s' % e
58 url='http://jinja.pocoo.org/',
60 author='Armin Ronacher',
61 author_email='armin.ronacher@active-4.com',
62 description='A small but fast and easy to use stand-alone template '
63 'engine written in pure python.',
64 long_description = getdoc(jinja),
65 # jinja is egg safe. But because we distribute the documentation
66 # in form of html and txt files it's a better idea to extract the files
69 'Development Status :: 5 - Production/Stable',
70 'Environment :: Web Environment',
71 'Intended Audience :: Developers',
72 'License :: OSI Approved :: BSD License',
73 'Operating System :: OS Independent',
74 'Programming Language :: Python',
75 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
76 'Topic :: Software Development :: Libraries :: Python Modules',
77 'Topic :: Text Processing :: Markup :: HTML'
79 keywords=['python.templating.engines'],
80 packages=['jinja', 'jinja.translators'],
82 ('docs/html', list(list_files('docs/html'))),
83 ('docs/txt', list(list_files('docs/src')))
86 [python.templating.engines]
87 jinja = jinja.plugin:BuffetPlugin
89 extras_require={'plugin': ['setuptools>=0.6a2']},
92 'optional C-speed enhancements',
95 Extension('jinja._speedups', ['jinja/_speedups.c'])
98 'extended-debugger': Feature(
102 Extension('jinja._debugger', ['jinja/_debugger.c'])
106 cmdclass={'build_ext': optional_build_ext}