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


Python sdist.make_release_tree方法代码示例

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


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

示例1: make_release_tree

# 需要导入模块: from setuptools.command.sdist import sdist [as 别名]
# 或者: from setuptools.command.sdist.sdist import make_release_tree [as 别名]
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)

# XXX These should be attributes of `setup', but helpful distutils
# doesn't pass them through when it doesn't know about them a priori. 
开发者ID:probcomp,项目名称:cgpm,代码行数:18,代码来源:setup.py

示例2: get_cmdclass

# 需要导入模块: from setuptools.command.sdist import sdist [as 别名]
# 或者: from setuptools.command.sdist.sdist import make_release_tree [as 别名]
def get_cmdclass(build_py=None, sdist=None):
    """Create cmdclass dict to pass to setuptools.setup that will write a
    _version_static.py file in our resultant sdist, wheel or egg"""
    if build_py is None:
        from setuptools.command.build_py import build_py
    if sdist is None:
        from setuptools.command.sdist import sdist

    def make_version_static(base_dir, pkg):
        vg = os.path.join(base_dir, pkg.split(".")[0], "_version_git.py")
        if os.path.isfile(vg):
            lines = open(vg).readlines()
            with open(vg, "w") as f:
                for line in lines:
                    # Replace GIT_* with static versions
                    if line.startswith("GIT_SHA1 = "):
                        f.write("GIT_SHA1 = '%s'\n" % git_sha1)
                    elif line.startswith("GIT_REFS = "):
                        f.write("GIT_REFS = 'tag: %s'\n" % __version__)
                    else:
                        f.write(line)

    class BuildPy(build_py):
        def run(self):
            build_py.run(self)
            for pkg in self.packages:
                make_version_static(self.build_lib, pkg)

    class Sdist(sdist):
        def make_release_tree(self, base_dir, files):
            sdist.make_release_tree(self, base_dir, files)
            for pkg in self.distribution.packages:
                make_version_static(base_dir, pkg)

    return dict(build_py=BuildPy, sdist=Sdist) 
开发者ID:gilesknap,项目名称:gphotos-sync,代码行数:37,代码来源:_version_git.py

示例3: make_release_tree

# 需要导入模块: from setuptools.command.sdist import sdist [as 别名]
# 或者: from setuptools.command.sdist.sdist import make_release_tree [as 别名]
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,代码行数:15,代码来源:setup.py

示例4: make_release_tree

# 需要导入模块: from setuptools.command.sdist import sdist [as 别名]
# 或者: from setuptools.command.sdist.sdist import make_release_tree [as 别名]
def make_release_tree(self, basedir, files):
        _sdist.make_release_tree(self, basedir, files)
        self.execute(_run_build_tables, (basedir,),
                     msg="Build the lexing/parsing tables") 
开发者ID:johncsnyder,项目名称:SwiftKitten,代码行数:6,代码来源:setup.py

示例5: make_release_tree

# 需要导入模块: from setuptools.command.sdist import sdist [as 别名]
# 或者: from setuptools.command.sdist.sdist import make_release_tree [as 别名]
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, 'lemur-package.json'), 'w') as fp:
            json.dump({
                'createdAt': datetime.datetime.utcnow().isoformat() + 'Z',
            }, fp) 
开发者ID:Netflix,项目名称:lemur,代码行数:14,代码来源:setup.py

示例6: make_release_tree

# 需要导入模块: from setuptools.command.sdist import sdist [as 别名]
# 或者: from setuptools.command.sdist.sdist import make_release_tree [as 别名]
def make_release_tree(self, base_dir, files):
        if has_cython:
            files = self.__filter_files(files)
        _sdist.make_release_tree(self, base_dir, files)
        minify_static_files(base_dir, files, self.static_exclude) 
开发者ID:vstconsulting,项目名称:polemarch,代码行数:7,代码来源:setup.py

示例7: make_release_tree

# 需要导入模块: from setuptools.command.sdist import sdist [as 别名]
# 或者: from setuptools.command.sdist.sdist import make_release_tree [as 别名]
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,代码行数:11,代码来源:setup.py


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