1 # -*- coding: utf-8 -*-
6 ez_setup.use_setuptools()
8 from distutils.command.build_ext import build_ext
9 from distutils.errors import CCompilerError
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):
25 def build_extension(self, ext):
27 build_ext.build_extension(self, ext)
28 except CCompilerError, e:
31 print ' the speedup extension could not be compiled, Jinja will'
32 print ' fall back to the native python classes.'
38 print ' could not compile optional speedup extension. This is'
39 print ' is not a real problem because Jinja provides a native'
40 print ' implementation of those classes but for best performance'
41 print ' you could try to reinstall Jinja after fixing this'
42 print ' problem: %s' % e
49 url = 'http://jinja.pocoo.org/',
51 author = 'Armin Ronacher',
52 author_email = 'armin.ronacher@active-4.com',
53 description = 'A small but fast and easy to use stand-alone template '
54 'engine written in pure python.',
55 long_description = getdoc(jinja),
56 # jinja is egg safe. But because we distribute the documentation
57 # in form of html and txt files it's a better idea to extract the files
60 'Development Status :: 5 - Production/Stable',
61 'Environment :: Web Environment',
62 'Intended Audience :: Developers',
63 'License :: OSI Approved :: BSD License',
64 'Operating System :: OS Independent',
65 'Programming Language :: Python',
66 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
67 'Topic :: Software Development :: Libraries :: Python Modules',
68 'Topic :: Text Processing :: Markup :: HTML'
70 keywords = ['python.templating.engines'],
71 packages = ['jinja', 'jinja.translators'],
73 ('docs', list(list_files('docs/build'))),
74 ('docs/txt', list(list_files('docs/src')))
78 [python.templating.engines]
79 jinja = jinja.plugin:BuffetPlugin
81 extras_require = {'plugin': ['setuptools>=0.6a2']},
82 features = {'speedups': Feature(
83 'optional C-speed enhancements',
86 Extension('jinja._speedups', ['jinja/_speedups.c'])
89 cmdclass = {'build_ext': optional_build_ext}