Skip to content

Commit

Permalink
Test strategy for extracting top-level shared libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Feb 16, 2025
1 parent 975101d commit b359a51
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/pypi-lock.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ def get_imports_for_package(p: str) -> list[str]:
# ignore special folders
if Path(f.parts[0]).suffix in [".libs", ".dist-info", ".data"]:
continue
if (
len(f.parts) == 1 and
f.suffix == ".so"
):
print(f"{p}: {f} -> {f.stem.split('.')[0]}")
# include top-level single-file packages
if (
len(f.parts) == 1 and
f.suffix in [".py", ".so"] and
f.suffix in [".py", ".pyc", ".so"] and
valid_package_name(f.stem)
):
imports.add(f.stem)
Expand Down Expand Up @@ -93,7 +99,7 @@ await micropip.install([
], verbose=True)
lock = json.loads(
micropip.freeze().replace("http://0.0.0.0:8000/dist/", "")
micropip.freeze().replace("http://0.0.0.0:8000/static/pyodide/", "")
)
for package in lock["packages"].values():
Expand Down

0 comments on commit b359a51

Please sign in to comment.