コード例 #1
0
ファイル: build.py プロジェクト: pombredanne/pysysdevel
    def run(self):
        if self.distribution.subpackages != None:
            if self.get_finalized_command('install').ran:
                return  ## avoid build after install
            try:
                os.makedirs(self.build_base)
            except:
                pass
            for idx in range(len(sys.argv)):
                if 'setup.py' in sys.argv[idx]:
                    break
            argv = list(sys.argv[idx+1:])
            if 'install' in argv:
                argv.remove('install')
            if 'clean' in argv:
                argv.remove('clean')

            ## always check dependencies
            self.get_finalized_command('dependencies').run()

            process_subpackages(self.distribution.parallel_build, 'build',
                                self.build_base, self.distribution.subpackages,
                                argv, self.distribution.quit_on_error)

            if self.has_pure_modules() or self.has_c_libraries() or \
                    self.has_ext_modules() or self.has_shared_libraries() or \
                    self.has_pypp_extensions() or self.has_web_extensions() or \
                    self.has_documents() or self.has_executables() or \
                    self.has_scripts() or self.has_data():
                old_build.run(self)
        else:
            old_build.run(self)
コード例 #2
0
 def run(self):
     """Actually perform the build"""
     self.compile_libspacepy()
     _build.run(self) #need subcommands BEFORE building irbem
     self.compile_irbempy()
     delete_old_files(self.build_lib)
     if self.build_docs:
         self.make_docs()
     else:
         self.copy_docs()
コード例 #3
0
 def run(self):
     """Actually perform the build"""
     self.compile_libspacepy()
     _build.run(self)  #need subcommands BEFORE building irbem
     self.compile_irbempy()
     delete_old_files(self.build_lib)
     if self.build_docs:
         self.make_docs()
     else:
         self.copy_docs()
コード例 #4
0
 def run(self):
     versions = get_versions(verbose=True)
     _build.run(self)
     # now locate _version.py in the new build/ directory and replace it
     # with an updated value
     target_versionfile = os.path.join(self.build_lib, versionfile_build)
     print("UPDATING %s" % target_versionfile)
     os.unlink(target_versionfile)
     f = open(target_versionfile, "w")
     f.write(SHORT_VERSION_PY % versions)
     f.close()
コード例 #5
0
ファイル: versioneer.py プロジェクト: ContinuumIO/gulinalg
 def run(self):
     versions = get_versions(verbose=True)
     _build.run(self)
     # now locate _version.py in the new build/ directory and replace it
     # with an updated value
     target_versionfile = os.path.join(self.build_lib, versionfile_build)
     print("UPDATING %s" % target_versionfile)
     os.unlink(target_versionfile)
     f = open(target_versionfile, "w")
     f.write(SHORT_VERSION_PY % versions)
     f.close()
コード例 #6
0
    def run(self):
        """Build the Fortran library, all python extensions and the docs."""
        print('---- BUILDING ----')
        _build.run(self)

        # build documentation
        print('---- BUILDING DOCS ----')
        docdir = os.path.join(self.build_lib, 'pyshtools', 'doc')
        self.mkpath(docdir)
        doc_builder = os.path.join(self.build_lib, 'pyshtools', 'make_docs.py')
        doc_source = '.'
        check_call([sys.executable, doc_builder, doc_source, self.build_lib])

        print('---- ALL DONE ----')
コード例 #7
0
ファイル: setup.py プロジェクト: ivanpadilla7/qpoint
    def run(self):
        # build dependencies
        print('make -C src qp_iers_bulletin_a.c')
        sp.check_call(
            'PYTHON={} make -C src qp_iers_bulletin_a.c'.format(
                sys.executable),
            shell=True,
        )

        # write version files
        with open('python/_version.py', 'w') as f:
            f.write('__version__ = ({:d}, {:d}, {:d})\n'.format(*vtup))

        build.run(self)
コード例 #8
0
 def run(self):
     """Actually perform the build"""
     self.compile_libspacepy()
     if sys.platform == 'win32':
         #Copy mingw32 DLLs. This keeps them around if ming is uninstalled,
         #but more important puts them where bdist_wininst and bdist_wheel
         #will include them in binary installers
         copy_dlls(os.path.join(self.build_lib, 'spacepy', 'mingw'))
     _build.run(self)  #need subcommands BEFORE building irbem
     self.compile_irbempy()
     delete_old_files(self.build_lib)
     if self.build_docs:
         self.make_docs()
     else:
         self.copy_docs()
コード例 #9
0
ファイル: build.py プロジェクト: sean-m-brennan/pysysdevel
    def run(self):
        deps = self.get_finalized_command('dependencies')
        install = self.get_finalized_command('install')
        level_list = [deps.sublevel, self.sublevel, install.sublevel]
        ## detect malformed usage
        if len(set([l for l in level_list if l])) > 1:
            raise Exception("Multiple sublevels specified.")
        level = max(self.sublevel, install.sublevel, deps.sublevel)
        self.sublevel = install.sublevel = deps.sublevel = max(*level_list)

        ## before anything else
        if self.sublevel == 0 and not deps.ran:
            self.run_command('dependencies')

        options.set_top_level(self.sublevel)
        if self.distribution.subpackages != None:
            install = self.get_finalized_command('install')
            if install.ran:
                return  ## avoid build after install
            for cmd in install.get_sub_commands():
                if getattr(cmd, 'ran', False):
                    return
                ## TODO avoid build after any install_* cmd
            try:
                os.makedirs(self.build_base)
            except OSError:
                pass
            idx = 0
            for i in range(len(sys.argv)):
                idx = i
                if 'setup.py' in sys.argv[idx]:
                    break
            argv = list(sys.argv[idx+1:])
            for arg in sys.argv:
                if arg == 'clean' or '--sublevel' in arg:
                    argv.remove(arg)

            argv += ['--sublevel=' + str(self.sublevel + 1)]
            process_subpackages(self.distribution.parallel_build, 'build',
                                self.build_base, self.distribution.subpackages,
                                argv, self.distribution.quit_on_error)

        old_build.run(self)
        self.ran = True
コード例 #10
0
ファイル: setup.py プロジェクト: marius311/camb4py
    def run(self):
        """ Modified to compile CAMB. """
        
        _build.run(self)
        
        if not self.no_builtin and (self.force or not os.path.exists(os.path.join(self.build_lib,'camb4py','camb'))):
            
            fcompiler = self.get_fcompiler()

            src_tgz = "CAMB.tar.gz"
            src_dir = os.path.join(self.build_temp,"camb")
            if not os.path.exists(src_tgz): 
                print("Downloading CAMB from http://camb.info/CAMB.tar.gz...")
                self.download_file("http://camb.info/CAMB.tar.gz", src_tgz)
            if not os.path.exists(self.build_temp): os.makedirs(self.build_temp)
            tarfile.open(src_tgz).extractall(self.build_temp)
            for f in os.listdir(src_dir):
                if 'F90' in f: os.rename(os.path.join(src_dir,f), os.path.join(src_dir,f.replace('F90','f90')))

            templ = os.path.join(src_dir,'HighLExtrapTemplate_lenspotentialCls.dat')
            if os.path.exists(templ): 
                self.copy_file(templ, os.path.join(self.build_lib,'camb4py'))
    
    
            openmp_flags = self.get_openmp_flags(fcompiler)
            compile_flags = openmp_flags + ['-cpp']
            if fcompiler.module_dir_switch is not None: 
                compile_flags += [fcompiler.module_dir_switch+src_dir]
            link_flags = openmp_flags
            
            obj_files = fcompiler.compile([os.path.join(src_dir,'%s.f90'%o) for o in self.objs],
                                           extra_postargs=compile_flags,)
#                                           output_dir=self.build_temp)
                
            fcompiler.link_executable(obj_files,
                                      'camb',
                                      output_dir=os.path.join(self.build_lib,'camb4py'),
                                      extra_postargs=link_flags)
コード例 #11
0
 def run(self):
     CDF_build(self, self.build_temp)
     build.run(self)
     return
コード例 #12
0
ファイル: setup.py プロジェクト: ahmadia/clawpack-ahmadia
 def run(self):
     if os.path.exists(".git"):
         exec_command(["git", "submodule", "init"])
         exec_command(["git", "submodule", "update"])
     build.run(self)
コード例 #13
0
ファイル: hooks.py プロジェクト: satorchi/qubic
 def run(self):
     _write_version(self.distribution.get_name(),
                    self.distribution.get_version())
     build.run(self)
コード例 #14
0
 def run(self):
     configure = self.get_finalized_command('sherpa_config', True).build_configure()
     self.get_finalized_command('xspec_config', True).run()
     build_deps(configure)
     _build.run(self)
コード例 #15
0
ファイル: hooks.py プロジェクト: ghisvail/pyoperators
 def run(self):
     _write_version(self.distribution.get_name(),
                    self.distribution.get_version())
     build.run(self)
コード例 #16
0
ファイル: setup.py プロジェクト: jklenzing/pysatCDF
 def run(self):
     CDF_build(self, self.build_temp)
     build.run(self)
     return
コード例 #17
0
 def run(self):
     configure = self.get_finalized_command('sherpa_config',
                                            True).build_configure()
     self.get_finalized_command('xspec_config', True).run()
     build_deps(configure)
     _build.run(self)