MCPcopy Create free account
hub / github.com/numpy/numpy / main

Function main

tools/changelog.py:109–144  ·  view source on GitHub ↗
(token, revision_range)

Source from the content-addressed store, hash-verified

107
108
109def main(token, revision_range):
110 lst_release, cur_release = [r.strip() for r in revision_range.split('..')]
111
112 github = Github(token)
113 github_repo = github.get_repo('numpy/numpy')
114
115 # document authors
116 authors = get_authors(revision_range)
117 heading = "Contributors"
118 print()
119 print(heading)
120 print("="*len(heading))
121 print(author_msg % len(authors))
122
123 for s in authors:
124 print('* ' + s)
125
126 # document pull requests
127 pull_requests = get_pull_requests(github_repo, revision_range)
128 heading = "Pull requests merged"
129 pull_msg = "* `#{0} <{1}>`__: {2}"
130
131 print()
132 print(heading)
133 print("="*len(heading))
134 print(pull_request_msg % len(pull_requests))
135
136 for pull in pull_requests:
137 title = re.sub(r"\s+", " ", pull.title.strip())
138 if len(title) > 60:
139 remainder = re.sub(r"\s.*$", "...", title[60:])
140 if len(remainder) > 20:
141 remainder = title[:80] + "..."
142 else:
143 title = title[:60] + remainder
144 print(pull_msg.format(pull.number, pull.html_url, title))
145
146
147if __name__ == "__main__":

Callers 1

changelog.pyFile · 0.70

Calls 5

get_authorsFunction · 0.85
printFunction · 0.85
get_pull_requestsFunction · 0.85
stripMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected