Removed a few stdlib dependencies. This is the first step for IronPython support...
[jinja2.git] / fabfile.py
1 # -*- coding: utf-8 -*-
2 """
3     Jinja fabfile
4     ~~~~~~~~~~~~~
5
6     Shortcuts for various tasks.
7
8     :copyright: Copyright 2008 by Armin Ronacher.
9     :license: BSD.
10 """
11
12
13 def test():
14     """Run the testsuite."""
15     local("cd tests; py.test")
16
17
18 def pylint():
19     """Run pylint."""
20     local("pylint --rcfile scripts/pylintrc jinja")
21
22
23 def release(**kwargs):
24     """Release, tag and upload Jinja2 to the Cheeseshop."""
25     import re
26     _version_re = re.compile(r'VERSION\s*=\s["\'](.*?)["\']')
27     f = file("setup.py")
28     try:
29         for line in f:
30             match = _version_re.match(line)
31             if match is not None:
32                 version = match.group(1)
33                 break
34         else:
35             raise RuntimeError('no version def in setup.py :-/')
36     finally:
37         f.close()
38
39     local('hg tag -m "%s" "%s"' % ('tagged %r' % version, version))
40     local('python setup.py release sdist upload')