setup.py: Use setuptools instead of distutils

This will allow us to automatically install dependencies with easy_install
instead of shipping stale copies with Supybot

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
James McCoy 2012-09-10 22:25:54 -04:00
parent 6c7aec165f
commit 7203ac383d

View File

@ -38,16 +38,8 @@ if sys.version_info < (2, 6, 0):
sys.stderr.write(os.linesep)
sys.exit(-1)
import textwrap
clean = False
while '--clean' in sys.argv:
clean = True
sys.argv.remove('--clean')
import glob
import shutil
import os.path
import textwrap
from src.version import version
@ -58,8 +50,7 @@ def normalizeWhitespace(s):
return ' '.join(s.split())
try:
from distutils.core import setup
from distutils.sysconfig import get_python_lib
from setuptools import setup
except ImportError, e:
s = normalizeWhitespace("""Supybot requires the distutils package to
install. This package is normally included with Python, but for some
@ -77,16 +68,6 @@ except ImportError, e:
sys.stderr.write(os.linesep*2)
sys.exit(-1)
if clean:
previousInstall = os.path.join(get_python_lib(), 'supybot')
if os.path.exists(previousInstall):
try:
print 'Removing current installation.'
shutil.rmtree(previousInstall)
except Exception, e:
print 'Couldn\'t remove former installation: %s' % e
sys.exit(-1)
packages = ['supybot',
'supybot.utils',
'supybot.drivers',
@ -141,7 +122,8 @@ setup(
'Operating System :: OS Independent',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
# Installation data