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

Revision 2281, 7.4 kB (checked in by arj..@yirdis.nl, 8 months ago)

added main() placeholder to keep setuptools happy.

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