mirror of
https://github.com/wassname/pyreadline.git
synced 2026-08-18 12:20:32 +08:00
setup now have 2to3 sequence that functionality depend on distribute package.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#*****************************************************************************
|
||||
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
|
||||
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
|
||||
@@ -16,7 +17,24 @@ import glob
|
||||
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
|
||||
#
|
||||
|
||||
from distutils.core import setup
|
||||
extra = {}
|
||||
_distribute = False
|
||||
|
||||
try:
|
||||
import setuptools
|
||||
setup = setuptools.setup
|
||||
_distribute = getattr(setuptools, '_distribute', False)
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
if _distribute == False:
|
||||
raise RuntimeError('You must installed `distribute` to setup pyreadline with Python3')
|
||||
|
||||
extra.update(
|
||||
use_2to3=True
|
||||
)
|
||||
|
||||
exec(compile(open('pyreadline/release.py').read(), 'pyreadline/release.py', 'exec'))
|
||||
|
||||
try:
|
||||
@@ -50,5 +68,6 @@ setup(name=name,
|
||||
package_data = {'pyreadline':['configuration/*']},
|
||||
data_files = [],
|
||||
cmdclass = cmd_class,
|
||||
**extra
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user