Skip to content

fix: Jupyterlite not having narwhals as depends #7888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions scripts/jupyterlite/extra_packages.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[
"https://cdn.holoviz.org/panel/wheels/panel-1.5.5-py3-none-any.whl",
"pyodide-http"
"https://cdn.holoviz.org/panel/wheels/panel-1.5.5-py3-none-any.whl"
]
14 changes: 8 additions & 6 deletions scripts/jupyterlite/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions scripts/jupyterlite/patch_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def calculate_sha256(file_path):
return sha256_hash.hexdigest()


with open("package.json") as f:
with open("package-lock.json") as f:
package = json.load(f)
pyodide_version = package["dependencies"]["pyodide"].removeprefix("^")
pyodide_version = package["packages"]["node_modules/pyodide"]["version"]

path = "pyodide-lock.json"
url = f"https://cdn.jsdelivr.net/pyodide/v{pyodide_version}/full"
Expand All @@ -42,6 +42,11 @@ def calculate_sha256(file_path):
package["sha256"] = calculate_sha256(whl_file)
package["imports"] = [name]

# Can be removed when micropip 0.9.0 is part of pyodide
bokeh_req = data["packages"]["bokeh"]["depends"]
if "narwhals" not in bokeh_req:
bokeh_req.append("narwhals")


with open(path, "w") as f:
data = json.dump(data, f)
Loading