~0x44/nova/bug838466

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/twisted/topfiles/setup.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
# Copyright (c) 2001-2009 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
    Extension("twisted.python._initgroups",
 
52
              ["twisted/python/_initgroups.c"]),
 
53
]
 
54
 
 
55
# Figure out which plugins to include: all plugins except subproject ones
 
56
subProjectsPlugins = ['twisted_%s.py' % subProject
 
57
                      for subProject in twisted_subprojects]
 
58
plugins = os.listdir(os.path.join(
 
59
    os.path.dirname(os.path.abspath(copyright.__file__)), 'plugins'))
 
60
plugins = [plugin[:-3] for plugin in plugins if plugin.endswith('.py') and
 
61
           plugin not in subProjectsPlugins]
 
62
 
 
63
 
 
64
 
 
65
setup_args = dict(
 
66
    # metadata
 
67
    name="Twisted Core",
 
68
    version=copyright.version,
 
69
    description="The core parts of the Twisted networking framework",
 
70
    author="Twisted Matrix Laboratories",
 
71
    author_email="twisted-python@twistedmatrix.com",
 
72
    maintainer="Glyph Lefkowitz",
 
73
    url="http://twistedmatrix.com/",
 
74
    license="MIT",
 
75
    long_description="""\
 
76
This is the core of Twisted, including:
 
77
 * Networking support (twisted.internet)
 
78
 * Trial, the unit testing framework (twisted.trial)
 
79
 * AMP, the Asynchronous Messaging Protocol (twisted.protocols.amp)
 
80
 * Twisted Spread, a remote object system (twisted.spread)
 
81
 * Utility code (twisted.python)
 
82
 * Basic abstractions that multiple subprojects use
 
83
   (twisted.cred, twisted.application, twisted.plugin)
 
84
 * Database connectivity support (twisted.enterprise)
 
85
 * A few basic protocols and protocol abstractions (twisted.protocols)
 
86
""",
 
87
 
 
88
    # build stuff
 
89
    packages=getPackages('twisted',
 
90
                         ignore=twisted_subprojects + ['plugins']),
 
91
    plugins=plugins,
 
92
    data_files=getDataFiles('twisted', ignore=twisted_subprojects),
 
93
    conditionalExtensions=extensions,
 
94
    scripts = getScripts(""),
 
95
)
 
96
 
 
97
 
 
98
if __name__ == '__main__':
 
99
    setup(**setup_args)