Skip to content

Commit

Permalink
[internal] Change contributors script to not cite # of contributions (p…
Browse files Browse the repository at this point in the history
…antsbuild#14005)

We decided as maintainers that we don't want to emphasize the # of commits in our weekly release emails thanking code contributors. # of commits is not a great way to measure contributions, and it also creates a hierarchy we don't want to emphasize.

Instead, the maintainers informally voted to drop # of contributions and sort the contributors alphabetically. We also considered randomly.

In the process, this rewrites the contributor script to use Python.

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano authored Dec 28, 2021
1 parent 19801e8 commit 10dec99
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 77 deletions.
15 changes: 12 additions & 3 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Created by running `./build-support/bin/contributors.sh`.
Created by running `./pants run build-support/bin/contributors.py`.

+ Aaron Mitchell
+ Adam Chainz
+ Adam Retter
+ Alan Paulin
+ Alan Velasco
+ Alex Schmitt
+ Alexander Johnson
+ Alexey Tereshenkov
+ Alyssa Pohahau
+ Andreas Stenius
+ Andrew Hamilton
+ Andy Reitz
Expand All @@ -23,6 +23,7 @@ Created by running `./build-support/bin/contributors.sh`.
+ Brian Wickman
+ Bruno Bieth
+ Caitie McCaffrey
+ Caspar Krieger
+ Chris Aniszczyk
+ Chris Borckholder
+ Chris Burroughs
Expand All @@ -32,6 +33,7 @@ Created by running `./build-support/bin/contributors.sh`.
+ Chris Pesto
+ Chris Williams
+ Christopher Livingston
+ Christopher Maier
+ Christopher Neugebauer
+ Cody Gibb
+ Colin Taylor
Expand Down Expand Up @@ -71,11 +73,13 @@ Created by running `./build-support/bin/contributors.sh`.
+ Fedor Korotkov
+ Fiona Condone
+ Florian Leibert
+ Fredrik Ekholdt
+ Gabriel Gonzalez
+ Garrett Malmquist
+ Gary M. Josack
+ Gordon Cassie
+ Greg Shuflin
+ Grzegorz Kossakowski
+ Guy Marom
+ Harley Cooper
+ Henry Fuller
Expand Down Expand Up @@ -116,6 +120,7 @@ Created by running `./build-support/bin/contributors.sh`.
+ Jonathan Sokolowski
+ Josh Reed
+ Josh Soref
+ Josh Suereth
+ Joshua Cannon
+ Joshua Cohen
+ Joshua Humphries
Expand Down Expand Up @@ -183,12 +188,16 @@ Created by running `./build-support/bin/contributors.sh`.
+ Patrick Lawson
+ Patrick Liu
+ Paul Groudas
+ Paul Phillips
+ Paul Yau
+ Peiyu Wang
+ Peter Seibel
+ Peter Vlugter
+ Pierre Chevalier
+ Pierre DAL-PRA
+ Qicheng Ma
+ Raúl Cuza
+ Rhys Madigan
+ Robert Stapenhurst
+ Roger Jiang
+ Roman Andriadi
Expand Down Expand Up @@ -236,6 +245,6 @@ Created by running `./build-support/bin/contributors.sh`.
+ Yuhan GUO
+ Yujie Chen
+ billybecker
+ eugene yokota
+ hephex
+ riisi
+ Ólafur Páll Geirsson
1 change: 1 addition & 0 deletions build-support/bin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pex_binaries(
"changelog.py",
"check_banned_imports.py",
"check_inits.py",
"contributors.py",
"deploy_to_s3.py",
"_generate_all_lockfiles_helper.py",
"generate_docs.py",
Expand Down
49 changes: 49 additions & 0 deletions build-support/bin/contributors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import annotations

import argparse
import subprocess
from pathlib import Path


def create_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description="Generate contributor list")
parser.add_argument(
"-s", "--since", help="Contributors since this revision, e.g. the Git tag `release_2.8.0`"
)
return parser


def main() -> None:
args = create_parser().parse_args()
if args.since:
print(" " + "\n ".join(sorted_contributors(range=f"{args.since}..HEAD")))
else:
update_contributors_md()


def sorted_contributors(range: str) -> list[str]:
contributors = set(
subprocess.run(
["git", "log", "--use-mailmap", "--format=format:%aN", range],
stdout=subprocess.PIPE,
check=True,
)
.stdout.decode()
.splitlines()
)
return sorted(contributors)


def update_contributors_md() -> None:
Path("CONTRIBUTORS.md").write_text(
"Created by running `./pants run build-support/bin/contributors.py`.\n\n+ "
+ "\n+ ".join(sorted_contributors(range="HEAD"))
+ "\n"
)


if __name__ == "__main__":
main()
74 changes: 0 additions & 74 deletions build-support/bin/contributors.sh

This file was deleted.

0 comments on commit 10dec99

Please sign in to comment.