def finalize_options(self): old_build_ext.finalize_options(self) self.sconscripts = [] self.pre_hooks = [] self.post_hooks = [] self.pkg_names = [] self.pkg_paths = [] if self.distribution.has_scons_scripts(): for i in self.distribution.scons_data: self.sconscripts.append(i.scons_path) self.pre_hooks.append(i.pre_hook) self.post_hooks.append(i.post_hook) self.pkg_names.append(i.parent_name) self.pkg_paths.append(i.pkg_path) # This crap is needed to get the build_clib # directory build_clib_cmd = get_cmd("build_clib").get_finalized_command( "build_clib") self.build_clib = build_clib_cmd.build_clib if not self.cxxcompiler: self.cxxcompiler = self.compiler # To avoid trouble, just don't do anything if no sconscripts are used. # This is useful when for example f2py uses numpy.distutils, because # f2py does not pass compiler information to scons command, and the # compilation setup below can crash in some situation. if len(self.sconscripts) > 0: if self.bypass: self.scons_compiler = self.compiler self.scons_fcompiler = self.fcompiler self.scons_cxxcompiler = self.cxxcompiler else: # Try to get the same compiler than the ones used by distutils: this is # non trivial because distutils and scons have totally different # conventions on this one (distutils uses PATH from user's environment, # whereas scons uses standard locations). The way we do it is once we # got the c compiler used, we use numpy.distutils function to get the # full path, and add the path to the env['PATH'] variable in env # instance (this is done in numpy.distutils.scons module). self._init_ccompiler(self.compiler) self._init_fcompiler(self.fcompiler) self._init_cxxcompiler(self.cxxcompiler) if self.package_list: self.package_list = parse_package_list(self.package_list)
def finalize_options(self): old_build_ext.finalize_options(self) self.sconscripts = [] self.pre_hooks = [] self.post_hooks = [] self.pkg_names = [] self.pkg_paths = [] if self.distribution.has_scons_scripts(): for i in self.distribution.scons_data: self.sconscripts.append(i.scons_path) self.pre_hooks.append(i.pre_hook) self.post_hooks.append(i.post_hook) self.pkg_names.append(i.parent_name) self.pkg_paths.append(i.pkg_path) # This crap is needed to get the build_clib # directory build_clib_cmd = get_cmd("build_clib").get_finalized_command("build_clib") self.build_clib = build_clib_cmd.build_clib if not self.cxxcompiler: self.cxxcompiler = self.compiler # To avoid trouble, just don't do anything if no sconscripts are used. # This is useful when for example f2py uses numpy.distutils, because # f2py does not pass compiler information to scons command, and the # compilation setup below can crash in some situation. if len(self.sconscripts) > 0: if self.bypass: self.scons_compiler = self.compiler self.scons_fcompiler = self.fcompiler self.scons_cxxcompiler = self.cxxcompiler else: # Try to get the same compiler than the ones used by distutils: this is # non trivial because distutils and scons have totally different # conventions on this one (distutils uses PATH from user's environment, # whereas scons uses standard locations). The way we do it is once we # got the c compiler used, we use numpy.distutils function to get the # full path, and add the path to the env['PATH'] variable in env # instance (this is done in numpy.distutils.scons module). self._init_ccompiler(self.compiler) self._init_fcompiler(self.fcompiler) self._init_cxxcompiler(self.cxxcompiler) if self.package_list: self.package_list = parse_package_list(self.package_list)
def finalize_options(self): build_ext.finalize_options(self) self.web_ext_modules = self.distribution.web_ext_modules if self.pyjspath is None: try: import pyjs # pylint: disable=F0401 self.pyjspath = os.path.dirname(pyjs.__file__) except ImportError: pass else: sys.path.insert(0, os.path.join(self.pyjspath, 'build', 'lib')) if self.pyjscompiler is None: try: self.pyjscompiler = find_program('pyjsbuild', [self.pyjspath]) except ConfigError: pass ## defer resolution
def finalize_options(self): build_ext.finalize_options(self) self.web_ext_modules = self.distribution.web_ext_modules if self.pyjspath is None: try: import pyjs self.pyjspath = os.path.dirname(pyjs.__file__) except: pass else: sys.path.insert(0, os.path.join(self.pyjspath, "build", "lib")) if self.pyjscompiler is None: try: self.pyjscompiler = find_program("pyjsbuild", [self.pyjspath]) except: pass
def finalize_options(self): old_build_ext.finalize_options(self) if self.distribution.has_scons_scripts(): self.sconscripts = self.distribution.get_scons_scripts() self.pre_hooks = self.distribution.get_scons_pre_hooks() self.post_hooks = self.distribution.get_scons_post_hooks() self.pkg_names = self.distribution.get_scons_parent_names() else: self.sconscripts = [] self.pre_hooks = [] self.post_hooks = [] self.pkg_names = [] # Try to get the same compiler than the ones used by distutils: this is # non trivial because distutils and scons have totally different # conventions on this one (distutils uses PATH from user's environment, # whereas scons uses standard locations). The way we do it is once we # got the c compiler used, we use numpy.distutils function to get the # full path, and add the path to the env['PATH'] variable in env # instance (this is done in numpy.distutils.scons module). # XXX: The logic to bypass distutils is ... not so logic. compiler_type = self.compiler if compiler_type == 'msvc': self._bypass_distutils_cc = True from numpy.distutils.ccompiler import new_compiler try: distutils_compiler = new_compiler(compiler=compiler_type, verbose=self.verbose, dry_run=self.dry_run, force=self.force) distutils_compiler.customize(self.distribution) # This initialization seems necessary, sometimes, for find_executable to work... if hasattr(distutils_compiler, 'initialize'): distutils_compiler.initialize() self.scons_compiler = dist2sconscc(distutils_compiler) self.scons_compiler_path = protect_path( get_tool_path(distutils_compiler)) except DistutilsPlatformError, e: if not self._bypass_distutils_cc: raise e else: self.scons_compiler = compiler_type
def finalize_options(self): old_build_ext.finalize_options(self) if self.distribution.has_scons_scripts(): self.sconscripts = self.distribution.get_scons_scripts() self.pre_hooks = self.distribution.get_scons_pre_hooks() self.post_hooks = self.distribution.get_scons_post_hooks() self.pkg_names = self.distribution.get_scons_parent_names() else: self.sconscripts = [] self.pre_hooks = [] self.post_hooks = [] self.pkg_names = [] # Try to get the same compiler than the ones used by distutils: this is # non trivial because distutils and scons have totally different # conventions on this one (distutils uses PATH from user's environment, # whereas scons uses standard locations). The way we do it is once we # got the c compiler used, we use numpy.distutils function to get the # full path, and add the path to the env['PATH'] variable in env # instance (this is done in numpy.distutils.scons module). # XXX: The logic to bypass distutils is ... not so logic. compiler_type = self.compiler if compiler_type == 'msvc': self._bypass_distutils_cc = True from numpy.distutils.ccompiler import new_compiler try: distutils_compiler = new_compiler(compiler=compiler_type, verbose=self.verbose, dry_run=self.dry_run, force=self.force) distutils_compiler.customize(self.distribution) # This initialization seems necessary, sometimes, for find_executable to work... if hasattr(distutils_compiler, 'initialize'): distutils_compiler.initialize() self.scons_compiler = dist2sconscc(distutils_compiler) self.scons_compiler_path = protect_path(get_tool_path(distutils_compiler)) except DistutilsPlatformError, e: if not self._bypass_distutils_cc: raise e else: self.scons_compiler = compiler_type
def finalize_options(self): old_build_ext.finalize_options(self) if self.distribution.has_scons_scripts(): self.sconscripts = self.distribution.get_scons_scripts() self.pre_hooks = self.distribution.get_scons_pre_hooks() self.post_hooks = self.distribution.get_scons_post_hooks() self.pkg_names = self.distribution.get_scons_parent_names() else: self.sconscripts = [] self.pre_hooks = [] self.post_hooks = [] self.pkg_names = [] # To avoid trouble, just don't do anything if no sconscripts are used. # This is useful when for example f2py uses numpy.distutils, because # f2py does not pass compiler information to scons command, and the # compilation setup below can crash in some situation. if len(self.sconscripts) > 0: # Try to get the same compiler than the ones used by distutils: this is # non trivial because distutils and scons have totally different # conventions on this one (distutils uses PATH from user's environment, # whereas scons uses standard locations). The way we do it is once we # got the c compiler used, we use numpy.distutils function to get the # full path, and add the path to the env['PATH'] variable in env # instance (this is done in numpy.distutils.scons module). # XXX: The logic to bypass distutils is ... not so logic. compiler_type = self.compiler if compiler_type == 'msvc': self._bypass_distutils_cc = True from numpy.distutils.ccompiler import new_compiler try: distutils_compiler = new_compiler(compiler=compiler_type, verbose=self.verbose, dry_run=self.dry_run, force=self.force) distutils_compiler.customize(self.distribution) # This initialization seems necessary, sometimes, for find_executable to work... if hasattr(distutils_compiler, 'initialize'): distutils_compiler.initialize() self.scons_compiler = dist2sconscc(distutils_compiler) self.scons_compiler_path = protect_path( get_tool_path(distutils_compiler)) except DistutilsPlatformError, e: if not self._bypass_distutils_cc: raise e else: self.scons_compiler = compiler_type # We do the same for the fortran compiler ... fcompiler_type = self.fcompiler from numpy.distutils.fcompiler import new_fcompiler self.fcompiler = new_fcompiler(compiler=fcompiler_type, verbose=self.verbose, dry_run=self.dry_run, force=self.force) if self.fcompiler is not None: self.fcompiler.customize(self.distribution) # And the C++ compiler cxxcompiler = new_compiler(compiler=compiler_type, verbose=self.verbose, dry_run=self.dry_run, force=self.force) if cxxcompiler is not None: cxxcompiler.customize(self.distribution, need_cxx=1) cxxcompiler.customize_cmd(self) self.cxxcompiler = cxxcompiler.cxx_compiler() try: get_cxx_tool_path(self.cxxcompiler) except DistutilsSetupError: self.cxxcompiler = None if self.package_list: self.package_list = parse_package_list(self.package_list)
def finalize_options(self): old_build_ext.finalize_options(self) if self.distribution.has_scons_scripts(): self.sconscripts = self.distribution.get_scons_scripts() self.pre_hooks = self.distribution.get_scons_pre_hooks() self.post_hooks = self.distribution.get_scons_post_hooks() self.pkg_names = self.distribution.get_scons_parent_names() else: self.sconscripts = [] self.pre_hooks = [] self.post_hooks = [] self.pkg_names = [] # To avoid trouble, just don't do anything if no sconscripts are used. # This is useful when for example f2py uses numpy.distutils, because # f2py does not pass compiler information to scons command, and the # compilation setup below can crash in some situation. if len(self.sconscripts) > 0: # Try to get the same compiler than the ones used by distutils: this is # non trivial because distutils and scons have totally different # conventions on this one (distutils uses PATH from user's environment, # whereas scons uses standard locations). The way we do it is once we # got the c compiler used, we use numpy.distutils function to get the # full path, and add the path to the env['PATH'] variable in env # instance (this is done in numpy.distutils.scons module). # XXX: The logic to bypass distutils is ... not so logic. compiler_type = self.compiler if compiler_type == 'msvc': self._bypass_distutils_cc = True from numpy.distutils.ccompiler import new_compiler try: distutils_compiler = new_compiler(compiler=compiler_type, verbose=self.verbose, dry_run=self.dry_run, force=self.force) distutils_compiler.customize(self.distribution) # This initialization seems necessary, sometimes, for find_executable to work... if hasattr(distutils_compiler, 'initialize'): distutils_compiler.initialize() self.scons_compiler = dist2sconscc(distutils_compiler) self.scons_compiler_path = protect_path(get_tool_path(distutils_compiler)) except DistutilsPlatformError, e: if not self._bypass_distutils_cc: raise e else: self.scons_compiler = compiler_type # We do the same for the fortran compiler ... fcompiler_type = self.fcompiler from numpy.distutils.fcompiler import new_fcompiler self.fcompiler = new_fcompiler(compiler = fcompiler_type, verbose = self.verbose, dry_run = self.dry_run, force = self.force) if self.fcompiler is not None: self.fcompiler.customize(self.distribution) # And the C++ compiler cxxcompiler = new_compiler(compiler = compiler_type, verbose = self.verbose, dry_run = self.dry_run, force = self.force) if cxxcompiler is not None: cxxcompiler.customize(self.distribution, need_cxx = 1) cxxcompiler.customize_cmd(self) self.cxxcompiler = cxxcompiler.cxx_compiler() try: get_cxx_tool_path(self.cxxcompiler) except DistutilsSetupError: self.cxxcompiler = None if self.package_list: self.package_list = parse_package_list(self.package_list)
def finalize_options(self): build_ext.finalize_options(self) self.include_dirs.append(numpy.get_include())
def finalize_options(self): build_ext.finalize_options(self) self.include_dirs.append(numpy.get_include())
def finalize_options(self): _build_ext.finalize_options(self)