Transfers bug patch from orgasm
This commit is contained in:
@ -7,107 +7,109 @@ Created on 13 fevr. 2014
|
|||||||
from distutils import log
|
from distutils import log
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from Cython.Distutils import build_ext as ori_build_ext # @UnresolvedImport
|
|
||||||
|
|
||||||
from Cython.Compiler import Options as cython_options # @UnresolvedImport
|
|
||||||
|
|
||||||
from distutils.errors import DistutilsSetupError
|
from distutils.errors import DistutilsSetupError
|
||||||
|
|
||||||
class build_ext(ori_build_ext):
|
try:
|
||||||
|
from Cython.Distutils import build_ext as ori_build_ext # @UnresolvedImport
|
||||||
|
from Cython.Compiler import Options as cython_options # @UnresolvedImport
|
||||||
|
class build_ext(ori_build_ext):
|
||||||
|
|
||||||
def modifyDocScripts(self):
|
|
||||||
build_dir_file=open("doc/sphinx/build_dir.txt","w")
|
|
||||||
print(self.build_lib,file=build_dir_file)
|
|
||||||
build_dir_file.close()
|
|
||||||
|
|
||||||
def initialize_options(self):
|
def modifyDocScripts(self):
|
||||||
ori_build_ext.initialize_options(self) # @UndefinedVariable
|
build_dir_file=open("doc/sphinx/build_dir.txt","w")
|
||||||
self.littlebigman = None
|
print(self.build_lib,file=build_dir_file)
|
||||||
self.built_files = None
|
build_dir_file.close()
|
||||||
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
ori_build_ext.finalize_options(self) # @UndefinedVariable
|
|
||||||
|
|
||||||
self.set_undefined_options('littlebigman',
|
|
||||||
('littlebigman', 'littlebigman'))
|
|
||||||
|
|
||||||
self.set_undefined_options('build_files',
|
|
||||||
('files', 'built_files'))
|
|
||||||
|
|
||||||
self.cython_c_in_temp = 1
|
|
||||||
|
|
||||||
if self.littlebigman =='-DLITTLE_END':
|
|
||||||
if self.define is None:
|
|
||||||
self.define=[('LITTLE_END',None)]
|
|
||||||
else:
|
|
||||||
self.define.append('LITTLE_END',None)
|
|
||||||
|
|
||||||
def substitute_sources(self,exe_name,sources):
|
|
||||||
"""
|
|
||||||
Substitutes source file name starting by an @ by the actual
|
|
||||||
name of the built file (see --> build_files)
|
|
||||||
"""
|
|
||||||
sources = list(sources)
|
|
||||||
for i in range(len(sources)):
|
|
||||||
message = "%s :-> %s" % (exe_name,sources[i])
|
|
||||||
if sources[i][0]=='@':
|
|
||||||
try:
|
|
||||||
filename = self.built_files[sources[i][1:]]
|
|
||||||
except KeyError:
|
|
||||||
tmpfilename = os.path.join(self.build_temp,sources[i][1:])
|
|
||||||
if os.path.isfile (tmpfilename):
|
|
||||||
filename = tmpfilename
|
|
||||||
else:
|
|
||||||
raise DistutilsSetupError(
|
|
||||||
'The %s filename declared in the source '
|
|
||||||
'files of the program %s have not been '
|
|
||||||
'built by the installation process' % (sources[i],
|
|
||||||
exe_name))
|
|
||||||
sources[i]=filename
|
|
||||||
log.info("%s changed to %s",message,filename)
|
|
||||||
else:
|
|
||||||
log.info("%s ok",message)
|
|
||||||
|
|
||||||
return sources
|
|
||||||
|
|
||||||
def build_extensions(self):
|
|
||||||
# First, sanity-check the 'extensions' list
|
|
||||||
|
|
||||||
for ext in self.extensions:
|
|
||||||
ext.sources = self.substitute_sources(ext.name,ext.sources)
|
|
||||||
|
|
||||||
self.check_extensions_list(self.extensions)
|
def initialize_options(self):
|
||||||
|
ori_build_ext.initialize_options(self) # @UndefinedVariable
|
||||||
for ext in self.extensions:
|
self.littlebigman = None
|
||||||
log.info("%s :-> %s",ext.name,ext.sources)
|
self.built_files = None
|
||||||
ext.sources = self.cython_sources(ext.sources, ext)
|
|
||||||
self.build_extension(ext)
|
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.modifyDocScripts()
|
|
||||||
|
|
||||||
for cmd_name in self.get_sub_commands():
|
|
||||||
self.run_command(cmd_name)
|
|
||||||
|
|
||||||
cython_options.annotate = True
|
|
||||||
ori_build_ext.run(self) # @UndefinedVariable
|
|
||||||
|
|
||||||
|
|
||||||
def has_files(self):
|
|
||||||
return self.distribution.has_files()
|
|
||||||
|
|
||||||
def has_executables(self):
|
|
||||||
return self.distribution.has_executables()
|
|
||||||
|
|
||||||
sub_commands = [('build_files',has_files),
|
|
||||||
('build_cexe', has_executables)
|
|
||||||
] + \
|
|
||||||
ori_build_ext.sub_commands
|
|
||||||
|
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
ori_build_ext.finalize_options(self) # @UndefinedVariable
|
||||||
|
|
||||||
|
self.set_undefined_options('littlebigman',
|
||||||
|
('littlebigman', 'littlebigman'))
|
||||||
|
|
||||||
|
self.set_undefined_options('build_files',
|
||||||
|
('files', 'built_files'))
|
||||||
|
|
||||||
|
self.cython_c_in_temp = 1
|
||||||
|
|
||||||
|
if self.littlebigman =='-DLITTLE_END':
|
||||||
|
if self.define is None:
|
||||||
|
self.define=[('LITTLE_END',None)]
|
||||||
|
else:
|
||||||
|
self.define.append('LITTLE_END',None)
|
||||||
|
|
||||||
|
def substitute_sources(self,exe_name,sources):
|
||||||
|
"""
|
||||||
|
Substitutes source file name starting by an @ by the actual
|
||||||
|
name of the built file (see --> build_files)
|
||||||
|
"""
|
||||||
|
sources = list(sources)
|
||||||
|
for i in range(len(sources)):
|
||||||
|
message = "%s :-> %s" % (exe_name,sources[i])
|
||||||
|
if sources[i][0]=='@':
|
||||||
|
try:
|
||||||
|
filename = self.built_files[sources[i][1:]]
|
||||||
|
except KeyError:
|
||||||
|
tmpfilename = os.path.join(self.build_temp,sources[i][1:])
|
||||||
|
if os.path.isfile (tmpfilename):
|
||||||
|
filename = tmpfilename
|
||||||
|
else:
|
||||||
|
raise DistutilsSetupError(
|
||||||
|
'The %s filename declared in the source '
|
||||||
|
'files of the program %s have not been '
|
||||||
|
'built by the installation process' % (sources[i],
|
||||||
|
exe_name))
|
||||||
|
sources[i]=filename
|
||||||
|
log.info("%s changed to %s",message,filename)
|
||||||
|
else:
|
||||||
|
log.info("%s ok",message)
|
||||||
|
|
||||||
|
return sources
|
||||||
|
|
||||||
|
def build_extensions(self):
|
||||||
|
# First, sanity-check the 'extensions' list
|
||||||
|
|
||||||
|
for ext in self.extensions:
|
||||||
|
ext.sources = self.substitute_sources(ext.name,ext.sources)
|
||||||
|
|
||||||
|
self.check_extensions_list(self.extensions)
|
||||||
|
|
||||||
|
for ext in self.extensions:
|
||||||
|
log.info("%s :-> %s",ext.name,ext.sources)
|
||||||
|
ext.sources = self.cython_sources(ext.sources, ext)
|
||||||
|
self.build_extension(ext)
|
||||||
|
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.modifyDocScripts()
|
||||||
|
|
||||||
|
for cmd_name in self.get_sub_commands():
|
||||||
|
self.run_command(cmd_name)
|
||||||
|
|
||||||
|
cython_options.annotate = True
|
||||||
|
ori_build_ext.run(self) # @UndefinedVariable
|
||||||
|
|
||||||
|
|
||||||
|
def has_files(self):
|
||||||
|
return self.distribution.has_files()
|
||||||
|
|
||||||
|
def has_executables(self):
|
||||||
|
return self.distribution.has_executables()
|
||||||
|
|
||||||
|
sub_commands = [('build_files',has_files),
|
||||||
|
('build_cexe', has_executables)
|
||||||
|
] + \
|
||||||
|
ori_build_ext.sub_commands
|
||||||
|
|
||||||
|
except ImportError:
|
||||||
|
from distutils.command import build_ext # @UnusedImport
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -7,8 +7,13 @@ Created on 2 oct. 2014
|
|||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pip # @UnresolvedImport
|
try:
|
||||||
from pip.utils import get_installed_distributions # @UnresolvedImport
|
import pip # @UnresolvedImport
|
||||||
|
from pip.utils import get_installed_distributions # @UnresolvedImport
|
||||||
|
except ImportError:
|
||||||
|
from .bootstrappip import bootstrap
|
||||||
|
bootstrap()
|
||||||
|
|
||||||
from distutils.version import StrictVersion # @UnusedImport
|
from distutils.version import StrictVersion # @UnusedImport
|
||||||
from distutils.errors import DistutilsError
|
from distutils.errors import DistutilsError
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
@ -59,7 +59,7 @@ def serenity_virtualenv(envname,package,version,minversion='3.4',maxversion=None
|
|||||||
clear=True,
|
clear=True,
|
||||||
symlinks=False,
|
symlinks=False,
|
||||||
with_pip=True)
|
with_pip=True)
|
||||||
|
|
||||||
# check the newly created virtualenv
|
# check the newly created virtualenv
|
||||||
return serenity_virtualenv(envname,package,version)
|
return serenity_virtualenv(envname,package,version)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user