Skip to content
Myr

setup.py

This file

Path

setup.py

89 lines · 2.9 KiB · Python

Last changed by

[svn] made jinja platform depending and adedd manifest for the built documentation. Improved loader documentationArmin Ronacherbefore adoption2165ce6

History of this file

Take it

1# -*- coding: utf-8 -*-2import jinja3import os4import sys5import ez_setup6ez_setup.use_setuptools()78from distutils.command.build_ext import build_ext9from distutils.errors import CCompilerError10from setuptools import setup, Extension, Feature11from inspect import getdoc121314def list_files(path):15    for fn in os.listdir(path):16        if fn.startswith('.'):17            continue18        fn = os.path.join(path, fn)19        if os.path.isfile(fn):20            yield fn212223class optional_build_ext(build_ext):2425    def build_extension(self, ext):26        try:27            build_ext.build_extension(self, ext)28        except CCompilerError, e:29            print '=' * 7930            print 'INFORMATION'31            print '  the speedup extension could not be compiled, Jinja will'32            print '  fall back to the native python classes.'33            print '=' * 7934        except:35            e = sys.exc_info()[1]36            print '=' * 7937            print 'WARNING'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' % e43            print '=' * 79444546setup(47    name = 'Jinja',48    version = '1.1',49    url = 'http://jinja.pocoo.org/',50    license = 'BSD',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 documentation57    # in form of html and txt files it's a better idea to extract the files58    zip_safe = False,59    classifiers = [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'69    ],70    keywords = ['python.templating.engines'],71    packages = ['jinja', 'jinja.translators'],72    data_files = [73        ('docs', list(list_files('docs/build'))),74        ('docs/txt', list(list_files('docs/src')))75    ],76    entry_points='''77    [python.templating.engines]78    jinja = jinja.plugin:BuffetPlugin79    ''',80    extras_require = {'plugin': ['setuptools>=0.6a2']},81    features = {'speedups': Feature(82        'optional C-speed enhancements',83        standard = True,84        ext_modules = [85            Extension('jinja._speedups', ['jinja/_speedups.c'])86        ]87    )},88    cmdclass = {'build_ext': optional_build_ext}89)