diff options
| author | ianb <devnull@localhost> | 2005-05-22 21:16:02 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-05-22 21:16:02 +0000 |
| commit | cf616dc480dee55291240283e46d64f8d7f0d8b7 (patch) | |
| tree | fc85ec4160665eb53e6d755f6788d3ff2975a4b8 | |
| parent | f34db63ae83d2f15ed75da2e74e10e6992c29645 (diff) | |
| download | paste-cf616dc480dee55291240283e46d64f8d7f0d8b7.tar.gz | |
Use svn revision for Paste version
| -rw-r--r-- | setup.py | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -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 |
