Example #1
0
    def run(self):
        if cmd_exists("make") and cmd_exists('gcc') and cmd_exists('g++'):
            os.system("cd mgescan/ltr/MER; make clean; make")
            os.system("cd mgescan/nonltr/; make clean; make translate")
            os.system("cd mgescan/nonltr/hmm;make clean; make")
        else:
            print ("[Warning] make|gcc|g++ does not exist. Compile code is skipped")
            time.sleep(3)
        if cmd_exists("mpicc"):
            os.system("cd mgescan;mpicc mpi_mgescan.c -o mpi_mgescan")
        else:
            print ("[Warning] mpicc does not exist. Compile mpi code is"\
                    + " skipped")
            time.sleep(3)
        if not os.environ.get('MGESCAN_HOME'):
             print ("$MGESCAN_HOME is not defined where MGESCAN will be" + \
                     " installed.")
             def_home = raw_input("Would you install MGESCAN at " + \
                     os.environ.get("HOME") + "/mgescan3 (Y/n)?")
             if def_home.lower() == 'n':
                 print ("Run 'export MGESCAN_HOME=<your desired destination" + \
                         " path to install>' if you want to install somewhere"+\
                         " else\n")
                 sys.exit()
             os.environ['MGESCAN_HOME'] = os.environ.get('HOME') + "/mgescan3"
        if os.environ.get('MGESCAN_HOME') and not os.environ.get("MGESCAN_SRC"):
            os.environ['MGESCAN_SRC'] = os.environ.get('MGESCAN_HOME') + "/src"
            if not os.path.exists(os.environ.get("MGESCAN_SRC")):
                os.makedirs(os.environ.get("MGESCAN_SRC"), 0755)
        if os.environ.get("MGESCAN_SRC"):
            os.system("cp -pr * $MGESCAN_SRC")

        bdist_egg.run(self)
Example #2
0
    def run(self):
        # run default setup procedure
        bdist_egg.run(self)

        import sys

        # Check whether setup.py is run from inside a virtualenv and get the
        # appropriate install location for exploitable.py.
        if hasattr(sys, 'real_prefix'):
            # Inside virtualenv:
            #   Use Python standard library location.
            from distutils.sysconfig import get_python_lib
            install_base_path = get_python_lib()
        else:
            # Not inside virtualenv, operating on a real Python environment:
            #   Use location for Python site-specific, platform-specific files.
            from sysconfig import get_path
            install_base_path = get_path('platlib')

        path_to_exploitable = os.path.join(install_base_path,
                                           os.path.basename(self.egg_output),
                                           'exploitable',
                                           'exploitable.py')
        print('\x1b[0;32m**********************************************')
        print(' Install complete! Source exploitable.py from')
        print(' your .gdbinit to make it available in GDB:')
        print('')
        print(' \x1b[1;37mecho \"source %s\" >> ~/.gdbinit\x1b[0;32m' % path_to_exploitable)
        print('**********************************************\x1b[0m')
Example #3
0
    def run(self):
        # run default setup procedure
        bdist_egg.run(self)

        import sys

        # Check whether setup.py is run from inside a virtualenv and get the
        # appropriate install location for exploitable.py.
        if hasattr(sys, 'real_prefix'):
            # Inside virtualenv:
            #   Use Python standard library location.
            from distutils.sysconfig import get_python_lib
            install_base_path = get_python_lib()
        else:
            # Not inside virtualenv, operating on a real Python environment:
            #   Use location for Python site-specific, platform-specific files.
            from sysconfig import get_path
            install_base_path = get_path('platlib')

        path_to_exploitable = os.path.join(install_base_path,
                                           os.path.basename(self.egg_output),
                                           'exploitable', 'exploitable.py')
        print('\x1b[0;32m**********************************************')
        print(' Install complete! Source exploitable.py from')
        print(' your .gdbinit to make it available in GDB:')
        print('')
        print(' \x1b[1;37mecho \"source %s\" >> ~/.gdbinit\x1b[0;32m' %
              path_to_exploitable)
        print('**********************************************\x1b[0m')
	def run(self):
		print("generate web application")
		if os.system('npm install') != 0:
			raise Exception("Could not install npm packages")
		if os.system('npm run build') != 0:
			raise Exception("Could not build web application")
		bdist_egg.run(self)
Example #5
0
    def run(self):

        try:
            prior = getattr(self.distribution, 'running_binary', False)
            self.distribution.running_binary = True
            self.run_command('build')
            dBuildDistEgg.run(self)
        finally: self.distribution.running_binary = prior
Example #6
0
 def run(self):
     # Ensure that there is a basic library build for bdist_egg to pull from.
     self.run_command("build")
     
     _cleanup_symlinks(self)
     
     # Run the default bdist_egg command
     orig_bdist_egg.run(self)
Example #7
0
    def run(self):

        try:
            prior = getattr(self.distribution, 'running_binary', False)
            self.distribution.running_binary = True
            self.run_command('build')
            dBuildDistEgg.run(self)
        finally: self.distribution.running_binary = prior
Example #8
0
    def run(self):
        # Ensure that there is a basic library build for bdist_egg to pull from.
        self.run_command("build")

        _cleanup_symlinks(self)

        # Run the default bdist_egg command
        orig_bdist_egg.run(self)
Example #9
0
 def run(self):
     try:
         self.run_command('build_sphinx')
         if 'build_man' in cmdclass:
             self.run_command('build_man')
     except:
         log.warn("Couldn't build documentation:\n%s" %
                  traceback.format_exception(*sys.exc_info()))
     bdist_egg.run(self)
Example #10
0
 def run(self):
     try:
         self.run_command('build_sphinx')
         if 'build_man' in cmdclass:
             self.run_command('build_man')
     except:
         log.warn("Couldn't build documentation:\n%s" %
                  traceback.format_exception(*sys.exc_info()))
     bdist_egg.run(self)
Example #11
0
 def run(self):
     _bdist_egg.run(self)
     with open(self.egg_output, 'rb') as f:
         data = f.read()
     with open(self.egg_output, 'wb') as f:
         f.write('#!/usr/bin/env python\n'.encode() + data)
     z = zipfile.ZipFile(self.egg_output, 'a')
     z.writestr('__main__.py', 'from needy.__main__ import main\nimport sys\nsys.exit(main(sys.argv))')
     z.close()
Example #12
0
 def run(self):
     bdist_egg.run(self)
     if not os.path.isdir(self.sentinel_dir):
         print("\n".join([  # noqa
             "************************************************************",
             "The front end assets for Wagtail are missing.",
             "To generate the assets, please refer to the documentation in",
             "docs/contributing/css_guidelines.rst",
             "************************************************************",
         ]))
Example #13
0
 def run(self):
     bdist_egg.run(self)
     if not os.path.isdir(self.sentinel_dir):
         print("\n".join([
             "************************************************************",
             "The front end assets for Wagtail are missing.",
             "To generate the assets, please refer to the documentation in",
             "docs/contributing/css_guidelines.rst",
             "************************************************************",
         ]))
Example #14
0
File: setup.py Project: vmrob/needy
 def run(self):
     _bdist_egg.run(self)
     with open(self.egg_output, 'rb') as f:
         data = f.read()
     with open(self.egg_output, 'wb') as f:
         f.write('#!/usr/bin/env python\n'.encode() + data)
     z = zipfile.ZipFile(self.egg_output, 'a')
     z.writestr(
         '__main__.py',
         'from needy.__main__ import main\nimport sys\nsys.exit(main(sys.argv))'
     )
     z.close()
Example #15
0
    def run(self):
        self.create_init_files(self.test_dir)

        # Re-run the package search now we've ensured there are package files
        # extant
        self.distribution.packages = [
            '%s.%s.%s' % (CONFIG.test_egg_namespace, self.old_name, i)
            for i in find_packages('tests')
        ]

        # Bin the build directory, this stops artifacts from the real package
        # getting in there
        self.execute(shutil.rmtree, (self.build_lib, ),
                     "removing %s (and everything under it)" % self.build_lib)

        # Re-run the egg-info step, setting the option to include test options
        self.reinitialize_command('egg_info')
        self.ei_cmd = self.get_finalized_command('egg_info')
        self.ei_cmd.include_test_options = True
        self.ei_cmd.tag_build = None
        self.ei_cmd.egg_version = self.old_version
        self.ei_cmd.run()

        # Copy all the test files into the build directory and ensure they're
        # real packages
        for root, dirs, files in os.walk(self.test_dir):
            if '.svn' in dirs:
                dirs.remove('.svn')
            if '__pycache__' in dirs:
                dirs.remove('__pycache__')
            for f in files:
                f = os.path.join(root, f)
                self.execute(self._copy_file, (f, self.get_file_dest(f)),
                             "copying %s -> %s" % (f, self.get_file_dest(f)))

        self.create_ns_pkg_files(self.build_lib)

        pytest_cfg = os.path.join(self.dest_dir, 'pytest.ini')
        self.execute(self.create_pytest_config, (pytest_cfg, ),
                     "creating pytest config at %s" % pytest_cfg)

        # Kick off a bdist_egg which will build the egg for us
        _bdist_egg.run(self)

        # Clean up the egg-info dir, pkg_resources finds it in source
        # checkouts and thinks the package is installed somewhere
        self.execute(shutil.rmtree, (self.egg_info, ),
                     "removing %s (and everything under it)" % self.egg_info)
Example #16
0
    def run(self):
        self.create_init_files(self.test_dir)
        # Re-run the package search now we've ensured there are package files
        # extant in the distro
        self.distribution.packages = ['%s.%s.%s' % (CONFIG.test_egg_namespace,
                                                    self.old_name, i)
                                      for i in find_packages('tests')]

        # Bin the build directory, this stops artifacts from the real package
        # getting in there
        self.execute(self.build_lib.rmtree, (self.build_lib,),
                    "removing %s (and everything under it)" % self.build_lib)

        # Re-run the egg-info step, setting the option to include test options
        self.reinitialize_command('egg_info')
        self.ei_cmd = self.get_finalized_command('egg_info')
        self.ei_cmd.include_test_options = True
        self.ei_cmd.tag_build = None
        self.ei_cmd.egg_version = self.old_version
        self.ei_cmd.run()

        # Copy all the test files into the build directory and ensure they're
        # real packages
        for filename in self.test_dir.walk():
            if (not filename.isfile()
                or '.svn' in filename
                or '__pycache__' in filename):
                continue
            self.execute(self._copy_file, (filename,
                                           self.get_file_dest(filename)),
                        "copying {} -> {}"
                        .format(filename, self.get_file_dest(filename)))
        self.create_ns_pkg_files(self.build_lib)

        pytest_cfg = self.dest_dir / 'pytest.ini'
        self.execute(self.create_pytest_config, (pytest_cfg,),
                     "creating pytest config at %s" % pytest_cfg)

        # Kick off a bdist_egg which will build the egg for us
        _bdist_egg.run(self)

        # Clean up the egg-info dir, pkg_resources finds it in source checkouts
        # and thinks the package is installed somewhere
        self.execute(self.egg_info.rmtree, (self.egg_info,),
                    "removing %s (and everything under it)" % self.egg_info)
Example #17
0
    def run(self):
        self.create_init_files(self.test_dir)

        # Re-run the package search now we've ensured there are package files
        # extant
        self.distribution.packages = [
            "%s.%s.%s" % (CONFIG.test_egg_namespace, self.old_name, i) for i in find_packages("tests")
        ]

        # Bin the build directory, this stops artifacts from the real package
        # getting in there
        self.execute(shutil.rmtree, (self.build_lib,), "removing %s (and everything under it)" % self.build_lib)

        # Re-run the egg-info step, setting the option to include test options
        self.reinitialize_command("egg_info")
        self.ei_cmd = self.get_finalized_command("egg_info")
        self.ei_cmd.include_test_options = True
        self.ei_cmd.tag_build = None
        self.ei_cmd.egg_version = self.old_version
        self.ei_cmd.run()

        # Copy all the test files into the build directory and ensure they're
        # real packages
        for root, dirs, files in os.walk(self.test_dir):
            if ".svn" in dirs:
                dirs.remove(".svn")
            if "__pycache__" in dirs:
                dirs.remove("__pycache__")
            for f in files:
                f = os.path.join(root, f)
                self.execute(
                    self._copy_file, (f, self.get_file_dest(f)), "copying %s -> %s" % (f, self.get_file_dest(f))
                )

        self.create_ns_pkg_files(self.build_lib)

        pytest_cfg = os.path.join(self.dest_dir, "pytest.ini")
        self.execute(self.create_pytest_config, (pytest_cfg,), "creating pytest config at %s" % pytest_cfg)

        # Kick off a bdist_egg which will build the egg for us
        _bdist_egg.run(self)

        # Clean up the egg-info dir, pkg_resources finds it in source
        # checkouts and thinks the package is installed somewhere
        self.execute(shutil.rmtree, (self.egg_info,), "removing %s (and everything under it)" % self.egg_info)
Example #18
0
    def run(self):
        old_bdist_egg.run(self)

        spec_depend = textwrap.dedent("""\
            metadata_version = '1.1'
            name = 'enstaller'
            version = '{0}'
            build = 1

            arch = None
            platform = None
            osdist = None
            python = None
            packages = []
        """.format(__version__))
        self._write_spec_depend(spec_depend)

        with open(BOOTSTRAP_SCRIPT, "rt") as fp:
            self._write_bootstrap_code(fp.read())
Example #19
0
 def run(self):
     # Ensure that there is a basic library build for bdist_egg to pull from.
     self.run_command("build")
     
     # Clean out any libwx* symlinks in the build_lib folder, as they will
     # turn into copies in the egg since zip files can't handle symlinks.
     # The links are not really needed since the extensions link to
     # specific soname, and they could bloat the egg too much if they were
     # left in.
     #        
     # TODO: can eggs have post-install scripts that would allow us to 
     # restore the links?
     #
     build_lib = self.get_finalized_command('build').build_lib
     build_lib = opj(build_lib, 'wx')
     for libname in glob.glob(opj(build_lib, 'libwx*')):
         
         if os.path.islink(libname):
             if isDarwin:
                 # On Mac the name used by the extension module is the real
                 # file, so we can just get rid of all the links.
                 os.unlink(libname)
                 
             elif canGetSOName():
                 # On linux the soname used in the extension modules may
                 # be (probably is) one of the symlinks, so we have to be
                 # more tricky here. If the named file is a link and it is
                 # the soname, then remove the link and rename the
                 # linked-to file to this name.
                 soname = getSOName(libname)
                 if soname == os.path.basename(libname):
                     realfile = os.path.join(build_lib, os.readlink(libname))
                     os.unlink(libname)
                     os.rename(realfile, libname)
                 else:
                     os.unlink(libname)
             else:
                 # Otherwise just leave the symlink there since we don't
                 # know what to do with it.
                 pass
     
     # Run the default bdist_egg command
     orig_bdist_egg.run(self)
Example #20
0
 def run(self):
     self.run_command("build")
     _bdist_egg.run(self)
Example #21
0
 def run(self):
     self.run_command("build")
     return _bdist_egg.run(self)
Example #22
0
 def run(self):
     call(["pip install -r requirements.txt --no-clean"], shell=True)
     _bdist_egg.run(self)
Example #23
0
 def run(self):
     self.call_command('build_clib')
     bdist_egg.run(self)
Example #24
0
 def run(self):
     # This will not run when installing from pip, thus
     # avoiding a few dependencies.
     if not os.path.exists(THEME_DIST_DIR):
         self.run_command('build_default_theme')
     return bdist_egg.run(self)
Example #25
0
 def run(self):
     compile_AHK()
     bdist_egg.run(self)
     clean_egg_info()
Example #26
0
 def run(self):
     build_js()
     bdist_egg.run(self)
Example #27
0
 def run(self):
     """Call build_sphinx then proceed as normal."""
     self.run_command('build_sphinx')
     bdist_egg.run(self)
Example #28
0
 def run(self):
     _bdist_egg.run(self)
     post_install(self, False)
Example #29
0
 def run(self):
     self.run_command('build_ext')
     bdist_egg.run(self)
Example #30
0
 def run(self):
     self.run_command('build')
     _bdist_egg.run(self)
Example #31
0
    def run(self):

        bdist_egg.run(self)

        if self.install_lua_libs:
            self.run_command("install_lua_libs")
Example #32
0
    def run(self):

        '''
        Checking Prerequisites
        '''
        hmmer_exists = cmd_exists("hmmsearch")
        emboss_exists = cmd_exists("transeq")
        trf_exists = cmd_exists("trf")
        blast_exists = cmd_exists("blastn")
        if not (hmmer_exists and emboss_exists and trf_exists and blast_exists):
            print ("[Error] Prerequisite software(s):")
            if not hmmer_exists:
                print ("\t- HMMER")
            if not emboss_exists:
                print ("\t- EMBOSS")
            if not trf_exists:
                print ("\t- Tandem Repeats Finder")
            if not blast_exists:
                print ("\t- NCBI-BLAST+")
            print ("\tare not installed!")
            print ("Please install the above software and re-run this setup.")
            print ("Exiting without installation!")
            sys.exit()

        '''
        Checking Install Path
        '''
        install_path = ""
        if not os.environ.get('MGESCAN_HOME'):
            print ("$MGESCAN_HOME is not defined where MGESCAN will be" + \
                    " installed.")
            def_home = raw_input("Would you like to install MGEScan at " + \
                    os.environ.get("HOME") + "/mgescan4 (Y/n)?")
            if def_home.lower() == 'n':
                print ("Run 'export MGESCAN_HOME=<your desired destination" + \
                        " path to install>' if you want to install somewhere"+\
                        " else\n")
                sys.exit()
            install_path = os.environ.get('HOME') + "/mgescan4"
        else:
            print ("Installing MGEScan in "+os.environ.get('MGESCAN_HOME')+" (MGESCAN_HOME)")
            install_path = os.environ.get('MGESCAN_HOME')
        if not os.path.exists(install_path):
            os.makedirs(install_path, 0755)
        else:
            print ("It looks like a previous installation of MGEScan already exists in "+install_path)
            print ("Please remove the previous installation and re-run this setup.")
            print ("Exiting without installation!")
            sys.exit()

        '''
        Installing
        '''
        if cmd_exists("make") and cmd_exists('gcc') and cmd_exists('g++'):
            os.system("cd mgescan/ltr/MER; make clean; make")
            os.system("cd mgescan/nonltr/; make clean; make translate")
            os.system("cd mgescan/nonltr/hmm;make clean; make")
        else:
            print ("[Warning] make|gcc|g++ does not exist. Compile code is skipped")
            time.sleep(3)
        if cmd_exists("mpicc"):
            os.system("cd mgescan;mpicc mpi_mgescan.c -o mpi_mgescan")
        else:
            print ("[Warning] mpicc does not exist. Compile mpi code is"\
                    + " skipped")
            time.sleep(3)

        os.system("cp -pr * "+install_path)

        if not os.environ.get('GALAXY_HOME'):
            print ("[Warning] $GALAXY_HOME is not defined. Copying MGEScan Galaxy files is skipped.")
            time.sleep(3)
        else:
            os.system("cp -pr galaxy-modified/* $GALAXY_HOME")

        bdist_egg.run(self)
Example #33
0
 def run(self):
     if not self.dry_run:
         self.run_command('prebuild')
     bdist_egg.run(self)
Example #34
0
 def run(self):
     suffix = self.get_datetime_suffix()
     self.distribution.metadata.version += "_%s" % suffix
     bdist_egg.run(self)
Example #35
0
 def run(self):
     # Run build_ext first so that SWIG generated files are included
     self.run_command("build_ext")
     return bdist_egg.run(self)
Example #36
0
 def run(self):
     self.call_command('build_clib')
     bdist_egg.run(self)
Example #37
0
 def run(self):
     self.run_command('build')
     return bdist_egg.run(self)
Example #38
0
 def run(self):
     bdist_egg.run(self)
     enable_visual_interface()
Example #39
0
 def run(self):
     bdist_egg.run(self)
Example #40
0
 def run(self):
     self.run_command('genschema')
     bdist_egg.run(self)
Example #41
0
 def run(self):
     build_openzwave = self.distribution.get_command_obj('build_openzwave')
     build_openzwave.develop = True
     self.run_command('build_openzwave')
     _bdist_egg.run(self)
Example #42
0
 def run(self):
     self.distribution.ext_modules = swig_modules
     self.run_command('build_ext')
     bdist_egg.run(self)
Example #43
0
 def run(self):
   self.run_command('CustomCommands')
   _bdist_egg.run(self)
Example #44
0
 def run(self):
     """Call build_man then proceed as normal."""
     self.run_command('build_man')
     bdist_egg.run(self)
Example #45
0
 def run(self):
     self.run_command('compilemessages')
     _bdist_egg.run(self)
Example #46
0
 def run(self):
     self.run_command('DownloadTemplates')
     _bdist_egg.run(self)
Example #47
0
 def run(self):
     _bdist_egg.run(self)
     self.execute(post_install, (self, False), msg="Running post install tasks")
Example #48
0
 def run(self):
     self.run_command('build')
     _bdist_egg.run(self)
Example #49
0
 def run(self):
     self.run_command('build_ext')
     return _bdist_egg.run(self)
Example #50
0
 def run(self):
     self.run_command('download_default_template')
     return bdist_egg.run(self)
Example #51
0
 def run(self):
     create_ecodes()
     bdist_egg.run(self)
Example #52
0
 def run(self):
     bdist_egg.run(self)
     self.run_command('gentab')
Example #53
0
 def run(self):
     self.run_command('build')
     return bdist_egg.run(self)
Example #54
0
 def run(self):
     # Allow installing as a dependency via pip.
     self.run_command("build_ext")
     bdist_egg.run(self)
Example #55
0
 def run(self):
     self.run_command('build_bootloader')
     bdist_egg.run(self)