|
34 | 34 | from adabot import travis_requests as travis |
35 | 35 | from adabot import pypi_requests as pypi |
36 | 36 | from adabot.lib import circuitpython_library_validators as cirpy_lib_vals |
37 | | -from adabot.lib.common_funcs import * |
| 37 | +from adabot.lib import common_funcs |
38 | 38 |
|
39 | 39 | # Setup ArgumentParser |
40 | 40 | cmd_line_parser = argparse.ArgumentParser( |
@@ -107,9 +107,9 @@ def run_library_checks(validators, bundle_submodules, latest_pylint, kw_args): |
107 | 107 | latest_pylint = pylint_info.json()["info"]["version"] |
108 | 108 | output_handler("Latest pylint is: {}".format(latest_pylint)) |
109 | 109 |
|
110 | | - repos = list_repos() |
| 110 | + repos = common_funcs.list_repos() |
111 | 111 | output_handler("Found {} repos to check.".format(len(repos))) |
112 | | - bundle_submodules = get_bundle_submodules() |
| 112 | + bundle_submodules = common_funcs.get_bundle_submodules() |
113 | 113 | output_handler("Found {} submodules in the bundle.".format(len(bundle_submodules))) |
114 | 114 | github_user = github.get("/user").json() |
115 | 115 | output_handler("Running GitHub checks as " + github_user["login"]) |
@@ -142,6 +142,8 @@ def run_library_checks(validators, bundle_submodules, latest_pylint, kw_args): |
142 | 142 | repo_needs_work = [] |
143 | 143 | since = datetime.datetime.now() - datetime.timedelta(days=7) |
144 | 144 | repos_by_error = {} |
| 145 | + new_libs = {} |
| 146 | + updated_libs = {} |
145 | 147 |
|
146 | 148 | validator = cirpy_lib_vals.library_validator(validators, |
147 | 149 | bundle_submodules, |
@@ -183,6 +185,14 @@ def run_library_checks(validators, bundle_submodules, latest_pylint, kw_args): |
183 | 185 | output_handler(", ".join(validator.output_file_data)) |
184 | 186 | validator.output_file_data.clear() |
185 | 187 |
|
| 188 | + # get a list of new & updated libraries for the last week |
| 189 | + if repo["name"] != "Adafruit_CircuitPython_Bundle": |
| 190 | + check_releases = common_funcs.is_new_or_updated(repo) |
| 191 | + if check_releases == "new": |
| 192 | + new_libs[repo["name"]] = repo["html_url"] |
| 193 | + elif check_releases == "updated": |
| 194 | + updated_libs[repo["name"]] = repo["html_url"] |
| 195 | + |
186 | 196 | output_handler() |
187 | 197 | output_handler("State of CircuitPython + Libraries") |
188 | 198 |
|
@@ -218,6 +228,15 @@ def run_library_checks(validators, bundle_submodules, latest_pylint, kw_args): |
218 | 228 | print_issue_overview(lib_insights) |
219 | 229 | output_handler("* {} open issues".format(len(lib_insights["open_issues"]))) |
220 | 230 | output_handler(" * https://circuitpython.org/libraries/contributing") |
| 231 | + output_handler("Library updates in the last seven days:") |
| 232 | + if len(new_libs) != 0: |
| 233 | + output_handler("**New Libraries**") |
| 234 | + for new in new_libs: |
| 235 | + output_handler(" * [{}]({})".format(new, new_libs[new])) |
| 236 | + if len(updated_libs) != 0: |
| 237 | + output_handler("**Updated Libraries**") |
| 238 | + for updated in updated_libs: |
| 239 | + output_handler(" * [{}]({})".format(updated, updated_libs[updated])) |
221 | 240 |
|
222 | 241 | if len(validators) != 0: |
223 | 242 | lib_repos = [] |
@@ -408,22 +427,22 @@ def print_issue_overview(*insights): |
408 | 427 | ] |
409 | 428 | cmd_line_args = cmd_line_parser.parse_args() |
410 | 429 |
|
411 | | - error_depth = cmd_line_args.error_depth |
412 | | - startup_message.append(" - Depth for listing libraries with errors: {}".format(error_depth)) |
413 | | - |
414 | 430 | verbosity = cmd_line_args.verbose |
415 | 431 |
|
416 | | - github_token = cmd_line_args.gh_token |
417 | | - validator_kwarg_list["github_token"] = github_token |
418 | | - startup_message.append(" - Prompts for the GitHub Token are {}.".format(("enabled" if github_token else "disabled"))) |
419 | | - |
420 | 432 | if cmd_line_args.output_file: |
421 | 433 | output_filename = cmd_line_args.output_file |
422 | 434 | startup_message.append(" - Report output will be saved to: {}".format(output_filename)) |
423 | 435 |
|
424 | 436 | validators = [] |
425 | 437 | validator_names = [] |
426 | 438 | if cmd_line_args.validator: |
| 439 | + error_depth = cmd_line_args.error_depth |
| 440 | + startup_message.append(" - Depth for listing libraries with errors: {}".format(error_depth)) |
| 441 | + |
| 442 | + github_token = cmd_line_args.gh_token |
| 443 | + validator_kwarg_list["github_token"] = github_token |
| 444 | + startup_message.append(" - Prompts for the GitHub Token are {}.".format(("enabled" if github_token else "disabled"))) |
| 445 | + |
427 | 446 | if cmd_line_args.validator != "all": |
428 | 447 | validators = [] |
429 | 448 | for func in cmd_line_args.validator.split(","): |
|
0 commit comments