Skip to content

Commit

Permalink
DOC Add triage team section in "About us" page (#17305)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug authored May 25, 2020
1 parent 9368545 commit 612ebc8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 22 deletions.
46 changes: 25 additions & 21 deletions build_tools/generate_authors_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

print("user:", file=sys.stderr)
user = input()
passwd = getpass.getpass("Password or access token:\n")
auth = (user, passwd)
token = getpass.getpass("access token:\n")
auth = (user, token)

LOGO_URL = 'https://avatars2.githubusercontent.com/u/365630?v=4'
REPO_FOLDER = Path(path.abspath(__file__)).parent.parent
Expand All @@ -38,13 +38,15 @@ def get(url):

def get_contributors():
"""Get the list of contributor profiles. Require admin rights."""
# get members of scikit-learn core-dev on GitHub
# get core devs and triage team
core_devs = []
team = 11523
for page in [1, 2]: # 30 per page
reply = get("https://api.github.com/teams/%d/members?page=%d" %
(team, page))
core_devs.extend(reply.json())
triage_team = []
for team_id, lst in zip((11523, 3593183), (core_devs, triage_team)):
for page in [1, 2]: # 30 per page
reply = get(
f"https://api.github.com/teams/{team_id}/members?page={page}"
)
lst.extend(reply.json())

# get members of scikit-learn on GitHub
members = []
Expand All @@ -55,32 +57,31 @@ def get_contributors():
members.extend(reply.json())

# keep only the logins
core_devs = [c['login'] for c in core_devs]
members = [c['login'] for c in members]
core_devs = set(c['login'] for c in core_devs)
triage_team = set(c['login'] for c in triage_team)
members = set(c['login'] for c in members)

# add missing contributors with GitHub accounts
members.extend(['dubourg', 'mbrucher', 'thouis', 'jarrodmillman'])
members |= {'dubourg', 'mbrucher', 'thouis', 'jarrodmillman'}
# add missing contributors without GitHub accounts
members.extend(['Angel Soler Gollonet'])
members |= {'Angel Soler Gollonet'}
# remove CI bots
members.remove('sklearn-ci')
members.remove('sklearn-lgtm')
members.remove('sklearn-wheels')
members -= {'sklearn-ci', 'sklearn-lgtm', 'sklearn-wheels'}
triage_team -= core_devs # remove ogrisel from triage_team

# remove duplicate, and get the difference of the two sets
core_devs = set(core_devs)
members = set(members)
emeritus = members.difference(core_devs)
emeritus = members - core_devs - triage_team

# get profiles from GitHub
core_devs = [get_profile(login) for login in core_devs]
emeritus = [get_profile(login) for login in emeritus]
triage_team = [get_profile(login) for login in triage_team]

# sort by last name
core_devs = sorted(core_devs, key=key)
emeritus = sorted(emeritus, key=key)
triage_team = sorted(triage_team, key=key)

return core_devs, emeritus
return core_devs, emeritus, triage_team


def get_profile(login):
Expand Down Expand Up @@ -143,10 +144,13 @@ def generate_list(contributors):

if __name__ == "__main__":

core_devs, emeritus = get_contributors()
core_devs, emeritus, triage_team = get_contributors()

with open(REPO_FOLDER / "doc" / "authors.rst", "w+") as rst_file:
rst_file.write(generate_table(core_devs))

with open(REPO_FOLDER / "doc" / "authors_emeritus.rst", "w+") as rst_file:
rst_file.write(generate_list(emeritus))

with open(REPO_FOLDER / "doc" / "triage_team.rst", "w+") as rst_file:
rst_file.write(generate_table(triage_team))
7 changes: 7 additions & 0 deletions doc/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ in the FAQ.

:ref:`How you can contribute to the project <contributing>`

Triage Team
-----------
The following people are active contributors who also help with triaging
issues, PRs, and general maintenance:

.. include:: triage_team.rst

Emeritus Core Developers
------------------------
The following people have been active contributors in the past, but are no
Expand Down
2 changes: 1 addition & 1 deletion doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<div>
<a href='https://github.com/thomasjpfan'><img src='https://avatars2.githubusercontent.com/u/5402633?v=4' class='avatar' /></a> <br />
<p>Thomas J Fan</p>
<p>Thomas J. Fan</p>
</div>
<div>
<a href='https://github.com/agramfort'><img src='https://avatars2.githubusercontent.com/u/161052?v=4' class='avatar' /></a> <br />
Expand Down
12 changes: 12 additions & 0 deletions doc/triage_team.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. raw :: html
<!-- Generated by generate_authors_table.py -->
<div class="sk-authors-container">
<style>
img.avatar {border-radius: 10px;}
</style>
<div>
<a href='https://github.com/cmarmo'><img src='https://avatars3.githubusercontent.com/u/1662261?v=4' class='avatar' /></a> <br />
<p>Chiara Marmo</p>
</div>
</div>

0 comments on commit 612ebc8

Please sign in to comment.