-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
141 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ export VERSION | |
|
||
# Update lockfiles | ||
rm -rf node_modules | ||
npm install [email protected] | ||
npm install . | ||
node update_lock.js | ||
python patch_lock.py | ||
rm node_modules/pyodide/*.whl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
"https://cdn.holoviz.org/panel/1.4.2/dist/wheels/bokeh-3.4.1-py3-none-any.whl", | ||
"https://cdn.holoviz.org/panel/1.4.2/dist/wheels/panel-1.4.2-py3-none-any.whl", | ||
"holonote", | ||
"hvplot" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The contents of Panelite are updated on every release, however Jupyterlite caches old edits to files. If you want to reset the storage and **delete all modifications you made to the contents** then run the code below and click the button `Clear JupyterLite local storage` button." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from IPython.display import display, HTML\n", | ||
"display(HTML(\"\"\"\n", | ||
"<button type=\"button\" id=\"button_for_indexeddb\">Clear JupyterLite local storage</button>\n", | ||
"<div id=\"clear-storage-message\"></div>\n", | ||
"<script>\n", | ||
"window.button_for_indexeddb.onclick = function(e) {\n", | ||
" message = document.getElementById(\"clear-storage-message\")\n", | ||
" message.innerText=\"Running\"\n", | ||
" window.indexedDB.open('JupyterLite Storage').onsuccess = function(e) {\n", | ||
" // There are also other tables that I'm not clearing:\n", | ||
" // \"counters\", \"settings\", \"local-storage-detect-blob-support\"\n", | ||
" let tables = [\"checkpoints\", \"files\"];\n", | ||
"\n", | ||
" let db = e.target.result;\n", | ||
" let t = db.transaction(tables, \"readwrite\");\n", | ||
"\n", | ||
" function clearTable(tablename) {\n", | ||
" let st = t.objectStore(tablename);\n", | ||
" st.count().onsuccess = function(e) {\n", | ||
" console.log(\"Deleting \" + e.target.result + \" entries from \" + tablename + \"...\");\n", | ||
" st.clear().onsuccess = function(e) {\n", | ||
" console.log(tablename + \" is cleared!\");\n", | ||
" }\n", | ||
" }\n", | ||
" }\n", | ||
"\n", | ||
" for (let tablename of tables) {\n", | ||
" clearTable(tablename);\n", | ||
" }\n", | ||
" }\n", | ||
" message.innerText=\"JupyterLite local storage has successfully been reset\"\n", | ||
"};\n", | ||
"</script>\n", | ||
"\"\"\"))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"LiteBuildConfig": { | ||
"contents": ["../../examples"], | ||
"contents": ["../../examples", "files"], | ||
"output_dir": "../../jupyterlite" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"pyodide": "^0.25.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
const { loadPyodide } = require("pyodide") | ||
const fs = require("fs") | ||
const { loadPyodide } = require("pyodide"); | ||
const fs = require("fs"); | ||
|
||
async function main() { | ||
let pyodide = await loadPyodide() | ||
await pyodide.loadPackage(["micropip"]) | ||
const extra = fs.readFileSync("extra_packages.json", "utf8"); | ||
|
||
output = await pyodide.runPythonAsync(` | ||
import micropip | ||
await micropip.install([ | ||
"https://cdn.holoviz.org/panel/1.3.5/dist/wheels/bokeh-3.3.2-py3-none-any.whl", | ||
"https://cdn.holoviz.org/panel/1.3.5/dist/wheels/panel-1.3.5-py3-none-any.whl", | ||
"https://files.pythonhosted.org/packages/7f/0e/f3e09ad030185c5f2bb03265778699c8f80d7481b1e0abbb2a12c63fe093/holoviews-1.18.2a2-py2.py3-none-any.whl", | ||
"holonote", | ||
"hvplot", | ||
]) | ||
let pyodide = await loadPyodide(); | ||
await pyodide.loadPackage(["micropip"]); | ||
|
||
micropip.freeze() | ||
`) | ||
fs.writeFileSync("pyodide-lock.json", output) | ||
output = await pyodide.runPythonAsync(` | ||
import json | ||
import micropip | ||
extra = json.loads("""${extra}""") | ||
await micropip.install(extra) | ||
micropip.freeze() | ||
`); | ||
fs.writeFileSync("pyodide-lock.json", output); | ||
} | ||
main() | ||
|
||
main(); |