コード例 #1
0
ファイル: setup.py プロジェクト: seberg/pandas
    def cython_sources(self, sources, extension):
        import re

        cplus = (
            self.cython_cplus
            or getattr(extension, "cython_cplus", 0)
            or (extension.language and extension.language.lower() == "c++")
        )
        target_ext = ".c"
        if cplus:
            target_ext = ".cpp"

        for i, s in enumerate(sources):
            if not re.search("\.(pyx|pxi|pxd)$", s):
                continue
            ext_dir = os.path.dirname(s)
            ext_basename = re.sub("\.[^\.]+$", "", os.path.basename(s))
            ext_basename += target_ext
            target = os.path.join(ext_dir, ext_basename)
            hash = self._hash_file(s)
            sources[i] = target
            if hash and self._copy_from_cache(hash, target):
                continue
            build_ext.cython_sources(self, [s], extension)
            self._put_to_cache(hash, target)

        return sources
コード例 #2
0
ファイル: setup.py プロジェクト: milkypostman/pandas
    def cython_sources(self, sources, extension):
        import re
        cplus = self.cython_cplus or getattr(extension, 'cython_cplus', 0) or \
                (extension.language and extension.language.lower() == 'c++')
        target_ext = '.c'
        if cplus:
            target_ext = '.cpp'

        for i, s in enumerate(sources):
            if not re.search("\.(pyx|pxi|pxd)$", s):
                continue
            ext_dir = os.path.dirname(s)
            ext_basename = re.sub("\.[^\.]+$", "", os.path.basename(s))
            ext_basename += target_ext
            target = os.path.join(ext_dir, ext_basename)
            hash = self._hash_file(s)
            sources[i] = target
            if hash and self._copy_from_cache(hash, target):
                continue
            build_ext.cython_sources(self, [s], extension)
            self._put_to_cache(hash, target)

        return sources