当前位置: 首页>>代码示例>>Python>>正文


Python bdist_egg.run函数代码示例

本文整理汇总了Python中setuptools.command.bdist_egg.bdist_egg.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

    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')
开发者ID:HackerTool,项目名称:exploitable,代码行数:29,代码来源:setup.py

示例2: run

    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
开发者ID:mdavezac,项目名称:bempp,代码行数:8,代码来源:setup.py

示例3: run

 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)
开发者ID:ssbb,项目名称:Phoenix,代码行数:8,代码来源:setup.py

示例4: run

 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()
开发者ID:ccbrown,项目名称:needy,代码行数:9,代码来源:setup.py

示例5: run

 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)
开发者ID:lelou6666,项目名称:PySOL,代码行数:9,代码来源:setup.py

示例6: run

 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",
             "************************************************************",
         ]))
开发者ID:Beyond-Digital,项目名称:wagtail,代码行数:10,代码来源:setup.py

示例7: run

    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)
开发者ID:manahl,项目名称:pkglib,代码行数:45,代码来源:test_egg.py

示例8: run

    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)
开发者ID:intiocean,项目名称:pkglib,代码行数:45,代码来源:test_egg.py

示例9: run

 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)
开发者ID:christianbrodbeck,项目名称:Phoenix,代码行数:43,代码来源:setup.py

示例10: run

    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())
开发者ID:enthought,项目名称:enstaller,代码行数:19,代码来源:setup.py

示例11: run

 def run(self):
     self.distribution.ext_modules = swig_modules
     self.run_command('build_ext')
     bdist_egg.run(self)
开发者ID:Applied-GeoSolutions,项目名称:gippy,代码行数:4,代码来源:setup.py

示例12: run

 def run(self):
     call(["pip install -r requirements.txt --no-clean"], shell=True)
     _bdist_egg.run(self)
开发者ID:peterdeka,项目名称:tornado-botocore,代码行数:3,代码来源:setup.py

示例13: run

 def run(self):
     self.run_command('build_ext')
     bdist_egg.run(self)
开发者ID:asascience-open,项目名称:udunitspy,代码行数:3,代码来源:setup.py

示例14: run

 def run(self):
     compile_AHK()
     bdist_egg.run(self)
     clean_egg_info()
开发者ID:selimb,项目名称:nx_tools,代码行数:4,代码来源:setup.py

示例15: run

 def run(self):
     self.call_command('build_clib')
     bdist_egg.run(self)
开发者ID:andre-martins,项目名称:AD3,代码行数:3,代码来源:setup.py


注:本文中的setuptools.command.bdist_egg.bdist_egg.run函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。