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


Python Extension.__init__方法代码示例

本文整理汇总了Python中setuptools.Extension.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Extension.__init__方法的具体用法?Python Extension.__init__怎么用?Python Extension.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在setuptools.Extension的用法示例。


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

示例1: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        from numpy import get_include
        from numpy.distutils.misc_util import get_info
        kwargs.update(get_info('npymath'))
        kwargs['include_dirs'] += [get_include()]

        Extension.__init__(self, *args, **kwargs)
开发者ID:REVLWorld,项目名称:pyhacrf,代码行数:9,代码来源:setup.py

示例2: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        if 'error' in kwargs:
            self.error = kwargs['error']
            del kwargs['error']

            args = ('Cannot be built', [])

        _Extension.__init__(self, *args, **kwargs)
开发者ID:gregier,项目名称:epub-search,代码行数:10,代码来源:failablebuildext.py

示例3: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Extension.__init__(self, *args, **kwargs)
     self.cython_directives = {
         'c_string_encoding': 'utf-8',
         'profile': 'USE_PROFILE' in environ,
         'embedsignature': 'USE_EMBEDSIGNATURE' in environ}
     # XXX with pip, setuptools is imported before distutils, and change
     # our pyx to c, then, cythonize doesn't happen. So force again our
     # sources
     self.sources = args[1]
开发者ID:CharaD7,项目名称:kivy,代码行数:12,代码来源:setup.py

示例4: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        self._include_dirs = []
        eprsrcdir = kwargs.pop('eprsrcdir', None)

        Extension.__init__(self, *args, **kwargs)

        if not any('epr_' in src for src in self.sources):
            self.sources.extend(self._extra_sources(eprsrcdir))

        self.setup_requires_cython = False
开发者ID:avalentino,项目名称:pyepr,代码行数:12,代码来源:setup.py

示例5: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
    def __init__(self, key, **opts):
        self.boodler_key = key
        modname = 'boodle.cboodle_'+key

        ls = ['audev-'+key, 'cboodle-'+key, 'noteq', 'sample']
        ls = [ ('src/cboodle/' + val + '.c') for val in ls ]

        avail = opts.pop('available', None)
        if (avail):
            self.ext_available = avail

        Extension.__init__(self, modname, ls, **opts)
开发者ID:nemurimasu,项目名称:boodler,代码行数:14,代码来源:setup.py

示例6: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
    def __init__(self, name):
        # Describe the extension
        sources = [
            'rl/readline.c',
            'rl/stringarray.c',
            'rl/unicode.c',
            'rl/iterator.c',
            'rl/modulestate.c',
        ]
        Extension.__init__(self, name, sources)

        # Use include and library dirs from Python build
        self.use_include_dirs()
        self.use_library_dirs()

        # Use Mac Python library dir
        if sys.platform == 'darwin':
            if sys_path_contains('/Library/Frameworks/Python.framework'):
                self.library_dirs.append(
                    '/Library/Frameworks/Python.framework/Versions/%d.%d/lib' % sys.version_info[:2])

        self.use_static_readline()
        self.suppress_warnings()
        self.strip_debug_symbols()
开发者ID:stefanholek,项目名称:rl,代码行数:26,代码来源:setup.py

示例7: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        if 'define_macros' in kwargs or 'undef_macros' in kwargs:
            raise DistutilsOptionError('D does not support macros, so the'
                ' "define_macros" and "undef_macros" arguments are not'
                ' supported.  Instead, consider using the "Version Condition"'
                ' and "Debug Condition" conditional compilation features'
                ' documented at http://www.digitalmars.com/d/version.html'
                '\n  Version flags can be passed to the compiler via the'
                ' "version_flags" keyword argument to DExtension; debug flags'
                ' via the "debug_flags" keyword argument.  For example, when'
                ' used with the DMD compiler,'
                '\n    DExtension(..., version_flags=["a", "b"])'
                '\nwill cause'
                '\n    -version=a -version=b'
                '\nto be passed to the compiler.'
              )

        # If the user has requested any version_flags or debug_flags, we use
        # the distutils 'define_macros' keyword argument to carry them (they're
        # later unpacked in the dcompiler module).
        define_macros = []
        if 'version_flags' in kwargs or 'debug_flags' in kwargs:
            if 'version_flags' in kwargs:
                for flag in kwargs['version_flags']:
                    define_macros.append((flag, 'version'))
                del kwargs['version_flags']

            if 'debug_flags' in kwargs:
                for flag in kwargs['debug_flags']:
                    define_macros.append((flag, 'debug'))
                del kwargs['debug_flags']

        # Pass in the extension name so the compiler class can know it
        if 'name' in kwargs:
            define_macros.append((kwargs['name'], 'name'))
        elif len(args) > 0:
            define_macros.append((args[0], 'name'))

        # Pass in the 'tango' flag, also
        with_tango = kwargs.pop('tango', False)
        if with_tango:
            define_macros.append(('Pyd_with_Tango', 'version'))
        kwargs['define_macros'] = define_macros

        # Similarly, pass in with_pyd, &c, via define_macros.
        if 'raw_only' in kwargs:
            kwargs['with_pyd'] = False
            kwargs['with_st'] = False
            kwargs['with_meta'] = False
            kwargs['with_main'] = False
            del kwargs['raw_only']
        with_pyd  = kwargs.pop('with_pyd', True)
        with_st   = kwargs.pop('with_st', False) # 5/23/07 st off by default.
        # StackThreads doesn't work with Tango at the moment.
        if with_tango:
            with_st = False
        with_meta = kwargs.pop('with_meta', True)
        with_main = kwargs.pop('with_main', True)
        if with_pyd and not with_meta:
            raise DistutilsOptionError(
                'Cannot specify with_meta=False while using Pyd. Specify'
                ' raw_only=True or with_pyd=False if you want to compile a raw Python/C'
                ' extension.'
            )
        if with_main and not with_pyd:
            # The special PydMain function should only be used when using Pyd
            with_main = False

        define_macros.append(((with_pyd, with_st, with_meta, with_main), 'aux'))

        std_Extension.__init__(self, *args, **kwargs)
开发者ID:dansanduleac,项目名称:pyd,代码行数:73,代码来源:support.py

示例8: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Extension.__init__(self, *args, **kwargs)
     self._include_dirs = self.include_dirs
     del self.include_dirs  # restore overwritten property
开发者ID:inducer,项目名称:meshpy,代码行数:6,代码来源:aksetup_helper.py

示例9: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     save_sources = kwargs.get('sources', None)
     _Extension.__init__(self, *args, **kwargs)
     self.sources = save_sources
开发者ID:Theano,项目名称:libgpuarray,代码行数:6,代码来源:setup.py

示例10: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     self.libraries = []
     self.define_macros = []
     # Python 2 has this as an old-style class for some reason
     # so super() doesn't work.
     _Extension.__init__(self, *args, **kwargs) # pylint:disable=no-member,non-parent-init-called
开发者ID:gevent,项目名称:gevent,代码行数:8,代码来源:_setuputils.py

示例11: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     self.avx2_defs = kwargs.pop("avx2_defs", {})
     Extension.__init__(self, *args, **kwargs)
开发者ID:Blosc,项目名称:python-blosc,代码行数:5,代码来源:setup.py

示例12: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     self.export_include = kwargs.pop('export_include', [])
     Extension.__init__(self, *args, **kwargs)
开发者ID:mdtraj,项目名称:mdtraj,代码行数:5,代码来源:basesetup.py

示例13: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     self.condition = kwargs.pop("condition", lambda builder: True)
     Extension.__init__(self, *args, **kwargs)
开发者ID:Architektor,项目名称:PySnip,代码行数:5,代码来源:dist.py

示例14: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, name, cmd, cwd=".", output_dir=".", env=None):
     Extension.__init__(self, name, sources=[])
     self.cmd = cmd
     self.cwd = path.normpath(cwd)
     self.output_dir = path.normpath(output_dir)
     self.env = env or dict(os.environ)
开发者ID:rougier,项目名称:freetype-py,代码行数:8,代码来源:setup.py

示例15: __init__

# 需要导入模块: from setuptools import Extension [as 别名]
# 或者: from setuptools.Extension import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     packages = kwargs.pop('pkg_config', [])
     for package in packages:
         options = self.__options_for_package(package, kwargs)
     _Extension.__init__(self, *args, **kwargs)
开发者ID:edwardgeorge,项目名称:pkgextension,代码行数:7,代码来源:pkgextension.py


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