~cjwatson/launchpad-buildd/modprobe-nbd

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Colin Watson
  • Date: 2015-11-11 08:58:26 UTC
  • mfrom: (180.1.2 build-sdist)
  • Revision ID: cjwatson@canonical.com-20151111085826-mrpg5flb03uagqhy
[r=wgrant] Add Python packaging files so that Launchpad's test suite can incorporate this as a Python dependency rather than requiring python-lpbuildd to be installed on the test system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
# Copyright 2015 Canonical Ltd.  All rights reserved.
 
4
#
 
5
# This file is part of launchpad-buildd.
 
6
#
 
7
# launchpad-buildd is free software: you can redistribute it and/or modify
 
8
# it under the terms of the GNU Affero General Public License as published
 
9
# by the Free Software Foundation, version 3 of the License.
 
10
#
 
11
# launchpad-buildd is distributed in the hope that it will be useful, but
 
12
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
13
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
 
14
# License for more details.
 
15
#
 
16
# You should have received a copy of the GNU Affero General Public License
 
17
# along with launchpad-buildd.  If not, see <http://www.gnu.org/licenses/>.
 
18
 
 
19
import re
 
20
from textwrap import dedent
 
21
 
 
22
from setuptools import (
 
23
    find_packages,
 
24
    setup,
 
25
    )
 
26
 
 
27
 
 
28
changelog_heading = re.compile(r'\w[-+0-9a-z.]* \(([^\(\) \t]+)\)')
 
29
 
 
30
with open('debian/changelog') as changelog:
 
31
    line = changelog.readline()
 
32
    match = changelog_heading.match(line)
 
33
    if match is None:
 
34
        raise ValueError(
 
35
            "Failed to parse first line of debian/changelog: '%s'" % line)
 
36
    version = match.group(1)
 
37
 
 
38
 
 
39
setup(
 
40
    name='launchpad-buildd',
 
41
    version=version,
 
42
    description='Launchpad buildd slave',
 
43
    long_description=dedent("""
 
44
        The Launchpad buildd slave libraries.  The PyPI version of this
 
45
        package will not produce a complete installation on its own, and is
 
46
        mostly useful for testing other pieces of software against
 
47
        launchpad-buildd; for a real Launchpad buildd slave, install the
 
48
        launchpad-buildd package from ppa:launchpad/ubuntu/ppa.
 
49
        """).strip(),
 
50
    url='https://launchpad.net/launchpad-buildd',
 
51
    packages=find_packages(),
 
52
    package_data={
 
53
        'lpbuildd': [
 
54
            'tests/buildd-slave-test.conf',
 
55
            ],
 
56
        },
 
57
    maintainer='Launchpad Developers',
 
58
    maintainer_email='launchpad-dev@lists.launchpad.net',
 
59
    license='Affero GPL v3',
 
60
    install_requires=[
 
61
        'bzr',
 
62
        # XXX cjwatson 2015-11-04: This does in fact require python-apt, but
 
63
        # that's normally shipped as a system package and specifying it here
 
64
        # causes problems for Launchpad's build system.
 
65
        #'python-apt',
 
66
        'python-debian',
 
67
        'Twisted',
 
68
        'zope.interface',
 
69
        ],
 
70
    data_files=[
 
71
        ('', ['buildd-slave.tac', 'template-buildd-slave.conf']),
 
72
        ],
 
73
    test_suite='lpbuildd.tests',
 
74
    tests_require=[
 
75
        'fixtures',
 
76
        'testtools',
 
77
        'txfixtures',
 
78
        ],
 
79
    )