forked from twisted/twisted
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup3.py
52 lines (37 loc) · 1.38 KB
/
setup3.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
#!/usr/bin/env python3.3
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# This is a temporary helper to be able to build and install distributions of
# Twisted on/for Python 3. Once all of Twisted has been ported, it should go
# away and setup.py should work for either Python 2 or Python 3.
from __future__ import division, absolute_import
import sys
import os
from distutils.command.sdist import sdist
class DisabledSdist(sdist):
"""
A version of the sdist command that does nothing.
"""
def run(self):
sys.stderr.write(
"The sdist command only works with Python 2 at the moment.\n")
sys.exit(1)
def main():
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Make sure the to-be-installed version of Twisted is used, if available,
# since we're importing from it:
if os.path.exists('twisted'):
sys.path.insert(0, '.')
from twisted.python.dist3 import modulesToInstall
from twisted.python.dist import STATIC_PACKAGE_METADATA
args = STATIC_PACKAGE_METADATA.copy()
args['install_requires'] = ["zope.interface >= 4.0.2"]
args['classifiers'] = ["Programming Language :: Python :: 3.3"]
args['py_modules'] = modulesToInstall
args['cmdclass'] = {'sdist': DisabledSdist}
setup(**args)
if __name__ == "__main__":
main()