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


Python Compiler.Main类代码示例

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


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

示例1: cycompile

def cycompile(input_file, options=()):
    from Cython.Compiler import Version, CmdLine, Main
    options, sources = CmdLine.parse_command_line(list(options or ()) + ['--embed', input_file])
    _debug('Using Cython %s to compile %s', Version.version, input_file)
    result = Main.compile(sources, options)
    if result.num_errors > 0:
        sys.exit(1)
开发者ID:7kbird,项目名称:chrome,代码行数:7,代码来源:BuildExecutable.py

示例2: generate_c_from_cython

    def generate_c_from_cython(extension, build_dir):
        if not sys.platform == 'darwin':
            print 'No %s will be built for this platform.' % (extension.name)
            return
        from distutils.dep_util import newer_group
        name = extension.name.split('.')[-1]
        source = extension.depends[0]
        target = os.path.join(build_dir, name+'.c')

        if newer_group(extension.depends, target):
            from Cython.Compiler import Main
            options = Main.CompilationOptions(
                defaults=Main.default_options,
                output_file=target)
            cython_result = Main.compile(source, options=options)
            if cython_result.num_errors != 0:
                raise RuntimeError("%d errors in Cython compile" %
                    cython_result.num_errors)
        return target
开发者ID:pib,项目名称:enable,代码行数:19,代码来源:setup.py

示例3: cython_extension

def cython_extension(srcfile):
    options = Main.CompilationOptions(include_path=[os.path.join(os.path.abspath(os.path.dirname(__file__)), 'include')])
    Main.compile(srcfile, options=options)
开发者ID:amitibo,项目名称:regreg,代码行数:3,代码来源:setup.py

示例4: print

    cmdclass['build_ext'] = build_pyx
else:
    ext.sources[0] = 'fplib.cpp'

# This silly hack, inspired by the pymt setup.py, runs Cython if we're
# doing a source distribution. The MANIFEST.in file ensures that the
# C++ source is included in the tarball also.
if 'sdist' in sys.argv:
    if not HAVE_CYTHON:
        print('We need Cython to build a source distribution.')
        sys.exit(1)
    from Cython.Compiler import Main
    source = ext.sources[0] # hacky!
    Main.compile(
        source,
        cplus = True,
        full_module_name = ext.name,
    )

setup(
    name = 'pylastfp',
    version = '0.6',
    description = "bindings for Last.fm's acoustic fingerprinting (fplib)",
    author = 'Adrian Sampson',
    author_email = '[email protected]',
    url = 'http://github.com/sampsyo/pylastfp/',
    license = 'LGPL',
    platforms = 'ALL',
    long_description = _read('README.rst'),
    classifiers = [
        'Topic :: Multimedia :: Sound/Audio :: Analysis',
开发者ID:beetbox,项目名称:pylastfp,代码行数:31,代码来源:setup.py

示例5: cythonize_all

def cythonize_all(relpath):
    """Cythonize all Cython modules in relative path"""
    from Cython.Compiler import Main
    for fname in os.listdir(relpath):
        if osp.splitext(fname)[1] == '.pyx':
            Main.compile(osp.join(relpath, fname))
开发者ID:artillan,项目名称:guidata,代码行数:6,代码来源:utils.py

示例6: __init__

 def __init__(self, *args, **kwargs):
   for src in glob('timeuuid/*.pyx'):
     print src
     Main.compile(glob('timeuuid/*.pyx'),
                  Main.default_options)
   sdist.__init__(self, *args, **kwargs)
开发者ID:chisrcastro,项目名称:python-timeuuid,代码行数:6,代码来源:setup.py

示例7: __init__

 def __init__(self, *args, **kwargs):
     for src in glob('borg/*.pyx'):
         cython_compiler.compile(src, cython_compiler.default_options)
     super().__init__(*args, **kwargs)
开发者ID:Herover,项目名称:borg,代码行数:4,代码来源:setup.py

示例8: __init__

 def __init__(self, *args, **kwargs):
     for src in glob('msgpack/*.pyx'):
         cython_compiler.compile(glob('msgpack/*.pyx'),
                                 cython_compiler.default_options)
     sdist.__init__(self, *args, **kwargs)
开发者ID:Keith-Redding,项目名称:msgpack,代码行数:5,代码来源:setup.py

示例9: __init__

 def __init__(self, *args, **kwargs):
     for src in glob('borg/*.pyx'):
         cython_compiler.compile(src, cython_compiler.default_options)
     versioneer.cmd_sdist.__init__(self, *args, **kwargs)
开发者ID:brodul,项目名称:borg,代码行数:4,代码来源:setup.py

示例10:

    pypissh.monkeypatch()

DEBUG = False

src_dir = 'src'
ext_dir = os.path.join(src_dir,'ext')
build_dir = 'build'
cchardet_dir = os.path.join(src_dir,'cchardet/')
charsetdetect_dir = os.path.join(ext_dir, 'libcharsetdetect/')
nspr_emu_dir = os.path.join(charsetdetect_dir,"nspr-emu/")
uchardet_dir = os.path.join(charsetdetect_dir,"mozilla/extensions/universalchardet/src/base/")

if have_cython:
    pyx_sources = glob.glob(cchardet_dir+'*.pyx')
    sys.stderr.write("cythonize: %r\n" % (pyx_sources,))
    cython_compiler.compile(pyx_sources,options=cython_compiler.CompilationOptions(cplus=True))
cchardet_sources = glob.glob(cchardet_dir+'*.cpp')
sources = cchardet_sources  + [os.path.join(charsetdetect_dir,"charsetdetect.cpp")] + glob.glob(uchardet_dir+'*.cpp')

macros = []
extra_compile_args = []
extra_link_args = []

if platform.system() == "Windows":
    macros.append(("WIN32","1"))

if DEBUG:
    macros.append(("DEBUG_chardet","1"))
    extra_compile_args.append("-g"),
    extra_link_args.append("-g"),
开发者ID:MoonDav,项目名称:cChardet,代码行数:30,代码来源:setup.py

示例11: cythonize

def cythonize(src):
  sys.stderr.write("cythonize: %r\n" % (src,))
  cython_compiler.compile([src])
开发者ID:thenaran,项目名称:clique,代码行数:3,代码来源:setup.py

示例12: __init__

 def __init__(self, *args, **kwargs):
     for src in cython_sources:
         cython_compiler.compile(src, cython_compiler.default_options)
     super().__init__(*args, **kwargs)
开发者ID:EpicDiehard,项目名称:borg,代码行数:4,代码来源:setup.py

示例13: cythonize

def cythonize(src):
    sys.stderr.write("cythonize: %r\n" % (src,))
    cython_compiler.compile([src], cplus=True, emit_linenums=True)
开发者ID:purplecow,项目名称:msgpack-python,代码行数:3,代码来源:setup.py

示例14: __init__

 def __init__(self, *args, **kwargs):
     cy_opt = cython_compiler.default_options.copy()
     cy_opt["cplus"] = True
     for src in glob("msgpack/*.pyx"):
         cython_compiler.compile(glob("msgpack/*.pyx"), cy_opt)
     sdist.__init__(self, *args, **kwargs)
开发者ID:kanosaki,项目名称:msgpack-python,代码行数:6,代码来源:setup.py


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