-
Notifications
You must be signed in to change notification settings - Fork 167
/
rever.xsh
61 lines (52 loc) · 1.74 KB
/
rever.xsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from rever.activities.authors import Authors as ReverAuthors, update_metadata, eval_version, SORTINGS
class ConstructorAuthors(ReverAuthors):
def _update_authors(self, filename, template, format, metadata, sortby, include_orgs):
"""helper function for updating / writing authors file"""
md = update_metadata(metadata)
template = eval_version(template)
sorting_key, sorting_text = SORTINGS[sortby]
md = sorted(md, key=sorting_key)
if not include_orgs:
md = [x for x in md if not x.get("is_org", False)]
aformated = "".join([format.format(**x) for x in md])
s = template.format(sorting_text=sorting_text, authors=aformated)
s = s.rstrip() + "\n"
# fixing an issue that is related to Unicode surrogates
# (in one of the committer's names)
with open(filename, 'w') as f:
f.write(s.encode("utf-8", "surrogateescape").decode("utf-8", "replace"))
return md
$DAG['authors'] = ConstructorAuthors() # register the activity
$ACTIVITIES = [
"authors",
"changelog",
# "tag",
# "push_tag",
# "ghrelease",
# "conda_forge"
]
#
# Basic settings
#
$PROJECT = $GITHUB_REPO = "constructor"
$GITHUB_ORG = "conda"
$AUTHORS_FILENAME = "AUTHORS.md"
$AUTHORS_SORTBY = "alpha"
#
# Changelog settings
#
$CHANGELOG_FILENAME = "CHANGELOG.md"
$CHANGELOG_PATTERN = r"\[//\]: # \(current developments\)"
$CHANGELOG_HEADER = """[//]: # (current developments)
## $RELEASE_DATE $VERSION:
"""
$CHANGELOG_CATEGORIES = (
"Enhancements",
"Bug fixes",
"Deprecations",
"Docs",
"Other",
)
$CHANGELOG_CATEGORY_TITLE_FORMAT = '### {category}\n\n'
$CHANGELOG_AUTHORS_TITLE = "Contributors"
$CHANGELOG_AUTHORS_FORMAT = "* @{github}\n"