added the missing fabfile (gnabber)
authorArmin Ronacher <armin.ronacher@active-4.com>
Thu, 17 Jul 2008 21:36:34 +0000 (23:36 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Thu, 17 Jul 2008 21:36:34 +0000 (23:36 +0200)
--HG--
branch : trunk

fabfile.py [new file with mode: 0644]

diff --git a/fabfile.py b/fabfile.py
new file mode 100644 (file)
index 0000000..4c16cd0
--- /dev/null
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+"""
+    Jinja fabfile
+    ~~~~~~~~~~~~~
+
+    Shortcuts for various tasks.
+
+    :copyright: Copyright 2008 by Armin Ronacher.
+    :license: BSD.
+"""
+
+
+def test():
+    """Run the testsuite."""
+    local("cd tests; py.test")
+
+
+def pylint():
+    """Run pylint."""
+    local("pylint --rcfile scripts/pylintrc jinja")
+
+
+def release(**kwargs):
+    """Release, tag and upload Jinja2 to the Cheeseshop."""
+    import re
+    _version_re = re.compile(r'VERSION\s*=\s["\'](.*?)["\']')
+    f = file("setup.py")
+    try:
+        for line in f:
+            match = _version_re.match(line)
+            if match is not None:
+                version = match.group(1)
+                break
+        else:
+            raise RuntimeError('no version def in setup.py :-/')
+    finally:
+        f.close()
+
+    local('hg tag -m "%s" "%s"' % ('tagged %r' % version, version))
+    local('python setup.py release sdist upload')