mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 01:19:26 +01:00
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:
parent
6c7aec165f
commit
7203ac383d
26
setup.py
26
setup.py
@ -38,16 +38,8 @@ if sys.version_info < (2, 6, 0):
|
|||||||
sys.stderr.write(os.linesep)
|
sys.stderr.write(os.linesep)
|
||||||
sys.exit(-1)
|
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 os.path
|
||||||
|
import textwrap
|
||||||
|
|
||||||
from src.version import version
|
from src.version import version
|
||||||
|
|
||||||
@ -58,8 +50,7 @@ def normalizeWhitespace(s):
|
|||||||
return ' '.join(s.split())
|
return ' '.join(s.split())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from distutils.core import setup
|
from setuptools import setup
|
||||||
from distutils.sysconfig import get_python_lib
|
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
s = normalizeWhitespace("""Supybot requires the distutils package to
|
s = normalizeWhitespace("""Supybot requires the distutils package to
|
||||||
install. This package is normally included with Python, but for some
|
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.stderr.write(os.linesep*2)
|
||||||
sys.exit(-1)
|
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',
|
packages = ['supybot',
|
||||||
'supybot.utils',
|
'supybot.utils',
|
||||||
'supybot.drivers',
|
'supybot.drivers',
|
||||||
@ -141,7 +122,8 @@ setup(
|
|||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'Operating System :: POSIX',
|
'Operating System :: POSIX',
|
||||||
'Operating System :: Microsoft :: Windows',
|
'Operating System :: Microsoft :: Windows',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python :: 2.6',
|
||||||
|
'Programming Language :: Python :: 2.7',
|
||||||
],
|
],
|
||||||
|
|
||||||
# Installation data
|
# Installation data
|
||||||
|
Loading…
Reference in New Issue
Block a user