OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 | |
3 # Copyright (c) 2001-2008 Twisted Matrix Laboratories. | |
4 # See LICENSE for details. | |
5 | |
6 | |
7 """ | |
8 Distutils installer for Twisted. | |
9 """ | |
10 | |
11 import os, sys | |
12 | |
13 if sys.version_info < (2,3): | |
14 print >>sys.stderr, "You must use at least Python 2.3 for Twisted" | |
15 sys.exit(3) | |
16 | |
17 if os.path.exists('twisted'): | |
18 sys.path.insert(0, '.') # eek! need this to import twisted. sorry. | |
19 from twisted import copyright | |
20 from twisted.python.dist import setup, ConditionalExtension as Extension | |
21 from twisted.python.dist import getPackages, getDataFiles, getScripts | |
22 from twisted.python.dist import twisted_subprojects | |
23 | |
24 | |
25 | |
26 extensions = [ | |
27 Extension("twisted.protocols._c_urlarg", | |
28 ["twisted/protocols/_c_urlarg.c"]), | |
29 | |
30 Extension("twisted.test.raiser", | |
31 ["twisted/test/raiser.c"]), | |
32 | |
33 Extension("twisted.python._epoll", | |
34 ["twisted/python/_epoll.c"], | |
35 condition=lambda builder: builder._check_header("sys/epoll.h")), | |
36 | |
37 Extension("twisted.internet.iocpreactor.iocpsupport", | |
38 ["twisted/internet/iocpreactor/iocpsupport/iocpsupport.c", | |
39 "twisted/internet/iocpreactor/iocpsupport/winsock_pointers.c"], | |
40 libraries=["ws2_32"], | |
41 condition=lambda builder: sys.platform == "win32"), | |
42 | |
43 Extension("twisted.internet.cfsupport", | |
44 ["twisted/internet/cfsupport/cfsupport.c"], | |
45 extra_compile_args=['-w'], | |
46 extra_link_args=['-framework','CoreFoundation', | |
47 '-framework','CoreServices', | |
48 '-framework','Carbon'], | |
49 condition=lambda builder: sys.platform == "darwin"), | |
50 ] | |
51 | |
52 # Figure out which plugins to include: all plugins except subproject ones | |
53 subProjectsPlugins = ['twisted_%s.py' % subProject | |
54 for subProject in twisted_subprojects] | |
55 plugins = os.listdir(os.path.join( | |
56 os.path.dirname(os.path.abspath(copyright.__file__)), 'plugins')) | |
57 plugins = [plugin[:-3] for plugin in plugins if plugin.endswith('.py') and | |
58 plugin not in subProjectsPlugins] | |
59 | |
60 | |
61 | |
62 setup_args = dict( | |
63 # metadata | |
64 name="Twisted Core", | |
65 version=copyright.version, | |
66 description="The core parts of the Twisted networking framework", | |
67 author="Twisted Matrix Laboratories", | |
68 author_email="twisted-python@twistedmatrix.com", | |
69 maintainer="Glyph Lefkowitz", | |
70 maintainer_email="glyph@twistedmatrix.com", | |
71 url="http://twistedmatrix.com/", | |
72 license="MIT", | |
73 long_description="""\ | |
74 This is the core of Twisted, including: | |
75 * Networking support (twisted.internet) | |
76 * Trial, the unit testing framework (twisted.trial) | |
77 * AMP, the Asynchronous Messaging Protocol (twisted.protocols.amp) | |
78 * Twisted Spread, a remote object system (twisted.spread) | |
79 * Utility code (twisted.python) | |
80 * Basic abstractions that multiple subprojects use | |
81 (twisted.cred, twisted.application, twisted.plugin) | |
82 * Database connectivity support (twisted.enterprise) | |
83 * A few basic protocols and protocol abstractions (twisted.protocols) | |
84 """, | |
85 | |
86 # build stuff | |
87 packages=getPackages('twisted', | |
88 ignore=twisted_subprojects + ['plugins']), | |
89 plugins=plugins, | |
90 data_files=getDataFiles('twisted', ignore=twisted_subprojects), | |
91 conditionalExtensions=extensions, | |
92 scripts = getScripts(""), | |
93 ) | |
94 | |
95 | |
96 if __name__ == '__main__': | |
97 setup(**setup_args) | |
OLD | NEW |