MNT: Update prep_zenodo blacklist, run blue
@@ -9,11 +9,18 @@ from tempfile import TemporaryDirectory
def decommify(name):
return ' '.join(name.split(', ')[::-1])
+
# Users who have asked not to be cited at this time
# XXX We should add a shortlog since the most recent tag and explicitly note
# that a blacklisted user has contributed again recently, and verify they still
# do not want to be cited.
-blacklist = {'Cecile Madjar', 'Matthew Wardrop', 'Peter Van Dyken', 'github-actions[bot]'}
+blacklist = {
+ 'Cecile Madjar',
+ 'Matthew Wardrop',
+ 'Peter Van Dyken',
+ 'github-actions[bot]',
+ 'dependabot[bot]',
+}
# List of repositories whose commits should be counted as contributions
codependents = [('https://github.com/grabbles/grabbit.git', '0.2.6')]
@@ -27,12 +34,16 @@ zenodo_file = git_root / '.zenodo.json'
zenodo = json.loads(zenodo_file.read_text()) if zenodo_file.exists() else {}
orig_creators = zenodo.get('creators', [])
-creator_map = {decommify(creator['name']): creator
- for creator in orig_creators}
+creator_map = {
+ decommify(creator['name']): creator for creator in orig_creators
+}
shortlog = run(['git', 'shortlog', '-ns', f'{origin_commit}..'], stdout=PIPE)
-counts = [line.split('\t', 1)[::-1]
- for line in shortlog.stdout.decode().split('\n') if line]
+counts = [
+ line.split('\t', 1)[::-1]
+ for line in shortlog.stdout.decode().split('\n')
+ if line
+]
# Get additional commit counts from dependencies
with TemporaryDirectory() as tmpdir:
@@ -46,7 +57,7 @@ with TemporaryDirectory() as tmpdir:
try:
clone = run(['git', 'clone', '-q', repo, repo_dir], check=True)
except CalledProcessError as err:
- raise RuntimeError("Could not clone {}".format(repo)) from err
+ raise RuntimeError(f'Could not clone {repo}') from err
if ref is None:
tag = run(['git', '-C', repo_dir, 'tag'], stdout=PIPE)
@@ -54,11 +65,13 @@ with TemporaryDirectory() as tmpdir:
ref = tag.stdout.decode().strip().rsplit('\n', 1)[1]
dep_shortlog = run(
- ['git', '-C', repo_dir, 'shortlog', '-ns', ref],
- stdout=PIPE)
- counts.extend(line.split('\t', 1)[::-1]
+ ['git', '-C', repo_dir, 'shortlog', '-ns', ref], stdout=PIPE
+ )
+ counts.extend(
+ line.split('\t', 1)[::-1]
for line in dep_shortlog.stdout.decode().split('\n')
- if line)
+ if line
+ )
commit_counts = {}
for committer, commits in counts:
@@ -67,9 +80,12 @@ for committer, commits in counts:
# Stable sort:
# Number of commits in reverse order
# Ties broken by alphabetical order of first name
-committers = [committer
- for committer, _ in sorted(commit_counts.items(),
- key=lambda x: (-x[1], x[0]))]
+committers = [
+ committer
+ for committer, _ in sorted(
+ commit_counts.items(), key=lambda x: (-x[1], x[0])
+ )
+]
# Tal to the top
first_author = 'Tal Yarkoni'
