示例#1
0
    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)
示例#2
0
    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)
示例#3
0
文件: setup.py 项目: avalentino/pyepr
    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
示例#4
0
文件: setup.py 项目: CharaD7/kivy
 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]
示例#5
0
    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)
示例#6
0
文件: setup.py 项目: stefanholek/rl
    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()
示例#7
0
 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)
示例#8
0
 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)
示例#9
0
 def __init__(self, name):
     Extension.__init__(self, name, sources=[])
示例#10
0
 def __init__(self, name, sourcedir, build_with_cuda):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = os.path.abspath(sourcedir)
     self.build_with_cuda = build_with_cuda
示例#11
0
 def __init__(self, *args, **kwargs):
     self.export_include = kwargs.pop('export_include', [])
     Extension.__init__(self, *args, **kwargs)
示例#12
0
 def __init__(self, name, cmake_lists_dir=None, **kwargs):
     Extension.__init__(self, name, sources=[], **kwargs)
     if cmake_lists_dir is None:
         self.sourcedir = os.path.dirname(os.path.abspath(__file__))
     else:
         self.sourcedir = os.path.dirname(os.path.abspath(cmake_lists_dir))
示例#13
0
 def __init__(self, name, sourcedir=''):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = sourcedir
示例#14
0
 def __init__(self, name, sourcedir='', exclude_arch=False):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = os.path.abspath(sourcedir)
     self.exclude_arch = exclude_arch
示例#15
0
 def __init__(self, name, sourcedir='', namespace=''):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = os.path.abspath(sourcedir)
     self.namespace = namespace
示例#16
0
 def __init__(self, name):
     # Don't run the default setup-tools build commands, use the custom one
     Extension.__init__(self, name=name, sources=[])
示例#17
0
 def __init__(self, name, cmake_lists_dir='.', sources=None, **kwa):
     sources = [] if sources is None else sources
     Extension.__init__(self, name, sources=sources, **kwa)
     self.cmake_lists_dir = os.path.abspath(cmake_lists_dir)
示例#18
0
 def __init__(self, name, sourcedir=''):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = str(Path(sourcedir).resolve())
示例#19
0
 def __init__(self):
     Extension.__init__(self, name=self.extension_name, sources=[])
示例#20
0
 def __init__(self, name, sourcedir=''):
     Extension.__init__(self, name, sources=[])
     self.source_dir = os.path.abspath(sourcedir)
     self.super_build_dir = os.path.join(self.source_dir, 'build')
     self.build_dir = os.path.join(self.super_build_dir, 'MYPROJECT-build')
示例#21
0
 def __init__(self, *args, **kwargs):
     self.export_include = kwargs.pop('export_include', [])
     Extension.__init__(self, *args, **kwargs)
示例#22
0
 def __init__(self, name, sourcedir='', *args, **kwargs):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = os.path.abspath(os.path.join(CURRENT_DIR))
示例#23
0
 def __init__(self, name):
     # don't invoke the original build_ext for this special extension
     Extension.__init__(self, name, sources=[])
示例#24
0
 def __init__(self, sourcedir):
     Extension.__init__(self, '', sources=[])
     self.sourcedir = os.path.abspath(sourcedir)
示例#25
0
 def __init__(self, *args, **kwargs):
     Extension.__init__(self, *args, **kwargs)
     self._include_dirs = self.include_dirs
     del self.include_dirs  # restore overwritten property
示例#26
0
文件: setup.py 项目: dbasgoeze/pycarl
 def __init__(self, name, sourcedir='', subdir=''):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = os.path.abspath(sourcedir)
     self.subdir = subdir
示例#27
0
文件: setup.py 项目: avinair/spconv_1
 def __init__(self, name, sourcedir='', library_dirs=[]):
     Extension.__init__(self, name, sources=[], library_dirs=library_dirs)
     self.sourcedir = os.path.abspath(sourcedir)
示例#28
0
文件: cmake.py 项目: ishine/vosk-api
 def __init__(self, name, sourcedir=''):
     check_for_cmake()
     Extension.__init__(self, name, sources=[])
     self.sourcedir = os.path.abspath(sourcedir)
示例#29
0
 def __init__(self, name, filename_list):
     Extension.__init__(self, name, sources=[])
     self.filename_list = filename_list
示例#30
0
 def __init__(self, name):
     # don't invoke the original build_ext for this special extension
     Extension.__init__(self, name, sources=[])
示例#31
0
 def __init__(self, name, sourcedir=""):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = os.path.abspath(sourcedir)
示例#32
0
 def __init__(self, name, cmd, cwd=".", output_dir=".", env=None):
     Extension.__init__(self, name, sources=[])
     self.cmd = cmd
     self.cwd = os.path.normpath(cwd)
     self.output_dir = os.path.normpath(output_dir)
     self.env = env or dict(os.environ)
示例#33
0
 def __init__(self):
     Extension.__init__(self, name="taosenai.pywrapfst", sources=[])
示例#34
0
 def __init__(self, *args, **kwargs):
     self.avx2_defs = kwargs.pop("avx2_defs", {})
     Extension.__init__(self, *args, **kwargs)
示例#35
0
 def __init__(self, name, source_dir='', build_dir=None):
     Extension.__init__(self, name, sources=[])
     self.source_dir = os.path.abspath(source_dir)
     self.build_dir = os.path.abspath(build_dir)
示例#36
0
 def __init__(self, *args, **kwargs):
     save_sources = kwargs.get('sources', None)
     _Extension.__init__(self, *args, **kwargs)
     self.sources = save_sources
示例#37
0
 def __init__(self, *args, **kwargs):
     self.condition = kwargs.pop("condition", lambda builder: True)
     Extension.__init__(self, *args, **kwargs)
示例#38
0
 def __init__(self, *args, **kwargs):
     Extension.__init__(self, *args, **kwargs)
     self._include_dirs = self.include_dirs
     del self.include_dirs  # restore overwritten property
示例#39
0
 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
示例#40
0
 def __init__(self, name, cmakelists_dir='.', **kw):
     Extension.__init__(self, name, sources=[], **kw)
     self.cmakelists_dir = Path(cmakelists_dir).resolve()
示例#41
0
 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
示例#42
0
 def __init__(self, *args, **kwargs):
     self.condition = kwargs.pop("condition", lambda builder: True)
     Extension.__init__(self, *args, **kwargs)
示例#43
0
 def __init__(self, name, cmake_lists_dir='.', sources=[], **kwa):
     Extension.__init__(self, name, sources=sources, **kwa)
     self.cmake_lists_dir = os.path.abspath(cmake_lists_dir)
示例#44
0
 def __init__(self, name, sources, dsos=None, **kws):
     _Extension.__init__(self, name, sources, **kws)
     self.dsos = dsos or []
示例#45
0
    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)
示例#46
0
 def __init__(self, name, project_dir=os.path.dirname(__file__)):
     Extension.__init__(self, name, sources=[])
     self.project_dir = os.path.abspath(project_dir)
     self.build_dir = os.path.join(project_dir, 'build')
示例#47
0
文件: setup.py 项目: eirikwha/6DPose
 def __init__(self, name, sourcedir=''):
     Extension.__init__(self, name, sources=[])
     self.sourcedir = os.path.abspath(sourcedir)
示例#48
0
文件: ext.py 项目: highorder/cord
 def __init__(self, *args, **kwargs):
     add_numpy(kwargs)
     add_boost_python(kwargs)
     Extension.__init__(self, *args, **kwargs)