예제 #1
0
파일: setup.py 프로젝트: SyamGadde/gpyfft
 def build_package_data(self):
     """Copy data files into build directory
     Patched in such a way version.py -> silx/_version.py"""
     _build_py.build_package_data(self)
     for package, src_dir, build_dir, filenames in self.data_files:
         if package == PROJECT:
             filename = "version.py"
             target = os.path.join(build_dir, "_" + filename)
             self.mkpath(os.path.dirname(target))
             self.copy_file(os.path.join(filename), target,
                            preserve_mode=False)
             break
예제 #2
0
파일: setup.py 프로젝트: cmey/gpyfft
 def build_package_data(self):
     """Copy data files into build directory
     Patched in such a way version.py -> silx/_version.py"""
     _build_py.build_package_data(self)
     for package, src_dir, build_dir, filenames in self.data_files:
         if package == PROJECT:
             filename = "version.py"
             target = os.path.join(build_dir, "_" + filename)
             self.mkpath(os.path.dirname(target))
             self.copy_file(os.path.join(filename),
                            target,
                            preserve_mode=False)
             break
예제 #3
0
파일: setup.py 프로젝트: Delsan/openwsn-sw
    def build_package_data(self):
        _build_py.build_package_data(self)

        osname  = 'windows' if os.name=='nt' else 'linux'
        suffix  = 'amd64' if platform.architecture()[0]=='64bit' else 'x86'
        fileExt = 'pyd' if os.name=='nt' else 'so'

        simPath = None
        for package, src_dir, build_dir, filenames in self.data_files:
            for filename in filenames:
                moduleName = 'oos_openwsn-{0}.{1}'.format(suffix, fileExt)
                modulePath = os.path.join(osname, moduleName)
                if package == 'openvisualizer' and filename.endswith(modulePath):
                    srcfile  = os.path.join(src_dir, filename)
                    simPath  = os.path.join(build_dir, 'data', 'sim_files')
                    target   = os.path.join(simPath, 'oos_openwsn.{0}'.format(fileExt))
                    self.copy_file(srcfile, target)
        
        if simPath:
            shutil.rmtree(os.path.join(simPath, 'linux'))
            shutil.rmtree(os.path.join(simPath, 'windows'))
예제 #4
0
    def build_package_data(self):
        _build_py.build_package_data(self)

        osname  = 'windows' if os.name=='nt' else 'linux'
        suffix  = 'amd64' if platform.architecture()[0]=='64bit' else 'x86'
        fileExt = 'pyd' if os.name=='nt' else 'so'

        simPath = None
        for package, src_dir, build_dir, filenames in self.data_files:
            for filename in filenames:
                moduleName = 'oos_openwsn-{0}.{1}'.format(suffix, fileExt)
                modulePath = os.path.join(osname, moduleName)
                if package == 'openvisualizer' and filename.endswith(modulePath):
                    srcfile  = os.path.join(src_dir, filename)
                    simPath  = os.path.join(build_dir, 'data', 'sim_files')
                    target   = os.path.join(simPath, 'oos_openwsn.{0}'.format(fileExt))
                    self.copy_file(srcfile, target)
        
        if simPath:
            shutil.rmtree(os.path.join(simPath, 'linux'))
            shutil.rmtree(os.path.join(simPath, 'windows'))
 def run(self):
     # normally this build_py step will include .py files in the distribution
     # we want to skip that step, but we need to run build_package_data so that
     # the files specified in setup(..., package_data={}) get included
     build_py.build_package_data(self)