setup.py
author Augie Fackler <durin42@gmail.com>
Tue, 31 May 2011 20:39:04 -0500
branchstable
changeset 962 b5a4f9f5ec49
parent 238 e4a389eca1b9
permissions -rw-r--r--
run-tests: allow whitelisting tests that should always run It's desirable to run some tests all the time, for example test-check-pyflakes.t and test-check-code-hg.py. This allows passing --whitelist as a path to a file (flag can be specified more than once) which contains a list of files to whitelist. Whitelisted tests are run even if they're blacklisted or wouldn't match a --keyword test run. For example, to do a quick test of usehttp2, one can now do $ cat > test-whitelist <<EOF > test-check-pyflakes.t > test-check-code-hg.py > EOF $ (cd tests && ./run-tests.py --extra-config-opt 'ui.usehttp2=true' > -k http -j 8 --whitelist test-whitelist) and have all http-specific tests run as well as the two code linters. [ original upstream message ]
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
124
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     1
#!/usr/bin/env python
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     2
# $Id$
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     3
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     4
from distutils.core import setup
238
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
     5
import os, time
124
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     6
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     7
# specify version, Mercurial version otherwise
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     8
version = ''
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     9
238
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    10
unknown_version = 'unknown'
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    11
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    12
def getversion():
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    13
    global version, unknown_version
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    14
    if not version and os.path.isdir('.hg'):
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    15
        p = os.popen('hg --quiet identify 2> %s' % os.devnull)
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    16
        ident = p.read()[:-1]
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    17
        if not p.close() and ident:
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    18
            if ident[-1] != '+':
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    19
                version = ident
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    20
            else:
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    21
                version = ident[:-1]
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    22
                version += time.strftime('+%Y%m%d')
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    23
    return version or unknown_version
124
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    24
99dc49c5bcfb Setup standalone module install, version tracking
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    25
setup(name='hgkw',
238
e4a389eca1b9 Move version code into setup.py
Christian Ebert <blacktrash@gmx.net>
parents: 219
diff changeset
    26
      version=getversion(),
219
405a9c1dc7bf setup: add url, reformat
Christian Ebert <blacktrash@gmx.net>
parents: 124
diff changeset
    27
      description='Mercurial keyword extension (standalone)',
405a9c1dc7bf setup: add url, reformat
Christian Ebert <blacktrash@gmx.net>
parents: 124
diff changeset
    28
      author='Christian Ebert',
405a9c1dc7bf setup: add url, reformat
Christian Ebert <blacktrash@gmx.net>
parents: 124
diff changeset
    29
      author_email='blacktrash@gmx.net',
405a9c1dc7bf setup: add url, reformat
Christian Ebert <blacktrash@gmx.net>
parents: 124
diff changeset
    30
      url='http://www.blacktrash.org/hg/hgkeyword/',
405a9c1dc7bf setup: add url, reformat
Christian Ebert <blacktrash@gmx.net>
parents: 124
diff changeset
    31
      license='GNU GPL',
405a9c1dc7bf setup: add url, reformat
Christian Ebert <blacktrash@gmx.net>
parents: 124
diff changeset
    32
      packages=['hgkw'])