Merged in fix for Python 3 regarding precisions
[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 The `Jinja2 tip`_ is installable via `easy_install` with ``easy_install
34 Jinja2==dev``.
35
36 .. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security)
37 .. _Django: http://www.djangoproject.com/
38 .. _Jinja2 webpage: http://jinja.pocoo.org/
39 .. _documentation: http://jinja.pocoo.org/2/documentation/
40 .. _Jinja2 tip: http://dev.pocoo.org/hg/jinja2-main/archive/tip.tar.gz#egg=Jinja2-dev
41 """
42 import os
43 import sys
44
45 from setuptools import setup, Extension, Feature
46 from distutils.command.build_ext import build_ext
47
48 debugsupport = Feature(
49     'optional C debug support',
50     standard=False,
51     ext_modules = [
52         Extension('jinja2._debugsupport', ['jinja2/_debugsupport.c']),
53     ],
54 )
55
56
57 # tell distribute to use 2to3 with our own fixers.
58 extra = {}
59 if sys.version_info >= (3, 0):
60     extra.update(
61         use_2to3=True,
62         use_2to3_fixers=['custom_fixers']
63     )
64
65 # ignore the old '--with-speedups' flag
66 try:
67     speedups_pos = sys.argv.index('--with-speedups')
68 except IndexError:
69     pass
70 else:
71     sys.argv[speedups_pos] = '--with-debugsupport'
72     sys.stderr.write('*' * 74 + '\n')
73     sys.stderr.write('WARNING:\n')
74     sys.stderr.write('  the --with-speedups flag is deprecated, assuming '
75                      '--with-debugsupport\n')
76     sys.stderr.write('  For the actual speedups install the MarkupSafe '
77                      'package.\n')
78     sys.stderr.write('*' * 74 + '\n')
79
80
81 setup(
82     name='Jinja2',
83     version='2.5.2',
84     url='http://jinja.pocoo.org/',
85     license='BSD',
86     author='Armin Ronacher',
87     author_email='armin.ronacher@active-4.com',
88     description='A small but fast and easy to use stand-alone template '
89                 'engine written in pure python.',
90     long_description=__doc__,
91     # jinja is egg safe. But we hate eggs
92     zip_safe=False,
93     classifiers=[
94         'Development Status :: 5 - Production/Stable',
95         'Environment :: Web Environment',
96         'Intended Audience :: Developers',
97         'License :: OSI Approved :: BSD License',
98         'Operating System :: OS Independent',
99         'Programming Language :: Python',
100         'Programming Language :: Python :: 3',
101         'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
102         'Topic :: Software Development :: Libraries :: Python Modules',
103         'Topic :: Text Processing :: Markup :: HTML'
104     ],
105     packages=['jinja2', 'jinja2.testsuite', 'jinja2.testsuite.res',
106               'jinja2._markupsafe'],
107     extras_require={'i18n': ['Babel>=0.8']},
108     test_suite='jinja2.testsuite.suite',
109     include_package_data=True,
110     entry_points="""
111     [babel.extractors]
112     jinja2 = jinja2.ext:babel_extract[i18n]
113     """,
114     features={'debugsupport': debugsupport},
115     **extra
116 )