GitRepository.create_tag: use GitArgs class
[tools/git-buildpackage.git] / setup.py
1 #!/usr/bin/python
2 # vim: set fileencoding=utf-8 :
3 # Copyright (C) 2006-2011 Guido Günther <agx@sigxcpu.org>
4 #
5 #    This program is free software; you can redistribute it and/or modify
6 #    it under the terms of the GNU General Public License as published by
7 #    the Free Software Foundation; either version 2 of the License, or
8 #    (at your option) any later version.
9 #
10 #    This program is distributed in the hope that it will be useful,
11 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #    GNU General Public License for more details.
14 #
15 #    You should have received a copy of the GNU General Public License
16 #    along with this program; if not, write to the Free Software
17 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 # END OF COPYRIGHT #
19
20 import subprocess
21 from setuptools import setup, find_packages
22 import os
23
24
25 def fetch_version():
26     """Get version from debian changelog and write it to gbp/version.py"""
27     version = "0.0"
28
29     try:
30         popen = subprocess.Popen('dpkg-parsechangelog', stdout=subprocess.PIPE)
31         out, ret = popen.communicate()
32         for line in out.split('\n'):
33             if line.startswith('Version:'):
34                 version = line.split(' ')[1].strip()
35                 break
36     except OSError:
37         pass # Failing is fine, we just can't print the version then
38
39     with open('gbp/version.py', 'w') as f:
40         f.write('"The current gbp version number"\n')
41         f.write('gbp_version="%s"\n' % version)
42
43     return version
44
45
46 def readme():
47     with open('README') as file:
48         return file.read()
49
50 setup(name = "gbp",
51       version = fetch_version(),
52       author = u'Guido Günther',
53       author_email = 'agx@sigxcpu.org',
54       url = 'https://honk.sigxcpu.org/piki/projects/git-buildpackage/',
55       description = 'Suite to help with Debian packages in Git repositories',
56       license = 'GPLv2+',
57       long_description = readme(),
58       classifiers = [
59           'Environment :: Console',
60           'Programming Language :: Python :: 2',
61           'Topic :: Software Development :: Version Control :: Git',
62           'Operating System :: POSIX :: Linux',
63       ],
64       scripts = [ 'bin/git-buildpackage',
65                   'bin/git-import-dsc',
66                   'bin/git-import-orig',
67                   'bin/git-dch',
68                   'bin/git-import-dscs',
69                   'bin/gbp-pq',
70                   'bin/gbp-pull',
71                   'bin/gbp-clone',
72                   'bin/gbp-create-remote-repo',
73                   'bin/git-pbuilder'],
74       packages = find_packages(exclude=['tests', 'tests.*']),
75       data_files = [("/etc/git-buildpackage/", ["gbp.conf"]),],
76       setup_requires=['nose>=0.11.1', 'coverage>=2.85'] if \
77                         os.getenv('WITHOUT_NOSETESTS') is None else [],
78       entry_points = {
79           'console_scripts': [ 'gbp = gbp.scripts.supercommand:supercommand' ],
80       },
81 )