3 # Copyright (c) Twisted Matrix Laboratories.
4 # See LICENSE for details.
7 Distutils installer for Twisted.
11 # Load setuptools, to build a specific source package
21 Get all extensions from core and all subprojects.
25 if not sys.platform.startswith('java'):
26 for dir in os.listdir("twisted") + [""]:
27 topfiles = os.path.join("twisted", dir, "topfiles")
28 if os.path.isdir(topfiles):
30 setup_py = os.path.join(topfiles, "setup.py")
31 execfile(setup_py, ns, ns)
32 if "extensions" in ns:
33 extensions.extend(ns["extensions"])
40 Invoke twisted.python.dist with the appropriate metadata about the
43 if os.path.exists('twisted'):
44 sys.path.insert(0, '.')
45 from twisted import copyright
46 from twisted.python.dist import getDataFiles, getScripts, getPackages, \
47 setup, twisted_subprojects
49 # "" is included because core scripts are directly in bin/
50 projects = [''] + [x for x in os.listdir('bin')
51 if os.path.isdir(os.path.join("bin", x))
52 and x in twisted_subprojects]
56 scripts.extend(getScripts(i))
61 version=copyright.version,
62 description="An asynchronous networking framework written in Python",
63 author="Twisted Matrix Laboratories",
64 author_email="twisted-python@twistedmatrix.com",
65 maintainer="Glyph Lefkowitz",
66 maintainer_email="glyph@twistedmatrix.com",
67 url="http://twistedmatrix.com/",
70 An extensible framework for Python programming, with special focus
71 on event-based network programming and multiprotocol integration.
73 packages = getPackages('twisted'),
74 conditionalExtensions = getExtensions(),
76 data_files=getDataFiles('twisted'),
78 "Programming Language :: Python :: 2.5",
79 "Programming Language :: Python :: 2.6",
80 "Programming Language :: Python :: 2.7",
83 if 'setuptools' in sys.modules:
84 from pkg_resources import parse_requirements
85 requirements = ["zope.interface"]
87 list(parse_requirements(requirements))
89 print """You seem to be running a very old version of setuptools.
90 This version of setuptools has a bug parsing dependencies, so automatic
91 dependency resolution is disabled.
94 setup_args['install_requires'] = requirements
95 setup_args['include_package_data'] = True
96 setup_args['zip_safe'] = False
100 if __name__ == "__main__":
103 except KeyboardInterrupt: