Use as_py_json in place of deprecated as_object_map for Pyodide>=0.29#201
Merged
lesteve merged 4 commits intojoblib:masterfrom Nov 8, 2025
Merged
Use as_py_json in place of deprecated as_object_map for Pyodide>=0.29#201lesteve merged 4 commits intojoblib:masterfrom
as_py_json in place of deprecated as_object_map for Pyodide>=0.29#201lesteve merged 4 commits intojoblib:masterfrom
Conversation
Contributor
Author
|
The failing tests are unrelated here. Here is a very simple code snippet that I used on the Pyodide console to verify that the library lookup is working (please install a few compiled packages, say, from pyodide_js._module import LDSO
import os
found_libs = []
all_keys = []
for filepath in LDSO.loadedLibsByName.as_py_json():
all_keys.append(filepath)
if os.path.exists(filepath):
found_libs.append(filepath)
print(f"Total library keys: {len(all_keys)}")
print(f"Libraries that exist on the file system: {len(found_libs)}")
if found_libs:
print("\n Here are the first ten real library files:")
for lib in found_libs[:10]:
print(f" {lib}")
else:
print("\nNo libraries found on filesystem")
print("Sample keys from LDSO.loadedLibsByName:")
for key in all_keys[:10]:
print(f" {key}")which gives me the following output: |
lesteve
reviewed
Nov 6, 2025
Member
lesteve
left a comment
There was a problem hiding this comment.
I double-checked in a Pyodide console that as_py_json was working fine.
Since as_py_json was added in Pyodide 0.29, I would add something based on getattr or try/except to make sure that it works with Pyodide < 0.29.
The CI errors don't seem related.
Contributor
Author
|
On it! |
as_py_json in place of deprecated as_object_map for Pyodide shared libraries lookupas_py_json in place of deprecated as_object_map for looking up shared libraries for Pyodide v0.29 and later
as_py_json in place of deprecated as_object_map for looking up shared libraries for Pyodide v0.29 and lateras_py_json in place of deprecated as_object_map for Pyodide>=0.29
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We deprecated this method with Pyodide v0.29, and it will be removed in Pyodide v0.31. See pyodide/pyodide#5010, which adds a replacement that should work out of the box as it supports the
IS_PY_JSON_DICTflag.I tested this on the Pyodide dev and stable consoles with a few packages installed; it works well. I'll open a separate issue to discuss whether we want to smoke test Pyodide in-tree here.
cc: @lesteve
xref: scikit-image/scikit-image#7931