Skip to content

Commit 4ccc19a

Browse files
Backport PR #71465 on branch 3.1.x (DOC: update announce (contributor listing) script for new bots/agents) (#71467)
Co-authored-by: Joris Van den Bossche <[email protected]>
1 parent 24dae63 commit 4ccc19a

1 file changed

Lines changed: 38 additions & 7 deletions

File tree

‎doc/sphinxext/announce.py‎

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@
5656
"""
5757

5858

59+
def _is_agent(name):
60+
return any(
61+
name.startswith(agent)
62+
for agent in [
63+
"copilot-",
64+
"deepseek-",
65+
"Claude Fable",
66+
"Claude Opus",
67+
"Claude Sonnet",
68+
"Copilot",
69+
]
70+
)
71+
72+
5973
def get_authors(revision_range):
6074
pat = "^.*\\t(.*)$"
6175
lst_release, cur_release = (r.strip() for r in revision_range.split(".."))
@@ -76,20 +90,37 @@ def get_authors(revision_range):
7690
# and one for regular commits.
7791
xpr = re.compile(r"Co-authored-by: (?P<name>[^<\n]+)\s")
7892
cur = set(
79-
xpr.findall(
80-
this_repo.git.log("--grep=Co-authored", "--pretty=%b", revision_range)
81-
)
93+
[
94+
name
95+
for name in xpr.findall(
96+
this_repo.git.log("--grep=Co-authored", "--pretty=%b", revision_range)
97+
)
98+
if not _is_agent(name)
99+
]
82100
)
83101
cur |= set(re.findall(pat, this_repo.git.shortlog("-s", revision_range), re.M))
84102

85103
pre = set(
86-
xpr.findall(this_repo.git.log("--grep=Co-authored", "--pretty=%b", lst_release))
104+
[
105+
name
106+
for name in xpr.findall(
107+
this_repo.git.log("--grep=Co-authored", "--pretty=%b", lst_release)
108+
)
109+
if not _is_agent(name)
110+
]
87111
)
88112
pre |= set(re.findall(pat, this_repo.git.shortlog("-s", lst_release), re.M))
89113

90-
# Homu is the author of auto merges, clean him out.
91-
cur.discard("Homu")
92-
pre.discard("Homu")
114+
# Discard various bot authors
115+
for bot in [
116+
"Homu",
117+
"Lumberbot (aka Jack)",
118+
"dependabot[bot]",
119+
"github-actions[bot]",
120+
"pre-commit-ci[bot]",
121+
]:
122+
cur.discard(bot)
123+
pre.discard(bot)
93124

94125
# Rename contributors according to mapping.
95126
for old_name, new_name in CONTRIBUTOR_MAPPING.items():

0 commit comments

Comments
 (0)