|
35 | 35 | import sys |
36 | 36 | import time |
37 | 37 | import warnings |
38 | | -import datetime |
39 | | -import tempfile |
40 | 38 | import subprocess |
41 | 39 |
|
| 40 | +from setuptools import setup |
| 41 | + |
42 | 42 | warnings.filterwarnings('always', category=DeprecationWarning) |
43 | 43 |
|
44 | 44 | debug = '--debug' in sys.argv |
|
97 | 97 | sys.stderr.write('====================================================\n') |
98 | 98 | time.sleep(60) |
99 | 99 |
|
100 | | -import textwrap |
101 | | - |
102 | | -clean = False |
103 | | -while '--clean' in sys.argv: |
104 | | - clean = True |
105 | | - sys.argv.remove('--clean') |
106 | | - |
107 | | -import glob |
108 | | -import shutil |
109 | | -import os |
110 | | - |
111 | | - |
112 | 100 | plugins = [s for s in os.listdir('plugins') if |
113 | 101 | os.path.exists(os.path.join('plugins', s, 'plugin.py'))] |
114 | 102 |
|
115 | 103 | def normalizeWhitespace(s): |
116 | 104 | return ' '.join(s.split()) |
117 | 105 |
|
118 | | -try: |
119 | | - from distutils.core import setup |
120 | | - from distutils.sysconfig import get_python_lib |
121 | | -except ImportError as e: |
122 | | - s = normalizeWhitespace("""Supybot requires the distutils package to |
123 | | - install. This package is normally included with Python, but for some |
124 | | - unfathomable reason, many distributions to take it out of standard Python |
125 | | - and put it in another package, usually caled 'python-dev' or python-devel' |
126 | | - or something similar. This is one of the dumbest things a distribution can |
127 | | - do, because it means that developers cannot rely on *STANDARD* Python |
128 | | - modules to be present on systems of that distribution. Complain to your |
129 | | - distribution, and loudly. If you how much of our time we've wasted telling |
130 | | - people to install what should be included by default with Python you'd |
131 | | - understand why we're unhappy about this. Anyway, to reiterate, install the |
132 | | - development package for Python that your distribution supplies.""") |
133 | | - sys.stderr.write(os.linesep*2) |
134 | | - sys.stderr.write(textwrap.fill(s)) |
135 | | - sys.stderr.write(os.linesep*2) |
136 | | - sys.exit(-1) |
137 | | - |
138 | | - |
139 | | -if clean: |
140 | | - previousInstall = os.path.join(get_python_lib(), 'supybot') |
141 | | - if os.path.exists(previousInstall): |
142 | | - try: |
143 | | - print('Removing current installation.') |
144 | | - shutil.rmtree(previousInstall) |
145 | | - except Exception as e: |
146 | | - print('Couldn\'t remove former installation: %s' % e) |
147 | | - sys.exit(-1) |
148 | | - |
149 | 106 | packages = ['supybot', |
150 | 107 | 'supybot.locales', |
151 | 108 | 'supybot.utils', |
|
0 commit comments