Skip to content

Commit 0f6a5f0

Browse files
committed
handle scenario where package requested is now unpinned and version is no longer being managed by pyscript
1 parent 1b1c220 commit 0f6a5f0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

custom_components/pyscript/requirements.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ async def install_requirements(hass, config_entry, pyscript_folder):
235235
package,
236236
pkg_installed_version,
237237
)
238+
# If installed package is not the same version as the one we last installed,
239+
# that means that the package is externally managed now so we shouldn't touch it
240+
# and should remove it from our internal tracker
241+
if (
242+
package in pyscript_installed_packages
243+
and pyscript_installed_packages[package] != pkg_installed_version
244+
):
245+
pyscript_installed_packages.pop(package)
238246
continue
239247

240248
# If installed package is not the same version as the one we last installed,

0 commit comments

Comments
 (0)