summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-05-22 21:16:02 +0000
committerianb <devnull@localhost>2005-05-22 21:16:02 +0000
commitcf616dc480dee55291240283e46d64f8d7f0d8b7 (patch)
treefc85ec4160665eb53e6d755f6788d3ff2975a4b8 /setup.py
parentf34db63ae83d2f15ed75da2e74e10e6992c29645 (diff)
downloadpaste-cf616dc480dee55291240283e46d64f8d7f0d8b7.tar.gz
Use svn revision for Paste version
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py31
1 files changed, 29 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 3bc6d08..e5c2d96 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,9 @@
+# If true, then the svn revision won't be used to calculate the
+# revision (set to True for real releases)
+RELEASE = False
+
+__version__ = "0.0"
+
# Setup setuptools:
import sys
import os
@@ -48,10 +54,31 @@ for subdir in [('app_templates',),
for filename in [('default_config.conf',)]:
package_data.append(os.path.join(*filename))
-__revision__ = '$Revision: $'
+def get_svn_revision():
+ """
+ Returns the newest svn revision for all files in the this
+ directory.
+ """
+ import commands
+ status, output = commands.getstatusoutput(
+ 'svn ls -v %s' % os.path.dirname(__file__))
+ if status:
+ return 'unknown'
+ max_revision = 0
+ for line in output.splitlines():
+ line = line.strip()
+ if not line:
+ continue
+ revision = int(line.split()[0])
+ max_revision = max(max_revision, revision)
+ return max_revision
+
+if not RELEASE:
+ rev = get_svn_revision()
+ __version__ += '-devel-r%s' % rev
setup(name="Paste",
- version="0.1",
+ version=__version__,
description="Tools for use with a Web Server Gateway Interface stack",
long_description="""\
These provide several pieces of "middleware" that can be nested to build