Skip to content

Commit

Permalink
Generate emeritus maintainers
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Jul 6, 2023
1 parent 6dc26b3 commit 1748470
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 35 deletions.
2 changes: 2 additions & 0 deletions content/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Contributions of any kind are welcome!

{{< include-html "static/teams/maintainers.html" >}}

{{< include-html "static/teams/emeritus-maintainers.html" >}}

{{< include-html "static/teams/maintainer-trainees.html" >}}

{{< include-html "static/teams/contributors.html" >}}
Expand Down
50 changes: 45 additions & 5 deletions scripts/generate_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@
import requests
import string

# Current maintainers and maintainer trainees, hard-coded in alphabetical order
# A list of emeritus maintainers, current maintainers, and maintainer trainees
# hard-coded in alphabetical order

PYBAMM_MAINTAINERS = [
"brosaplanella",
"martinjrobins",
"priyanshuone6",
"rtimms",
"Saransh-cpp",
"Scottmar93",
"tinosulzer",
"tlestang",
"TomTranter",
]

PYBAMM_EMERITUS_MAINTAINERS = [
"Scottmar93",
"tlestang",
]

PYBAMM_MAINTAINER_TRAINEES = [
"Afgr1087",
"DrSOKane",
Expand All @@ -46,6 +51,7 @@ def get_contributors():
for contributor in PYBAMM_CONTRIBUTORS
# Exclude maintainers and maintainer trainees
if contributor["login"] not in PYBAMM_MAINTAINERS
and contributor["login"] not in PYBAMM_EMERITUS_MAINTAINERS
and contributor["login"] not in PYBAMM_MAINTAINER_TRAINEES
# Exclude the pre-commit-ci and allcontributors bots
and contributor["login"] != "pre-commit-ci[bot]"
Expand All @@ -66,8 +72,23 @@ def get_maintainers():
}
for maintainer in PYBAMM_CONTRIBUTORS
if maintainer["login"] in PYBAMM_MAINTAINERS
if maintainer["login"] not in PYBAMM_EMERITUS_MAINTAINERS
]

def get_emeritus_maintainers():
"""
Get the "login", "html_url", and "avatar_url" fields for each emeritus maintainer
from the list of emeritus maintainers.
"""
return [
{
"login": emeritus_maintainer["login"],
"html_url": emeritus_maintainer["html_url"],
"avatar_url": emeritus_maintainer["avatar_url"],
}
for emeritus_maintainer in PYBAMM_CONTRIBUTORS
if emeritus_maintainer["login"] in PYBAMM_EMERITUS_MAINTAINERS
]

def get_maintainer_trainees():
"""
Expand All @@ -92,7 +113,7 @@ def get_maintainer_trainees():
]

# The team name can be either of the following:
# maintainers, maintainer trainees, or contributors
# emeritus maintainers, maintainers, maintainer trainees, or contributors
team_template = string.Template(
"""
<div class="team">
Expand Down Expand Up @@ -129,7 +150,7 @@ def get_maintainer_trainees():
with open("static/teams/maintainers.html", "w") as file:
file.write(
team_template.substitute(
team_name="Maintainers (current and emeritus)",
team_name="Maintainers",
members="\n".join(
[
member_template.substitute(
Expand All @@ -143,6 +164,25 @@ def get_maintainer_trainees():
)
)

# Generate the HTML in static/teams/emeritus-maintainers.html, overwriting as necessary
print("Generating emeritus maintainers...")
with open("static/teams/emeritus-maintainers.html", "w") as file:
file.write(
team_template.substitute(
team_name="Emeritus Maintainers",
members="\n".join(
[
member_template.substitute(
url=emeritus_maintainer["html_url"],
avatarUrl=emeritus_maintainer["avatar_url"],
name=emeritus_maintainer["login"],
)
for emeritus_maintainer in get_emeritus_maintainers()
]
),
)
)

# Generate the HTML in static/teams/maintainer-trainees.html, overwriting as necessary
print("Generating maintainer trainees...")
with open("static/teams/maintainer-trainees.html", "w") as file:
Expand Down
36 changes: 36 additions & 0 deletions static/teams/emeritus-maintainers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

<div class="team">
<h3 id="Emeritus Maintainers"class="name title">
Emeritus Maintainers
</h3>
<div class="members">

<div class="member">
<a href="https://github.com/Scottmar93" class="name">
<div class="photo">
<img
src="https://avatars.githubusercontent.com/u/22661308?v=4"
loading="lazy"
alt="Avatar of Scottmar93"
/>
</div>
Scottmar93
</a>
</div>


<div class="member">
<a href="https://github.com/tlestang" class="name">
<div class="photo">
<img
src="https://avatars.githubusercontent.com/u/13448239?v=4"
loading="lazy"
alt="Avatar of tlestang"
/>
</div>
tlestang
</a>
</div>

</div>
</div>
32 changes: 2 additions & 30 deletions static/teams/maintainers.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<div class="team">
<h3 id="Maintainers (current and emeritus)"class="name title">
Maintainers (current and emeritus)
<h3 id="Maintainers"class="name title">
Maintainers
</h3>
<div class="members">

Expand Down Expand Up @@ -47,20 +47,6 @@ <h3 id="Maintainers (current and emeritus)"class="name title">
</div>


<div class="member">
<a href="https://github.com/Scottmar93" class="name">
<div class="photo">
<img
src="https://avatars.githubusercontent.com/u/22661308?v=4"
loading="lazy"
alt="Avatar of Scottmar93"
/>
</div>
Scottmar93
</a>
</div>


<div class="member">
<a href="https://github.com/brosaplanella" class="name">
<div class="photo">
Expand All @@ -75,20 +61,6 @@ <h3 id="Maintainers (current and emeritus)"class="name title">
</div>


<div class="member">
<a href="https://github.com/tlestang" class="name">
<div class="photo">
<img
src="https://avatars.githubusercontent.com/u/13448239?v=4"
loading="lazy"
alt="Avatar of tlestang"
/>
</div>
tlestang
</a>
</div>


<div class="member">
<a href="https://github.com/Saransh-cpp" class="name">
<div class="photo">
Expand Down

0 comments on commit 1748470

Please sign in to comment.