MCPcopy
hub / github.com/psf/black / jupyter_dependencies_are_installed

Function jupyter_dependencies_are_installed

src/black/handle_ipynb_magics.py:51–61  ·  view source on GitHub ↗
(*, warn: bool)

Source from the content-addressed store, hash-verified

49
50@lru_cache
51def jupyter_dependencies_are_installed(*, warn: bool) -> bool:
52 installed = (
53 find_spec("tokenize_rt") is not None and find_spec("IPython") is not None
54 )
55 if not installed and warn:
56 msg = (
57 "Skipping .ipynb files as Jupyter dependencies are not installed.\n"
58 'You can fix this by running ``pip install "black[jupyter]"``'
59 )
60 out(msg)
61 return installed
62
63
64def validate_cell(src: str, mode: Mode) -> None:

Callers 2

gen_python_filesFunction · 0.90
get_sourcesFunction · 0.90

Calls 1

outFunction · 0.90

Tested by

no test coverage detected