diff --git a/package-lock.json b/package-lock.json index 43921139..8d107cae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "shinylive", - "version": "0.10.5", + "version": "0.10.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shinylive", - "version": "0.10.5", + "version": "0.10.6", "license": "MIT", "devDependencies": { "@codemirror/autocomplete": "^6.4.2", diff --git a/package.json b/package.json index e24c2191..35dc8ee5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "shinylive", - "version": "0.10.5", + "version": "0.10.6", "description": "Run Shiny applications with R or Python running in the browser.", "main": "index.js", "repository": { diff --git a/packages/py-shiny b/packages/py-shiny index 57150917..608a1152 160000 --- a/packages/py-shiny +++ b/packages/py-shiny @@ -1 +1 @@ -Subproject commit 571509177f10c18158e082db8e04a627d5d53b31 +Subproject commit 608a1152ae8d4924830569ef118a991b9ee3ea8d diff --git a/scripts/pyodide_packages.py b/scripts/pyodide_packages.py index 15da22ed..28aa177c 100755 --- a/scripts/pyodide_packages.py +++ b/scripts/pyodide_packages.py @@ -100,6 +100,14 @@ "palmerpenguins": ["setuptools"], } +# Some packages may have a circular dependency. For example, shiny (v1.5.0) depends on +# shinychat, and shinychat depends on shiny. Python is okay with this (as long +# as the imports aren't circular at runtime), but pyodide has trouble with it. +# This hack breaks the circularity by removing shiny from shinychat's dependencies, +# which is okay since shinylive will always come with shiny already installed. +OMIT_DEPENDENCIES = { + "shinychat": ["shiny"], +} # ============================================= # Data structures used in our shinylive_requirements.json @@ -638,6 +646,11 @@ def update_pyodide_pyodide_lock_json(): for name in EXTRA_DEPENDENCIES: pyodide_packages["packages"][name]["depends"].extend(EXTRA_DEPENDENCIES[name]) + print("Removing circular dependencies") + for key, val in OMIT_DEPENDENCIES.items(): + depends = set(pyodide_packages["packages"][key]["depends"]) + pyodide_packages["packages"][key]["depends"] = list(depends.difference(val)) + print("Writing pyodide/pyodide-lock.json") with open(pyodide_lock_json_file, "w") as f: json.dump(pyodide_packages, f) diff --git a/shinylive_lock.json b/shinylive_lock.json index f2df96ca..4dd74a9b 100644 --- a/shinylive_lock.json +++ b/shinylive_lock.json @@ -15,8 +15,8 @@ }, "shiny": { "name": "shiny", - "version": "1.4.0", - "filename": "shiny-1.4.0-py3-none-any.whl", + "version": "1.5.0", + "filename": "shiny-1.5.0-py3-none-any.whl", "sha256": null, "url": null, "depends": [ @@ -26,11 +26,12 @@ {"name": "markdown-it-py", "specs": [[">=", "1.1.0"]]}, {"name": "mdit-py-plugins", "specs": [[">=", "0.3.0"]]}, {"name": "linkify-it-py", "specs": [[">=", "1.0"]]}, - {"name": "appdirs", "specs": [[">=", "1.4.4"]]}, + {"name": "platformdirs", "specs": [[">=", "2.1.0"]]}, {"name": "asgiref", "specs": [[">=", "3.5.2"]]}, {"name": "packaging", "specs": [[">=", "20.9"]]}, {"name": "narwhals", "specs": [[">=", "1.10.0"]]}, - {"name": "orjson", "specs": [[">=", "3.10.7"]]} + {"name": "orjson", "specs": [[">=", "3.10.7"]]}, + {"name": "shinychat", "specs": [[">=", "0.1.0"]]} ], "imports": [ "shiny" @@ -44,7 +45,7 @@ "url": null, "depends": [ {"name": "ipywidgets", "specs": [[">=", "7.6.5"]]}, - {"name": "jupyter-core", "specs": []}, + {"name": "jupyter_core", "specs": []}, {"name": "shiny", "specs": [[">=", "0.6.1.9005"]]}, {"name": "python-dateutil", "specs": [[">=", "2.8.2"]]}, {"name": "anywidget", "specs": []} @@ -562,5 +563,19 @@ "imports": [ "psygnal" ] + }, + "shinychat": { + "name": "shinychat", + "version": "0.2.8", + "filename": "shinychat-0.2.8-py3-none-any.whl", + "sha256": "6742a2354257280458269a8b5675f1254e5583be34b6eb1a626de44c0323286a", + "url": "https://files.pythonhosted.org/packages/16/01/8658eaffa920f4c621f05acc42ea98248147706079287b3a7ab4e47e1ece/shinychat-0.2.8-py3-none-any.whl", + "depends": [ + {"name": "htmltools", "specs": [[">=", "0.6.0"]]}, + {"name": "shiny", "specs": [[">=", "1.4.0"]]} + ], + "imports": [ + "shinychat" + ] } } \ No newline at end of file