forked from twisted/twisted
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·66 lines (48 loc) · 1.55 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Setuptools installer for Twisted.
"""
import os
import sys
import setuptools
from pkg_resources import parse_requirements
# Tell Twisted not to enforce zope.interface requirement on import, since
# we're going to have to import twisted.python.dist and can rely on
# setuptools to install dependencies.
setuptools._TWISTED_NO_CHECK_REQUIREMENTS = True
def main(args):
"""
Invoke twisted.python.dist with the appropriate metadata about the
Twisted package.
"""
# On Python 3, use setup3.py until Python 3 port is done:
if sys.version_info[0] > 2:
import setup3
setup3.main()
return
if os.path.exists('twisted'):
sys.path.insert(0, '.')
setup_args = {}
requirements = ["zope.interface >= 3.6.0"]
setup_args['install_requires'] = requirements
setup_args['include_package_data'] = True
setup_args['zip_safe'] = False
from twisted.python.dist import (
STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getScripts,
getPackages, setup, _EXTRAS_REQUIRE)
scripts = getScripts()
setup_args.update(dict(
packages=getPackages('twisted'),
conditionalExtensions=getExtensions(),
scripts=scripts,
extras_require=_EXTRAS_REQUIRE,
data_files=getDataFiles('twisted'),
**STATIC_PACKAGE_METADATA))
setup(**setup_args)
if __name__ == "__main__":
try:
main(sys.argv[1:])
except KeyboardInterrupt:
sys.exit(1)