source: tracdarcs/setup.py @ 217

Revision 217, 2.2 KB checked in by lele@…, 18 months ago (diff)

Update lele's email address

Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Copyright (C) 2005-2010 Lele Gaifax <lele@metapensiero.it>
5#
6# This software is licensed as described in the file COPYING, which
7# you should have received as part of this distribution. The terms
8# are also available at http://trac.edgewall.com/license.html.
9#
10# This software consists of voluntary contributions made by many
11# individuals. For the exact contribution history, see the revision
12# history and logs, available at http://projects.edgewall.com/trac/.
13#
14# Author: Lele Gaifax <lele@metapensiero.it>
15
16import re, sys
17from os.path import join, dirname
18
19from setuptools import setup
20
21initpy = open(join(dirname(__file__), 'tracdarcs', '__init__.py')).read()
22try:
23    VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(initpy).group(1)
24except:
25    print "Cannot recognize a valid version in tracdarcs/__init__.py!"
26    sys.exit(1)
27
28setup_requires=[]
29# darcsver is needed only if you want "./setup.py darcsver" to write a new
30# version stamp in tracdarcs/_version.py, with a version number derived from
31# darcs history.  http://pypi.python.org/pypi/darcsver
32if "darcsver" in sys.argv[1:]:
33    setup_requires.append('darcsver >= 1.0.0')
34
35VERSIONFILE = join(dirname(__file__), 'tracdarcs', '_version.py')
36verstr = VERSION
37try:
38    verstrline = open(VERSIONFILE, "rt").read()
39except EnvironmentError:
40    pass # Okay, there is no version file.
41else:
42    VSRE = r"^verstr = ['\"]([^'\"]*)['\"]"
43    mo = re.search(VSRE, verstrline, re.M)
44    if mo:
45        verstr = mo.group(1)
46    else:
47        print "unable to find version in %s" % (VERSIONFILE,)
48        raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
49
50setup(name='TracDarcs',
51      description='Darcs plugin for Trac',
52      keywords='trac scm plugin darcs',
53      version=verstr,
54      setup_requires=setup_requires,
55      url='http://darcs.arstecnica.it/trac-darcs',
56      license='http://trac.edgewall.com/license.html',
57      author='Lele Gaifax',
58      author_email='lele@metapensiero.it',
59      long_description=open('README.rst').read(),
60      packages=['tracdarcs'],
61      entry_points={'trac.plugins': 'darcs = tracdarcs'},
62      zip_safe=False
63)
Note: See TracBrowser for help on using the repository browser.