Run `./2to3.py -w jinja2`
[jinja2.git] / setup.py
1 # -*- coding: utf-8 -*-
2 """
3 Jinja2
4 ~~~~~~
5
6 Jinja2 is a template engine written in pure Python.  It provides a
7 `Django`_ inspired non-XML syntax but supports inline expressions and
8 an optional `sandboxed`_ environment.
9
10 Nutshell
11 --------
12
13 Here a small example of a Jinja template::
14
15     {% extends 'base.html' %}
16     {% block title %}Memberlist{% endblock %}
17     {% block content %}
18       <ul>
19       {% for user in users %}
20         <li><a href="{{ user.url }}">{{ user.username }}</a></li>
21       {% endfor %}
22       </ul>
23     {% endblock %}
24
25 Philosophy
26 ----------
27
28 Application logic is for the controller but don't try to make the life
29 for the template designer too hard by giving him too few functionality.
30
31 For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
32
33 .. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security)
34 .. _Django: http://www.djangoproject.com/
35 .. _Jinja2 webpage: http://jinja.pocoo.org/
36 .. _documentation: http://jinja.pocoo.org/2/documentation/
37 """
38 import sys
39
40 from setuptools import setup, Extension, Feature
41
42 debugsupport = Feature(
43     'optional C debug support',
44     standard=False,
45     ext_modules = [
46         Extension('jinja2._debugsupport', ['jinja2/_debugsupport.c']),
47     ],
48 )
49
50
51 # tell distribute to use 2to3 with our own fixers.
52 extra = {}
53 if sys.version_info >= (3, 0):
54     extra.update(
55         use_2to3=True,
56         use_2to3_fixers=['custom_fixers']
57     )
58
59 # ignore the old '--with-speedups' flag
60 try:
61     speedups_pos = sys.argv.index('--with-speedups')
62 except ValueError:
63     pass
64 else:
65     sys.argv[speedups_pos] = '--with-debugsupport'
66     sys.stderr.write('*' * 74 + '\n')
67     sys.stderr.write('WARNING:\n')
68     sys.stderr.write('  the --with-speedups flag is deprecated, assuming '
69                      '--with-debugsupport\n')
70     sys.stderr.write('  For the actual speedups install the MarkupSafe '
71                      'package.\n')
72     sys.stderr.write('*' * 74 + '\n')
73
74
75 setup(
76     name='Jinja2',
77     version='2.7-dev',
78     url='http://jinja.pocoo.org/',
79     license='BSD',
80     author='Armin Ronacher',
81     author_email='armin.ronacher@active-4.com',
82     description='A small but fast and easy to use stand-alone template '
83                 'engine written in pure python.',
84     long_description=__doc__,
85     # jinja is egg safe. But we hate eggs
86     zip_safe=False,
87     classifiers=[
88         'Development Status :: 5 - Production/Stable',
89         'Environment :: Web Environment',
90         'Intended Audience :: Developers',
91         'License :: OSI Approved :: BSD License',
92         'Operating System :: OS Independent',
93         'Programming Language :: Python',
94         'Programming Language :: Python :: 3',
95         'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
96         'Topic :: Software Development :: Libraries :: Python Modules',
97         'Topic :: Text Processing :: Markup :: HTML'
98     ],
99     packages=['jinja2', 'jinja2.testsuite', 'jinja2.testsuite.res',
100               'jinja2._markupsafe'],
101     extras_require={'i18n': ['Babel>=0.8']},
102     test_suite='jinja2.testsuite.suite',
103     include_package_data=True,
104     entry_points="""
105     [babel.extractors]
106     jinja2 = jinja2.ext:babel_extract[i18n]
107     """,
108     features={'debugsupport': debugsupport},
109     **extra
110 )