Skip to content

Commit

Permalink
Try to fix package import discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Feb 15, 2025
1 parent 9cc9b62 commit c917be8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/makelock.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_imports_for_package(p: str) -> list[str]:
continue
# include top-level single-file packages
if len(f.parts) == 1 and f.suffix == ".py":
if len(f.parts) == 1 and f.suffix in [".py", ".so"]:
imports.add(f.stem)
continue
Expand Down Expand Up @@ -85,7 +85,11 @@ lock = json.loads(
for package in lock["packages"].values():
package["depends"] = sorted(package["depends"])
package["imports"] = sorted(get_imports_for_package(package["name"]))
if package["package_type"] == "shared_library":
package["imports"] = []
else:
package["imports"] = sorted(get_imports_for_package(package["name"]))
with open("/pyodide-lock.json", "w") as f:
json.dump(lock, f, sort_keys=True)
Expand Down

0 comments on commit c917be8

Please sign in to comment.