()
| 34 | |
| 35 | |
| 36 | def main(): |
| 37 | repo = git.Repo(".") |
| 38 | |
| 39 | most_recent_release = last(list(repo.tags)) |
| 40 | |
| 41 | # extract information from commits |
| 42 | contributors = {} |
| 43 | for commit in repo.iter_commits(f"{most_recent_release.name}.."): |
| 44 | matches = co_author_re.findall(commit.message) |
| 45 | if matches: |
| 46 | contributors.update({email: name for name, email in matches}) |
| 47 | contributors[commit.author.email] = commit.author.name |
| 48 | |
| 49 | # deduplicate and ignore |
| 50 | # TODO: extract ignores from .github/release.yml |
| 51 | unique_contributors = unique( |
| 52 | name for email, name in contributors.items() if not is_ignored(name, email) |
| 53 | ) |
| 54 | |
| 55 | sorted_ = sorted(unique_contributors) |
| 56 | if len(sorted_) > 1: |
| 57 | names = f"{', '.join(sorted_[:-1])} and {sorted_[-1]}" |
| 58 | else: |
| 59 | names = "".join(sorted_) |
| 60 | |
| 61 | statement = textwrap.dedent( |
| 62 | f"""\ |
| 63 | Thanks to the {len(sorted_)} contributors to this release: |
| 64 | {names} |
| 65 | """.rstrip() |
| 66 | ) |
| 67 | |
| 68 | print(statement) |
| 69 | |
| 70 | |
| 71 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…