From 10706e93760526ac38202315dfcff861a089e1ea Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 5 Sep 2021 18:40:58 -0500 Subject: [PATCH 1/3] add frozen libraries to the board info --- tools/build_board_info.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 62a33e1dd2..eed136c545 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -109,11 +109,20 @@ def get_board_mapping(): extensions = extension_by_port[port] extensions = extension_by_board.get(board_path.name, extensions) aliases = aliases_by_board.get(board_path.name, []) + frozen_libraries = [] + with open(os.path.join(board_path, "mpconfigboard.mk")) as mpconfig: + frozen_lines = [ + line for line in mpconfig if line.startswith("FROZEN_MPY_DIRS") + ] + frozen_libraries.extend( + [line[line.rfind("/") + 1 :].strip() for line in frozen_lines] + ) boards[board_id] = { "port": port, "extensions": extensions, "download_count": 0, "aliases": aliases, + "frozen_libraries": frozen_libraries, } for alias in aliases: boards[alias] = { @@ -300,6 +309,7 @@ def generate_download_info(): "modules": support_matrix[alias], "languages": languages, "extensions": board_info["extensions"], + "frozen_libraries": board_info["frozen_libraries"], } current_info[alias]["downloads"] = alias_info["download_count"] current_info[alias]["versions"].append(new_version) From 791937b149626a4459af5b980b17cfc68c7f40be Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 5 Sep 2021 18:42:05 -0500 Subject: [PATCH 2/3] black formatted 'build_board_info.py' --- tools/build_board_info.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index eed136c545..ba6a44600f 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -139,7 +139,9 @@ def get_version_info(): version = None sha = git("rev-parse", "--short", "HEAD").stdout.decode("utf-8") try: - version = git("describe", "--tags", "--exact-match").stdout.decode("utf-8").strip() + version = ( + git("describe", "--tags", "--exact-match").stdout.decode("utf-8").strip() + ) except sh.ErrorReturnCode_128: # No exact match pass @@ -206,7 +208,9 @@ def create_pr(changes, updated, git_info, user): ) create_branch = {"ref": "refs/heads/" + branch_name, "sha": commit_sha} - response = github.post("/repos/{}/circuitpython-org/git/refs".format(user), json=create_branch) + response = github.post( + "/repos/{}/circuitpython-org/git/refs".format(user), json=create_branch + ) if not response.ok and response.json()["message"] != "Reference already exists": print("unable to create branch") print(response.text) @@ -220,7 +224,8 @@ def create_pr(changes, updated, git_info, user): } response = github.put( - "/repos/{}/circuitpython-org/contents/_data/files.json".format(user), json=update_file + "/repos/{}/circuitpython-org/contents/_data/files.json".format(user), + json=update_file, ) if not response.ok: print("unable to post new file") @@ -269,7 +274,9 @@ def generate_download_info(): languages = get_languages() - support_matrix = shared_bindings_matrix.support_matrix_by_board(use_branded_name=False) + support_matrix = shared_bindings_matrix.support_matrix_by_board( + use_branded_name=False + ) new_stable = "-" not in new_tag From cb586a40180b2f8ca01619033bdee4c22116c556 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 5 Sep 2021 18:42:05 -0500 Subject: [PATCH 3/3] black formatted 'build_board_info.py' --- tools/build_board_info.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index eed136c545..1769e84e84 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -220,7 +220,8 @@ def create_pr(changes, updated, git_info, user): } response = github.put( - "/repos/{}/circuitpython-org/contents/_data/files.json".format(user), json=update_file + "/repos/{}/circuitpython-org/contents/_data/files.json".format(user), + json=update_file, ) if not response.ok: print("unable to post new file")