當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。