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

Revision 2112, 6.4 kB (checked in by arj..@yirdis.nl, 1 year ago)

use types.FileType? instead of file, since it causes trouble with easy_install. Incremented version to0.12.1. Fix #74.

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