- def build_extension(self, ext):
- try:
- if self.compiler is None:
- raise self._setup_error
- build_ext.build_extension(self, ext)
- except CCompilerError, e:
- print '=' * 79
- print 'INFORMATION'
- print ' the speedup extension could not be compiled, Jinja will'
- print ' fall back to the native python classes.'
- print '=' * 79
- except:
- e = sys.exc_info()[1]
- print '=' * 79
- print 'WARNING'
- print ' could not compile optional speedup extension. This is'
- print ' is not a real problem because Jinja provides a native'
- print ' implementation of those classes but for best performance'
- print ' you could try to reinstall Jinja after fixing this'
- print ' problem: %s' % e
- print '=' * 79
+For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
+
+.. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security)
+.. _Django: http://www.djangoproject.com/
+.. _Jinja2 webpage: http://jinja.pocoo.org/
+.. _documentation: http://jinja.pocoo.org/2/documentation/
+"""
+import sys
+
+from setuptools import setup, Extension, Feature
+
+debugsupport = Feature(
+ 'optional C debug support',
+ standard=False,
+ ext_modules = [
+ Extension('jinja2._debugsupport', ['jinja2/_debugsupport.c']),
+ ],
+)
+
+
+# tell distribute to use 2to3 with our own fixers.
+extra = {}
+if sys.version_info >= (3, 0):
+ extra.update(
+ use_2to3=True,
+ use_2to3_fixers=['custom_fixers']
+ )
+
+# ignore the old '--with-speedups' flag
+try:
+ speedups_pos = sys.argv.index('--with-speedups')
+except ValueError:
+ pass
+else:
+ sys.argv[speedups_pos] = '--with-debugsupport'
+ sys.stderr.write('*' * 74 + '\n')
+ sys.stderr.write('WARNING:\n')
+ sys.stderr.write(' the --with-speedups flag is deprecated, assuming '
+ '--with-debugsupport\n')
+ sys.stderr.write(' For the actual speedups install the MarkupSafe '
+ 'package.\n')
+ sys.stderr.write('*' * 74 + '\n')