Skip to content

Commit

Permalink
Merge pull request #912 from bids-standard/rel/0.15.5
Browse files Browse the repository at this point in the history
REL: 0.15.5
  • Loading branch information
effigies authored Nov 7, 2022
2 parents 6f81c1e + d0ab64b commit de95cb5
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"name": "Appelhoff, Stefan",
"orcid": "0000-0001-8002-0877"
},
{
"name": "Papadopoulos Orfanos, Dimitri"
},
{
"affiliation": "Department of Psychology, Stanford University",
"name": "Goncalves, Mathias",
Expand All @@ -104,9 +107,6 @@
"name": "Hayot-Sasson, Valérie",
"orcid": "0000-0002-4830-4535"
},
{
"name": "Papadopoulos Orfanos, Dimitri"
},
{
"affiliation": "MRC Cognition and Brain Sciences Unit",
"name": "Carlin, Johan",
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Changelog
=========

Version 0.15.5 (November 07, 2022)
----------------------------------

Bug-fix release in 0.15.x series.

* FIX: Use kwargs for DataFrame.pivot() (#913)
* ENH: Add transformation history to ``BIDSStatsModelsNodeOutput`` (#905)
* ENH: Update examples, add to sphinx, and convert to .md (#908)
* ENH: More helpful __repr__ in modeling (#906)
* MNT: Update git submodules (#911)
* MNT: Bump peter-evans/create-pull-request from 3 to 4 (#904)
* CI: Automatically update GitHub Actions in the future (#903)

Version 0.15.4 (October 08, 2022)
---------------------------------

Expand Down
46 changes: 31 additions & 15 deletions tools/prep_zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
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')]
Expand All @@ -27,12 +34,16 @@ def decommify(name):
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:
Expand All @@ -46,19 +57,21 @@ def decommify(name):
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)
# latest tag
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]
for line in dep_shortlog.stdout.decode().split('\n')
if line)
['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
)

commit_counts = {}
for committer, commits in counts:
Expand All @@ -67,9 +80,12 @@ def decommify(name):
# 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'
Expand All @@ -81,7 +97,7 @@ def decommify(name):
creator_map.get(committer, {'name': committer})
for committer in committers
if committer not in blacklist
]
]

zenodo['creators'] = creators
zenodo_file.write_text(json.dumps(zenodo, indent=2, ensure_ascii=False) + '\n')

0 comments on commit de95cb5

Please sign in to comment.