Patch few bugs in distutils.ext.
This version seems able to install at list the empty package
This commit is contained in:
@ -23,22 +23,7 @@ from distutils import log
|
||||
|
||||
from obidistutils.dist import Distribution
|
||||
|
||||
from obidistutils.command.build import build
|
||||
from obidistutils.command.littlebigman import littlebigman
|
||||
from obidistutils.command.build_cexe import build_cexe
|
||||
from obidistutils.command.build_sphinx import build_sphinx
|
||||
from obidistutils.command import build_ext
|
||||
from obidistutils.command.build_ctools import build_ctools
|
||||
from obidistutils.command.build_files import build_files
|
||||
from obidistutils.command.build_scripts import build_scripts
|
||||
from obidistutils.command.install_scripts import install_scripts
|
||||
from obidistutils.command.install_sphinx import install_sphinx
|
||||
from obidistutils.command.install import install
|
||||
from obidistutils.command.pidname import pidname
|
||||
from obidistutils.command.sdist import sdist
|
||||
|
||||
|
||||
|
||||
def findPackage(root,base=None):
|
||||
modules=[]
|
||||
if base is None:
|
||||
@ -89,19 +74,37 @@ def findCython(root,base=None,pyrexs=None):
|
||||
def rootname(x):
|
||||
return os.path.splitext(x.sources[0])[0]
|
||||
|
||||
COMMANDS = {'build':build,
|
||||
'littlebigman':littlebigman,
|
||||
'pidname':pidname,
|
||||
'build_ctools':build_ctools,
|
||||
'build_files':build_files,
|
||||
'build_cexe':build_cexe,
|
||||
'build_ext': build_ext,
|
||||
'build_scripts':build_scripts,
|
||||
'build_sphinx':build_sphinx,
|
||||
'install_scripts':install_scripts,
|
||||
'install_sphinx':install_sphinx,
|
||||
'install':install,
|
||||
'sdist':sdist}
|
||||
|
||||
def prepare_commands():
|
||||
from obidistutils.command.build import build
|
||||
from obidistutils.command.littlebigman import littlebigman
|
||||
from obidistutils.command.build_cexe import build_cexe
|
||||
from obidistutils.command.build_sphinx import build_sphinx
|
||||
from obidistutils.command import build_ext
|
||||
from obidistutils.command.build_ctools import build_ctools
|
||||
from obidistutils.command.build_files import build_files
|
||||
from obidistutils.command.build_scripts import build_scripts
|
||||
from obidistutils.command.install_scripts import install_scripts
|
||||
from obidistutils.command.install_sphinx import install_sphinx
|
||||
from obidistutils.command.install import install
|
||||
from obidistutils.command.pidname import pidname
|
||||
from obidistutils.command.sdist import sdist
|
||||
|
||||
COMMANDS = {'build':build,
|
||||
'littlebigman':littlebigman,
|
||||
'pidname':pidname,
|
||||
'build_ctools':build_ctools,
|
||||
'build_files':build_files,
|
||||
'build_cexe':build_cexe,
|
||||
'build_ext': build_ext,
|
||||
'build_scripts':build_scripts,
|
||||
'build_sphinx':build_sphinx,
|
||||
'install_scripts':install_scripts,
|
||||
'install_sphinx':install_sphinx,
|
||||
'install':install,
|
||||
'sdist':sdist}
|
||||
|
||||
return COMMANDS
|
||||
|
||||
|
||||
CTOOLS =[]
|
||||
@ -110,16 +113,40 @@ FILES =[]
|
||||
|
||||
def setup(**attrs):
|
||||
|
||||
minversion = attrs.get("PYTHONMIN",'3.4')
|
||||
maxversion = attrs.get('PYTHONMAX',None)
|
||||
fork = attrs.get('FORK',False)
|
||||
requirementfile = attrs.get('REQUIREMENTS','requirements.txt')
|
||||
log.set_threshold(log.INFO)
|
||||
|
||||
minversion = attrs.get("pythonmin",'3.4')
|
||||
maxversion = attrs.get('pythonmax',None)
|
||||
fork = attrs.get('fork',False)
|
||||
requirementfile = attrs.get('requirements','requirements.txt')
|
||||
|
||||
try:
|
||||
del attrs['pythonmin']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
del attrs['pythonmax']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
del attrs['fork']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
del attrs['requirements']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
enforce_good_python(minversion, maxversion, fork)
|
||||
|
||||
if (install_requirements(requirementfile)):
|
||||
rerun_with_anothe_python(sys.executable,minversion,maxversion,fork)
|
||||
|
||||
|
||||
try:
|
||||
check_requirements(requirementfile)
|
||||
except RequirementError as e :
|
||||
@ -145,7 +172,7 @@ def setup(**attrs):
|
||||
attrs['packages'] = findPackage(SRC)
|
||||
|
||||
if 'cmdclass' not in attrs:
|
||||
attrs['cmdclass'] = COMMANDS
|
||||
attrs['cmdclass'] = prepare_commands()
|
||||
|
||||
if 'ctools' not in attrs:
|
||||
attrs['ctools'] = CTOOLS
|
||||
|
Reference in New Issue
Block a user