当前位置: 首页>>代码示例>>Python>>正文


Python build_ext.run函数代码示例

本文整理汇总了Python中setuptools.command.build_ext.build_ext.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

 def run(self):
     try:
         _build_ext.run(self)
     except CompileError:
         warn('Failed to build extension modules')
         import traceback
         print(traceback.format_exc(), file=sys.stderr)
开发者ID:chiaolun,项目名称:pyhsmm,代码行数:7,代码来源:setup.py

示例2: run

 def run(self):
     # Import numpy here, only when headers are needed
     import numpy
     # Add numpy headers to include_dirs
     self.include_dirs.append(numpy.get_include())
     # Call original build_ext command
     build_ext.run(self)
开发者ID:jakobrunge,项目名称:tigramite,代码行数:7,代码来源:setup.py

示例3: run

 def run(self):
     if not self.dry_run:
         import numpy
         import bohrium_api
         for ext in self.extensions:
             ext.include_dirs.extend([numpy.get_include(), bohrium_api.get_include()])
     setup_build_ext.run(self)
开发者ID:madsbk,项目名称:bohrium,代码行数:7,代码来源:setup.py

示例4: run

    def run(self):
        """Run extension builder."""
        if "%x" % sys.maxsize != '7fffffffffffffff':
            raise DistutilsPlatformError("%s require 64-bit operating system" %
                                         SETUP_METADATA["packages"])

        if "z" not in self.libraries:
            zcmd = ['bash', '-c', 'cd ' + ZLIBDIR + ' && ( test Makefile -nt'
                    ' configure || bash ./configure --static ) && make -f '
                    'Makefile.pic PIC']
            spawn(cmd=zcmd, dry_run=self.dry_run)
            self.extensions[0].extra_objects.extend(
                path_join("third-party", "zlib", bn + ".lo") for bn in [
                    "adler32", "compress", "crc32", "deflate", "gzclose",
                    "gzlib", "gzread", "gzwrite", "infback", "inffast",
                    "inflate", "inftrees", "trees", "uncompr", "zutil"])
        if "bz2" not in self.libraries:
            bz2cmd = ['bash', '-c', 'cd ' + BZIP2DIR + ' && make -f '
                      'Makefile-libbz2_so all']
            spawn(cmd=bz2cmd, dry_run=self.dry_run)
            self.extensions[0].extra_objects.extend(
                path_join("third-party", "bzip2", bn + ".o") for bn in [
                    "blocksort", "huffman", "crctable", "randtable",
                    "compress", "decompress", "bzlib"])
        _build_ext.run(self)
开发者ID:ofanoyi,项目名称:khmer,代码行数:25,代码来源:setup.py

示例5: run

    def run(self):
        inst_gdal_version = self.get_gdal_config('version')
        if inst_gdal_version != GDAL_VERSION:
            raise GDALConfigError('Version mismatch %s != %s' % (
                inst_gdal_version, GDAL_VERSION))

        build_ext.run(self)
开发者ID:cquest,项目名称:pygdal,代码行数:7,代码来源:setup.py

示例6: run

    def run(self):
        # Run others commands

        self.run_command("scons")
        self.run_command("cmake")

        # Add lib_dirs and include_dirs in packages
        # Copy the directories containing the files generated
        # by scons and the like.
        if is_conda_build():
            print('Building directly with conda. Skip the bin, include and lib dirs.')
            return old_build_ext.run(self)

        for d in (self.distribution.lib_dirs,
                  self.distribution.inc_dirs,
                  self.distribution.bin_dirs,
                  # self.distribution.share_dirs,
                  ):

            if (not d or self.inplace == 1):
                continue

            if (not os.path.exists(self.build_lib)):
                self.mkpath(self.build_lib)

            for (name, dir) in d.items():
                copy_data_tree(dir, pj(self.build_lib, name))

        return old_build_ext.run(self)
开发者ID:openalea,项目名称:deploy,代码行数:29,代码来源:command.py

示例7: run

            def run(self):
                # Bail out if we don't have the Python include files
                include_dir = get_python_inc()
                if not os.path.isfile(os.path.join(include_dir, "Python.h")):
                    print("You will need the Python headers to compile this extension.")
                    sys.exit(1)

                # Print a warning if pkg-config is not available or does not know about igraph
                if buildcfg.use_pkgconfig:
                    detected = buildcfg.detect_from_pkgconfig()
                else:
                    detected = False

                # Check whether we have already compiled igraph in a previous run.
                # If so, it should be found in igraphcore/include and
                # igraphcore/lib
                if os.path.exists("igraphcore"):
                    buildcfg.use_built_igraph()
                    detected = True

                # Download and compile igraph if the user did not disable it and
                # we do not know the libraries from pkg-config yet
                if not detected:
                    if buildcfg.download_igraph_if_needed and is_unix_like():
                        detected = buildcfg.download_and_compile_igraph()
                        if detected:
                            buildcfg.use_built_igraph()
                        else:
                            sys.exit(1)

                # Fall back to an educated guess if everything else failed
                if not detected:
                    buildcfg.use_educated_guess()

                # Replaces library names with full paths to static libraries
                # where possible. libm.a is excluded because it caused problems
                # on Sabayon Linux where libm.a is probably not compiled with
                # -fPIC
                if buildcfg.static_extension:
                    buildcfg.replace_static_libraries(exclusions=["m"])

                # Prints basic build information
                buildcfg.print_build_info()

                ext = first(extension for extension in self.extensions
                        if extension.name == "igraph._igraph")
                buildcfg.configure(ext)

                # Run any pre-build hooks
                for hook in buildcfg.pre_build_hooks:
                    hook(self)

                # Run the original build_ext command
                build_ext.run(self)

                # Run any post-build hooks
                for hook in buildcfg.post_build_hooks:
                    hook(self)
开发者ID:abe-winter,项目名称:python-igraph,代码行数:58,代码来源:setup.py

示例8: run

 def run(self):
     try:
         build_ext.run(self)
     except Exception:
         e = sys.exc_info()[1]
         sys.stdout.write('%s\n' % str(e))
         warnings.warn(self.warning_message +
             "Extension modules" +
             "There was an issue with your platform configuration - see above.")
开发者ID:nonva,项目名称:gensim,代码行数:9,代码来源:setup.py

示例9: run

 def run(self):
     try:
         self.generate_c_file()
     except DistutilsPlatformError:
         if os.path.exists("polycomp/speedups.c"):
             print("Found existing C file, ignoring errors.")
         else:
             raise
     build_ext.run(self)
开发者ID:Mapkin,项目名称:polycomp,代码行数:9,代码来源:setup.py

示例10: run

 def run(self):
     try:
         build_ext.run(self)
     except Exception as e:
         warnings.warn('''
         Unable to build speedups module, defaulting to pure Python. Note
         that the pure Python version is more than fast enough in most cases
         %r
         ''' % e)
开发者ID:WoLpH,项目名称:numpy-stl,代码行数:9,代码来源:setup.py

示例11: run

    def run(self):
        BuildExtCommand.run(self)

        # If we are not a light build we want to also execute build_js as
        # part of our build_ext pipeline.  Because setuptools subclasses
        # this thing really oddly we cannot use sub_commands but have to
        # manually invoke it here.
        if not IS_LIGHT_BUILD:
            self.run_command('build_js')
开发者ID:paveldedik,项目名称:sentry,代码行数:9,代码来源:setup.py

示例12: run

    def run(self):
        return_code = subprocess.call(['./build_libpg_query.sh'])
        if return_code:
            sys.stderr.write('''
An error occurred during extension building.
Make sure you have bison and flex installed on your system.
''')
            sys.exit(return_code)
        build_ext.run(self)
开发者ID:alculquicondor,项目名称:psqlparse,代码行数:9,代码来源:setup.py

示例13: run

 def run(self):
     build_ext.run(self)
     cmd = [sys.executable, os.path.join(here_dir, 'ffi', 'build.py')]
     spawn(cmd, dry_run=self.dry_run)
     # HACK: this makes sure the library file (which is large) is only
     # included in binary builds, not source builds.
     self.distribution.package_data = {
         "llvmlite.binding": get_library_files(),
     }
开发者ID:RazerM,项目名称:llvmlite,代码行数:9,代码来源:setup.py

示例14: run

 def run(self):
     build_ext.run(self)
     cmd = [sys.executable, os.path.join(here_dir, 'build.py')]
     spawn(cmd, dry_run=self.dry_run)
     # HACK: this makes sure the library file (which is large) is only
     # included in binary builds, not source builds.
     self.distribution.package_data = {
         "libqemu.binding": ["*.dll", "*.so", "*.dylib"]
     }
开发者ID:zaddach,项目名称:libqemu-python,代码行数:9,代码来源:setup.py

示例15: run

	def run(self):
		self._run_config_if_needed()
		self._check_prefix_modified()
		self._configure_compiler()
		
		log.info('include dirs: %r', self.include_dirs)
		log.info('library dirs: %r', self.library_dirs)
		
		_build_ext.run(self)
开发者ID:rsms,项目名称:smisk,代码行数:9,代码来源:setup.py


注:本文中的setuptools.command.build_ext.build_ext.run函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。