setup.py
author Christian Ebert <blacktrash@gmx.net>
Thu, 08 Nov 2007 12:59:43 +0100
branch0.9.2compat
changeset 291 acd3fba02a50
parent 238 e4a389eca1b9
permissions -rw-r--r--
(0.9.2compat) avoid dispatch import, revert to simple argument parser Make nokwcommands a tuple as long as it's private. No need to import fancyopts, as we use own w/o bug. Clean overriding of findcmd. We only need simple argument parsing for command. No expensive dispatch import, also avoids potential clashes with invasive RuleDispatch (setuptools).

#!/usr/bin/env python
# $Id$

from distutils.core import setup
import os, time

# specify version, Mercurial version otherwise
version = ''

unknown_version = 'unknown'

def getversion():
    global version, unknown_version
    if not version and os.path.isdir('.hg'):
        p = os.popen('hg --quiet identify 2> %s' % os.devnull)
        ident = p.read()[:-1]
        if not p.close() and ident:
            if ident[-1] != '+':
                version = ident
            else:
                version = ident[:-1]
                version += time.strftime('+%Y%m%d')
    return version or unknown_version

setup(name='hgkw',
      version=getversion(),
      description='Mercurial keyword extension (standalone)',
      author='Christian Ebert',
      author_email='blacktrash@gmx.net',
      url='http://www.blacktrash.org/hg/hgkeyword/',
      license='GNU GPL',
      packages=['hgkw'])