/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Jelmer Vernooij
  • Date: 2012-07-09 15:23:26 UTC
  • mto: This revision was merged to the branch mainline in revision 794.
  • Revision ID: jelmer@samba.org-20120709152326-dzxb8zoz0btull7n
Remove bzr-notify.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
 
 
3
2
"""GTK+ Frontends for various Bazaar commands."""
4
3
 
 
4
import os
 
5
import sys
 
6
 
 
7
from info import bzr_plugin_version
 
8
 
5
9
from distutils.core import setup, Command
6
10
from distutils.command.install_data import install_data
7
11
from distutils.command.build import build
8
 
import os
9
 
import sys
 
12
from distutils.command.sdist import sdist
 
13
try:
 
14
    from DistUtilsExtra.command import build_i18n
 
15
except ImportError:
 
16
    # Python distutils extra is not available.
 
17
    class cmd_build_i18n(build):
 
18
        user_options = []
 
19
 
 
20
        def initialize_options(self):
 
21
            self.domain = None
 
22
            self.desktop_files = None
 
23
 
 
24
        def finalize_options(self):
 
25
            pass
 
26
 
 
27
        def run(self):
 
28
            print >> sys.stderr, (
 
29
                "For internationalization support you'll need to install "
 
30
                "https://launchpad.net/python-distutils-extra")
 
31
else:
 
32
    # Use build_i18n from DistUtilsExtra
 
33
    cmd_build_i18n = build_i18n.build_i18n
 
34
 
10
35
 
11
36
class Check(Command):
12
37
    description = "Run unit tests"
13
38
 
14
 
    user_options = []
 
39
    user_options = [
 
40
        ('module=', 'm', 'The test module to run'),
 
41
        ]
15
42
 
16
43
    def initialize_options(self):
17
 
        pass
 
44
        self.module = None
18
45
 
19
46
    def finalize_options(self):
20
47
        pass
24
51
 
25
52
    def run(self):
26
53
        from bzrlib.tests import TestLoader, TestSuite, TextTestRunner
27
 
        import __init__ as bzrgtk
 
54
        from bzrlib.plugin import PluginImporter
 
55
        PluginImporter.specific_paths["bzrlib.plugins.gtk"] = os.path.dirname(
 
56
            __file__)
 
57
        from bzrlib.plugins.gtk.tests import load_tests
 
58
        suite = TestSuite()
 
59
        loader = TestLoader()
 
60
        load_tests(suite, self.module, loader)
28
61
        runner = TextTestRunner()
29
 
        loader = TestLoader()
30
 
        suite = TestSuite()
31
 
        suite.addTest(bzrgtk.test_suite())
32
62
        result = runner.run(suite)
33
63
        return result.wasSuccessful()
34
64
 
48
78
        return 'build_credits'
49
79
 
50
80
    def run(self):
51
 
        from bzrlib.plugin import load_plugins; load_plugins()
 
81
        from bzrlib.plugin import load_plugins
 
82
        load_plugins()
52
83
        from bzrlib.branch import Branch
53
 
        from bzrlib.plugins.stats import find_credits
 
84
        from bzrlib.plugins.stats.cmds import find_credits
54
85
 
55
86
        import pickle
56
87
 
76
107
    sub_commands.append(('build_credits', is_versioned))
77
108
 
78
109
 
 
110
class SourceDist(sdist):
 
111
    sub_commands = sdist.sub_commands[:]
 
112
    sub_commands.append(('build_credits', is_versioned))
 
113
 
 
114
 
79
115
class InstallData(install_data):
80
116
 
81
117
    def run(self):
103
139
 
104
140
 
105
141
if __name__ == '__main__':
 
142
    version = bzr_plugin_version[:3]
 
143
    version_string = ".".join([str(x) for x in version])
106
144
    setup(
107
 
        name = "bzr-gtk",
108
 
        version = "0.99.0",
109
 
        maintainer = "Jelmer Vernooij",
110
 
        maintainer_email = "jelmer@samba.org",
111
 
        description = "GTK+ Frontends for various Bazaar commands",
112
 
        license = "GNU GPL v2 or later",
113
 
        scripts = ['bzr-handle-patch', 'bzr-notify'],
114
 
        url = "http://bazaar-vcs.org/BzrGtk",
115
 
        package_dir = {
 
145
        name="bzr-gtk",
 
146
        version=version_string,
 
147
        maintainer="Jelmer Vernooij",
 
148
        maintainer_email="jelmer@samba.org",
 
149
        description="GTK+ Frontends for various Bazaar commands",
 
150
        license="GNU GPL v2 or later",
 
151
        scripts=['bzr-handle-patch'],
 
152
        url="http://bazaar-vcs.org/BzrGtk",
 
153
        package_dir={
116
154
            "bzrlib.plugins.gtk": ".",
117
155
            "bzrlib.plugins.gtk.viz": "viz",
118
156
            "bzrlib.plugins.gtk.annotate": "annotate",
120
158
            "bzrlib.plugins.gtk.branchview": "branchview",
121
159
            "bzrlib.plugins.gtk.preferences": "preferences",
122
160
            },
123
 
        packages = [
 
161
        packages=[
124
162
            "bzrlib.plugins.gtk",
125
163
            "bzrlib.plugins.gtk.viz",
126
164
            "bzrlib.plugins.gtk.annotate",
128
166
            "bzrlib.plugins.gtk.branchview",
129
167
            "bzrlib.plugins.gtk.preferences",
130
168
        ],
131
 
        data_files=[ ('share/bzr-gtk', ['credits.pickle']),
 
169
        data_files=[('share/bzr-gtk', ['credits.pickle']),
132
170
                    ('share/bzr-gtk/icons', ['icons/commit.png',
133
171
                                             'icons/commit16.png',
134
172
                                             'icons/diff.png',
147
185
                                             'icons/tag-16.png',
148
186
                                             'icons/bug.png',
149
187
                                             'icons/bzr-icon-64.png']),
 
188
                    # In case Python distutils extra is not available,
 
189
                    # install the .desktop files
150
190
                    ('share/applications', ['bazaar-properties.desktop',
151
 
                                            'bzr-handle-patch.desktop',
152
 
                                            'bzr-notify.desktop']),
 
191
                                            'bzr-handle-patch.desktop']),
153
192
                    ('share/application-registry', ['bzr-gtk.applications']),
154
193
                    ('share/pixmaps', ['icons/bzr-icon-64.png']),
 
194
                    ('share/icons/hicolor/scalable/apps',
 
195
                        ['icons/bzr-panel.svg']),
155
196
                    ('share/icons/hicolor/scalable/emblems',
156
197
                     ['icons/emblem-bzr-added.svg',
157
198
                      'icons/emblem-bzr-conflict.svg',
163
204
        cmdclass={'install_data': InstallData,
164
205
                  'build_credits': CreateCredits,
165
206
                  'build': BuildData,
 
207
                  'build_i18n': cmd_build_i18n,
 
208
                  'sdist': SourceDist,
166
209
                  'check': Check}
167
210
        )