File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55compatibility_layer : type [CompatibilityLayer ]
66
7- IN_BROWSER = "_pyodide_core" in sys .modules
7+ _IN_PYODIDE = "_pyodide_core" in sys .modules
88
9- if IN_BROWSER :
9+ if _IN_PYODIDE :
1010 from ._compat_in_pyodide import CompatibilityInPyodide
1111
1212 compatibility_layer = CompatibilityInPyodide
Original file line number Diff line number Diff line change 11from pathlib import Path
22from urllib .parse import urlparse
33
4- from pyodide .ffi import IN_BROWSER , to_js
4+ from pyodide .ffi import to_js
55from pyodide .http import pyfetch
66
77from .compatibility_layer import CompatibilityLayer
1616
1717 LOCKFILE_PACKAGES = pyodide_js ._api .lockfile_packages .to_py ()
1818 LOCKFILE_INFO = pyodide_js ._api .lockfile_info .to_py ()
19- except ImportError :
20- if IN_BROWSER :
21- raise
22- # Otherwise, this is pytest test collection so let it go.
19+ except ImportError as e :
20+ raise ImportError (
21+ "Failed to import pyodide modules, please report this issue to Pyodide team."
22+ ) from e
2323
2424
2525class CompatibilityInPyodide (CompatibilityLayer ):
Original file line number Diff line number Diff line change @@ -74,3 +74,6 @@ ignore_missing_imports = true
7474[[tool .mypy .overrides ]]
7575module = " micropip._vendored.*"
7676warn_unreachable = false
77+
78+ [tool .pytest .ini_options ]
79+ addopts = " --ignore=micropip/_vendored --ignore=micropip/_compat --doctest-modules"
You can’t perform that action at this time.
0 commit comments