MCPcopy
hub / github.com/pydata/xarray / main

Function main

ci/release_contributors.py:36–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def 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
71if __name__ == "__main__":

Callers 1

Calls 7

lastFunction · 0.85
is_ignoredFunction · 0.85
findallMethod · 0.80
itemsMethod · 0.80
rstripMethod · 0.80
updateMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…