root/gaphor/tags/gaphor-0.12.5/setup.py

Revision 2174, 6.7 kB (checked in by wrobe..@pld-linux.org, 9 months ago)

- about to release version 0.12.5

Line 
1 """
2 Setup script for Gaphor.
3
4 Run 'python setup.py develop' to set up a development environment, including
5 dependencies.
6
7 Run 'python setup.py run' to start Gaphor directly (without install).
8 """
9
10 VERSION = '0.12.5'
11
12 import os
13 import sys
14 sys.path.insert(0, '.')
15
16 from ez_setup import use_setuptools
17
18 use_setuptools()
19
20 from setuptools import setup, find_packages
21 from distutils.cmd import Command
22
23 from utils.command.build_mo import build_mo
24 from utils.command.build_pot import build_pot
25 from utils.command.build_uml import build_uml
26 from utils.command.install_lib import install_lib
27 from utils.command.run import run
28
29 LINGUAS = [ 'ca', 'es', 'nl', 'sv' ]
30
31 from setuptools.command.build_py import build_py
32
33 class build_py_with_sub_commands(build_py):
34
35     def run(self):
36         for cmd_name in self.get_sub_commands():
37             self.run_command(cmd_name)
38
39         build_py.run(self)
40
41 build_py_with_sub_commands.sub_commands.append(('build_uml', None))
42
43
44 class build_doc(Command):
45     description = 'Builds the documentation'
46     user_options = []
47
48     def initialize_options(self):
49         pass
50
51     def finalize_options(self):
52         pass
53
54     def run(self):
55 #        from docutils.core import publish_cmdline
56 #        docutils_conf = os.path.join('doc', 'docutils.conf')
57         epydoc_conf = os.path.join('doc', 'epydoc.conf')
58
59 #        for source in glob('doc/*.txt'):
60 #            dest = os.path.splitext(source)[0] + '.html'
61 #            if not os.path.exists(dest) or \
62 #                   os.path.getmtime(dest) < os.path.getmtime(source):
63 #                print 'building documentation file %s' % dest
64 #                publish_cmdline(writer_name='html',
65 #                                argv=['--config=%s' % docutils_conf, source,
66 #                                      dest])
67
68         try:
69             from epydoc import cli
70             old_argv = sys.argv[1:]
71             sys.argv[1:] = [
72                 '--config=%s' % epydoc_conf,
73                 '--no-private', # epydoc bug, not read from config
74                 '--simple-term',
75                 '--verbose'
76             ]
77             cli.cli()
78             sys.argv[1:] = old_argv
79
80         except ImportError:
81             print 'epydoc not installed, skipping API documentation.'
82
83
84 #if sys.platform == 'darwin':
85 #    # Mac OS X
86 #    import pkg_resources
87 #    pkg_resources.require('zope.component')
88 #    platform_setup_requires=['py2app']
89 #    platform_setup = dict(
90 #        app=['gaphor-osx.py'],
91 #        )
92 #else:
93 platform_setup_requires = []
94 platform_setup = dict()
95
96
97 setup(
98     name='gaphor',
99     version=VERSION,
100     url='http://gaphor.devjavu.com',
101     author='Arjan J. Molenaar',
102     author_email='arjanmol@users.sourceforge.net',
103     license='GNU General Public License',
104     description='Gaphor is a UML modeling tool',
105     long_description="""
106 Gaphor is a UML modeling tool written in Python.
107
108 It uses the GTK+ environment for user interaction.
109 """,
110     classifiers = [
111         'Development Status :: 4 - Beta',
112         'Environment :: X11 Applications :: GTK',
113         'Intended Audience :: Developers',
114         'Intended Audience :: End Users/Desktop',
115         'Intended Audience :: Information Technology',
116         'License :: OSI Approved :: GNU General Public License (GPL)',
117         'Operating System :: MacOS :: MacOS X',
118         'Operating System :: Microsoft :: Windows',
119         'Operating System :: POSIX',
120         'Operating System :: Unix',
121         'Programming Language :: Python',
122         'Topic :: Multimedia :: Graphics :: Editors :: Vector-Based',
123         'Topic :: Software Development :: Documentation',
124     ],
125
126     keywords = 'model modeling modelling uml diagram python tool',
127
128     packages = find_packages(exclude=['ez_setup', 'utils*']),
129
130     include_package_data = True,
131
132     install_requires = [
133         # 'PyGTK >= 2.8.0', - Exclude, since it will not build anyway
134         'gaphas >= 0.3.0',
135         'zope.component >= 3.3.0', # - won't compile on windows.
136         # Add dependency on zope.testing to work around bug in zope.component
137         'zope.testing >= 3.3.0',
138     ],
139
140     zip_safe = False,
141
142     #test_suite = 'nose.collector',
143
144     entry_points = {
145         'console_scripts': [
146             'gaphor = gaphor:main',
147         ],
148         'gaphor.services': [
149             'adapter_loader = gaphor.services.adapterloader:AdapterLoader',
150             'properties = gaphor.services.properties:Properties',
151             'undo_manager = gaphor.services.undomanager:UndoManager',
152             'element_factory = gaphor.UML.elementfactory:ElementFactory',
153             'file_manager = gaphor.services.filemanager:FileManager',
154             'diagram_export_manager = gaphor.services.diagramexportmanager:DiagramExportManager',
155             'action_manager = gaphor.services.actionmanager:ActionManager',
156             'gui_manager = gaphor.services.guimanager:GUIManager',
157             'copy = gaphor.services.copyservice:CopyService',
158             'xmi_export = gaphor.plugins.xmiexport:XMIExport',
159             'diagram_layout = gaphor.plugins.diagramlayout:DiagramLayout',
160             'pynsource = gaphor.plugins.pynsource:PyNSource',
161             'check_metamodel = gaphor.plugins.checkmetamodel:CheckModelWindow',
162             'live_object_browser = gaphor.plugins.liveobjectbrowser:LiveObjectBrowser',
163             'alignment = gaphor.plugins.alignment:Alignment',
164             'help = gaphor.services.helpservice:HelpService',
165         ],
166         'gaphor.uicomponents': [
167             'mainwindow = gaphor.ui.mainwindow:MainWindow',
168             'consolewindow = gaphor.ui.consolewindow:ConsoleWindow',
169         ],
170         'distutils.commands': [
171             'nosetests = nose.commands:nosetests',
172         ],
173     },
174
175     cmdclass = {
176               'build_py': build_py_with_sub_commands,
177               'build_uml': build_uml,
178               'build_mo': build_mo,
179               'build_pot': build_pot,
180               'build_doc': build_doc,
181               'install_lib': install_lib,
182               'run': run,
183     },
184
185     setup_requires = ['nose >= 0.9.2'] + platform_setup_requires,
186
187     test_suite = 'nose.collector',
188
189     options = dict(
190         py2app = dict(
191             argv_emulation=True,
192             semi_standalone=True, # Depend on installed Python 2.4 Framework
193             includes=['atk', 'pango', 'cairo', 'pangocairo'], #'zope.defferedimport', 'zope.component', 'zope.deprecation', 'zope.interface', 'zope.event', 'zope.testing', 'zope.proxy'],
194             packages=['gaphor', 'zope'],
195             plist=dict(
196                 CFBundleGetInfoString='Gaphor',
197                 CFBundleIdentifier='com.devjavu.gaphor'
198                 )
199         ),
200         build_pot = dict(
201             all_linguas = ','.join(LINGUAS),
202         ),
203         build_mo = dict(
204             all_linguas = ','.join(LINGUAS),
205         ),
206
207     ),
208
209     **platform_setup
210
211 )
212  
213 # vim:sw=4:et:ai
Note: See TracBrowser for help on using the browser.