Skip to content

Commit ea28feb

Browse files
committed
Fix generation of dependencies[] array
1 parent 152702f commit ea28feb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

circuitpython_build_tools/scripts/build_bundles.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ def build_bundle_json(libs, bundle_version, output_filename, package_folder_pref
117117
"""
118118
Generate a JSON file of all the libraries in libs
119119
"""
120-
packages = []
120+
packages = {}
121+
# TODO simplify this 2-step process
122+
# It mostly exists so that get_bundle_requirements has a way to look up
123+
# "pypi name to bundle name" via `package_list[pypi_name]["module_name"]`
124+
# otherwise it's just shuffling info around
121125
for library_path in libs:
122126
package = {}
123127
package_info = build.get_package_info(library_path, package_folder_prefix)
@@ -130,10 +134,10 @@ def build_bundle_json(libs, bundle_version, output_filename, package_folder_pref
130134
package["version"] = package_info["version"]
131135
package["path"] = "lib/" + package_info["module_name"]
132136
package["library_path"] = library_path
133-
packages.append(package)
137+
packages[module_name] = package
134138

135139
library_submodules = {}
136-
for package in packages:
140+
for package in packages.values():
137141
library = {}
138142
library["package"] = package["is_folder"]
139143
library["pypi_name"] = package["pypi_name"]

0 commit comments

Comments
 (0)