• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python sdist.make_release_tree函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: make_release_tree

    def make_release_tree(self, base_dir, files):
        """
        Create the files in subdir base_dir ready for packaging
        After the normal make_release_tree ran, we insert shared_setup
        and modify the to-be-packaged setup.py
        """

        log.error("sdist make_release_tree original base_dir %s files %s" % (base_dir, files))
        log.error("sdist from shared_setup %s current dir %s" % (__file__, os.getcwd()))
        if os.path.exists(base_dir):
            # no autocleanup?
            # can be a leftover of earlier crash/raised exception
            raise Exception("base_dir %s present. Please remove it" % base_dir)

        sdist.make_release_tree(self, base_dir, files)

        if __name__ == '__main__':
            log.error('running shared_setup as main, not adding it to sdist')
        else:
            # use a new name, to avoid confusion with original
            new_shared_setup = 'shared_setup_dist_only'
            external_dir = 'external_dist_only'
            self._mod_setup_py(base_dir, external_dir, new_shared_setup)

            self._add_shared_setup(base_dir, external_dir, new_shared_setup)
开发者ID:stdweird,项目名称:vsc-install,代码行数:25,代码来源:shared_setup.py


示例2: make_release_tree

    def make_release_tree(self, base_dir, files):
        """
        Create the files in subdir base_dir ready for packaging
        After the normal make_release_tree ran, we insert shared_setup
        and modify the to-be-packaged setup.py
        """

        log.info("sdist make_release_tree original base_dir %s files %s" % (base_dir, files))
        log.info("sdist from shared_setup %s current dir %s" % (__file__, os.getcwd()))
        if os.path.exists(base_dir):
            # no autocleanup?
            # can be a leftover of earlier crash/raised exception
            raise Exception("base_dir %s present. Please remove it" % base_dir)

        sdist.make_release_tree(self, base_dir, files)

        # have to make sure setup.py is not a symlink
        dest, code = self._copy_setup_py(base_dir)

        if __name__ == '__main__':
            log.info('running shared_setup as main, not adding it to sdist')
        else:
            # use a new name, to avoid confusion with original
            self._mod_setup_py(dest, code)

            self._add_shared_setup(base_dir)

        # Add mandatory files
        for fn in [LICENSE, README]:
            self.copy_file(os.path.join(REPO_BASE_DIR, fn), os.path.join(base_dir, fn))
开发者ID:geimer,项目名称:vsc-install,代码行数:30,代码来源:shared_setup.py


示例3: make_release_tree

 def make_release_tree(self, base_dir, files):
   sdist.make_release_tree(self, base_dir, files)
   sdist_version_ini = os.path.join(base_dir, "version.ini")
   if os.path.exists(sdist_version_ini):
     os.unlink(sdist_version_ini)
   shutil.copy(
       os.path.join(THIS_DIRECTORY, "../../../version.ini"), sdist_version_ini)
开发者ID:kleopatra999,项目名称:grr,代码行数:7,代码来源:setup.py


示例4: make_release_tree

 def make_release_tree(self, basedir, files):
     clean_tables()
     build_tables()
     dirty = dirty_version()
     sdist.make_release_tree(self, basedir, files)
     if dirty:
         discard_changes()
开发者ID:kyokley,项目名称:xonsh,代码行数:7,代码来源:setup.py


示例5: make_release_tree

 def make_release_tree(self, base_dir, files):
     print("in sdist_testimages.make_release_tree")
     sdist.make_release_tree(self, base_dir, files)
     for afile in self.to_remove:
         dest = os.path.join(base_dir, afile)
         if os.path.exists(dest):
             os.unlink(dest)
开发者ID:payno,项目名称:fabio,代码行数:7,代码来源:setup.py


示例6: make_release_tree

 def make_release_tree(self, base_dir, files):
     if 'flent/build_info.py' in files and not self.dry_run:
         files = [f for f in files if f != 'flent/build_info.py']
         _sdist.make_release_tree(self, base_dir, files)
         rewrite_build_info(os.path.join(base_dir, 'flent/build_info.py'))
     else:
         _sdist.make_release_tree(self, base_dir, files)
开发者ID:dchangtw,项目名称:flent,代码行数:7,代码来源:setup.py


示例7: make_release_tree

    def make_release_tree (self, base_dir, files, ) :
        sdist_orig.make_release_tree(self, base_dir, files, )

        with file(os.path.join(base_dir, "__version__.py", ), "w", ) as f :
            f.write(
                    "VERSION = \"%s\"" % getattr(self.distribution.metadata, "version", )
                )
开发者ID:srothan,项目名称:io,代码行数:7,代码来源:_setup.py


示例8: make_release_tree

 def make_release_tree(self, basedir, files):
     clean_tables()
     build_tables()
     dirty = dirty_version()
     sdist.make_release_tree(self, basedir, files)
     if dirty:
         restore_version()
开发者ID:BlaXpirit,项目名称:xonsh,代码行数:7,代码来源:setup.py


示例9: make_release_tree

    def make_release_tree(self, *a, **kw):
        dist_path = self.distribution.get_fullname()

        sdist.make_release_tree(self, *a, **kw)

        self.reinitialize_command('build_static', work_path=dist_path,
                                  force=True)
        self.run_command('build_static')
开发者ID:nakamura41,项目名称:sentry,代码行数:8,代码来源:setup.py


示例10: make_release_tree

    def make_release_tree(self, base_dir, files):
        orig_sdist.make_release_tree(self, base_dir, files)

        # add additional dependecies in the required version
        for name, tar_src in self.contrib:
            tarball = tar_src.format(versions[name + '_version'])
            print("Downloading and adding {} sources from {}".format(name, tarball))
            subprocess.call('wget -O - -q {} | tar xz -C {} --one-top-level=contrib/{} --strip-components=1'.format(
                   tarball, base_dir, name), shell=True)
开发者ID:osmcode,项目名称:pyosmium,代码行数:9,代码来源:setup.py


示例11: make_release_tree

 def make_release_tree (self, base_dir, files):
     _sdist.make_release_tree(self, base_dir, files)
     orig = path.join('lib', 'git', '__init__.py')
     assert path.exists(orig)
     dest = path.join(base_dir, orig)
     if hasattr(os, 'link') and path.exists(dest):
         os.unlink(dest)
     self.copy_file(orig, dest)
     _stamp_version(dest)
开发者ID:directeur,项目名称:git-python,代码行数:9,代码来源:setup.py


示例12: make_release_tree

 def make_release_tree(self, base_dir, files):
     _sdist.make_release_tree(self, base_dir, files)
     orig = path.join("git", "__init__.py")
     assert path.exists(orig), orig
     dest = path.join(base_dir, orig)
     if hasattr(os, "link") and path.exists(dest):
         os.unlink(dest)
     self.copy_file(orig, dest)
     _stamp_version(dest)
开发者ID:isaacde,项目名称:rmtoo,代码行数:9,代码来源:setup.py


示例13: make_release_tree

 def make_release_tree(self, base_dir, files):
     _sdist.make_release_tree(self, base_dir, files)
     # now locate _version.py in the new base_dir directory (remembering
     # that it may be a hardlink) and replace it with an updated value
     target_versionfile = os.path.join(base_dir, versionfile_source)
     print("UPDATING %s" % target_versionfile)
     os.unlink(target_versionfile)
     with open(target_versionfile, "w") as f:
         f.write(SHORT_VERSION_PY % self._versioneer_generated_versions)
开发者ID:gobie28,项目名称:MetPy,代码行数:9,代码来源:versioneer.py


示例14: make_release_tree

 def make_release_tree(self, base_dir, files):
     root = get_root()
     cfg = get_config_from_root(root)
     _sdist.make_release_tree(self, base_dir, files)
     # now locate _version.py in the new base_dir directory
     # (remembering that it may be a hardlink) and replace it with an
     # updated value
     target_versionfile = os.path.join(base_dir, cfg.versionfile_source)
     print("UPDATING %s" % target_versionfile)
     write_to_version_file(target_versionfile,
                           self._versioneer_generated_versions)
开发者ID:cryfs,项目名称:python-versioneer,代码行数:11,代码来源:cmdclass.py


示例15: make_release_tree

    def make_release_tree(self, *a, **kw):
        dist_path = self.distribution.get_fullname()

        sdist.make_release_tree(self, *a, **kw)

        self.reinitialize_command('build_static', work_path=dist_path)
        self.run_command('build_static')

        with open(os.path.join(dist_path, 'sentry-package.json'), 'w') as fp:
            json.dump({
                'createdAt': datetime.datetime.utcnow().isoformat() + 'Z',
            }, fp)
开发者ID:stig,项目名称:sentry,代码行数:12,代码来源:setup.py


示例16: make_release_tree

    def make_release_tree(self, base_dir, files):
        sdist.make_release_tree(self, base_dir, files)

        fname = os.path.join(base_dir, SAVED_VERSION_FILE)
        # This could be a hard link, so try to delete it first.  Is there any way
        # to do this atomically together with opening?
        try:
            os.remove(fname)
        except OSError:
            pass
        with open(fname, 'w') as f:
            f.write("# This file has been generated by setup.py.\n{}\n"
                    .format(version))
开发者ID:pombredanne,项目名称:tinyarray,代码行数:13,代码来源:setup.py


示例17: make_release_tree

 def make_release_tree(self, base_dir, files):
     import os
     sdist.make_release_tree(self, base_dir, files)
     version_file = os.path.join(base_dir, 'VERSION')
     print('updating %s' % (version_file,))
     # Write to temporary file first and rename over permanent not
     # just to avoid atomicity issues (not likely an issue since if
     # interrupted the whole sdist directory is only partially
     # written) but because the upstream sdist may have made a hard
     # link, so overwriting in place will edit the source tree.
     with open(version_file + '.tmp', 'wb') as f:
         f.write('%s\n' % (pkg_version,))
     os.rename(version_file + '.tmp', version_file)
开发者ID:probcomp,项目名称:bayeslite,代码行数:13,代码来源:setup.py


示例18: make_release_tree

    def make_release_tree(self, base_dir, files):
        sdist_orig.make_release_tree(self, base_dir, files)
        target = os.path.join(base_dir, "setup.py")
        with open(__file__) as fp:
            template = fp.read()
        ver = self.distribution.version
        if not ver:
            from setuptools_scm import get_version

            ver = get_version(**scm_config())

        finalized = template.replace("use_scm_version=scm_config,\n", 'version="%s",\n' % ver)
        os.remove(target)
        with open(target, "w") as fp:
            fp.write(finalized)
开发者ID:kynan,项目名称:pyscaffold,代码行数:15,代码来源:setup.py


示例19: add_to_sdist

def add_to_sdist(self=None, base_dir=os.curdir, files=()):
    """ The custom part of the sdist command.

        >>> add_to_sdist(base_dir='/tmp')
        == Rendering:
        ...
        >>> add_to_sdist(base_dir='/tmp')
        == Rendering:
        ...
        >>> def boom(file=None):
        ...     raise OSError('File not found.')
        >>> import os
        >>> _exists = os.path.exists
        >>> os.path.exists = boom
        >>> add_to_sdist(base_dir='/tmp')
        == Rendering:
        ...
        >>> os.path.exists = _exists
    """
    # now locate _version.py in the new base_dir directory
    # (remembering that it may be a hardlink) and replace it with an
    # updated value

    self and _sdist.make_release_tree(self, base_dir, files)

    source_versionfile, build_versionfile = read_setup_cfg()
    target_versionfile = os.path.join(base_dir, build_versionfile)
    static_versionfile = versionfile.render_static_file() if versionfile else 'test_content'
    print("== Rendering:\n%s\n== To Versionfile: %s" % (static_versionfile, target_versionfile))

    try:
        # handles the hard link case correctly
        os.path.exists(target_versionfile) and os.unlink(target_versionfile)
        with open(target_versionfile, 'w') as fh: fh.write(static_versionfile)
    except:
        print("=== Could not render static _version.py to sdist!")

    self_target = join(base_dir, basename(__file__))
    print("== Updating: %s" % self_target)
    try:
        os.path.exists(self_target) or os.link(__file__, self_target)
    except OSError:
        print("=== Could not add %s to sdist!" % basename(__file__))
开发者ID:isnok,项目名称:asciidrumming,代码行数:43,代码来源:versioning.py


示例20: make_release_tree

 def make_release_tree(self, base_dir, files):
     sdist.make_release_tree(self, base_dir, files)
     self.apply_patches(base_dir)
开发者ID:mvanbreeden,项目名称:motioneye,代码行数:3,代码来源:setup.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python sdist.run函数代码示例发布时间:2022-05-27
下一篇:
Python sdist.add_defaults函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap