Commit 138b6ada authored by Romain Casati's avatar Romain Casati
Browse files

Support for binarytree package.

parent d5351078
......@@ -337,6 +337,25 @@ def patch_numpy():
import numpy
def patch_binarytree():
""" Fake pkg_resources distribution to avoid not satified
version requirement. """
# binarytree==6.3.0 calls
# pkg_resources.get_distribution("binarytree").version
# at line 32 of __init__.py
# it fails with setuptools required version 42 (we ship 40)
# so we temporarily mock it to get the import to work
import pkg_resources
_tmp = pkg_resources.get_distribution
distrib = type('dummy', (object,), {})()
distrib.version = "6.3.0"
# mock
pkg_resources.get_distribution = lambda _: distrib
import binarytree
# unmock
pkg_resources.get_distribution = _tmp
def patch(modules):
""" Patch a list of modules. """
if isinstance(modules, str):
......
......@@ -91,6 +91,10 @@ _internal_pkgs_dict = {
"path": f"{_internal_modules_path}/lolviz-0.0.1-py3-none-any.whl",
"deps": ["graphviz"],
},
"binarytree": {
"path": "binarytree==6.3.0", # loaded from PyPi
"deps": ["graphviz"],
},
}
# checking that 'path' is in dict allows to add dependencies to pyodide packages
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment