def _from_git(distribution): option_dict = distribution.get_option_dict('pbr') changelog = git._iter_log_oneline() if changelog: changelog = git._iter_changelog(changelog) git.write_git_changelog(option_dict=option_dict, changelog=changelog) git.generate_authors(option_dict=option_dict)
def run(self): option_dict = self.distribution.get_option_dict('pbr') changelog = git._iter_log_oneline(option_dict=option_dict) if changelog: changelog = git._iter_changelog(changelog) git.write_git_changelog(option_dict=option_dict, changelog=changelog) git.generate_authors(option_dict=option_dict) # sdist.sdist is an old style class, can't use super() sdist.sdist.run(self)
def generate_changelog(*args, **kwargs): changelog = _iter_log_oneline(git_dir=os.path.join('..', '.git')) if changelog: changelog = _iter_changelog(changelog) if not changelog: return new_changelog = 'changelog.rst' new_content = bytearray() for _, content in changelog: new_content += content.encode('utf-8') if os.path.isfile(new_changelog) and hashlib.sha256(new_content).digest() == sha256_file(new_changelog).digest(): return with io.open(new_changelog, "wb") as changelog_file: changelog_file.write(new_content)