I'll note that library probablyĭoes things the right way by installing as an nbextension. I've installed Jupyter Notebook by installing anaconda which includes python 3 by default. Sorry if thisĬauses any trouble or confusion. PyPI, so I think at this point I'll continue with this name. Like there have been no commits in the last 2 years, and it was never put in There is another library of the same name:
Ensure that pyproject.toml is searched for properly.Ensure other config options are properly passed to black.Ensure config is overridden in unsurprising ways.If desired, pass the -no-headless flag to pytest for local debugging.tox will automatically run these installation steps (helpful for CI).python -m playwright install -with-deps firefox.You'll need to run this command (once) prior to running the tests:.venv/bin/python -m pip install -upgrade pip
Activate venv, update pip, and install editable test/dev version:.Clone the repo: git clone & cd jupyter-black.Recommended (configurable) loading approach above. Users running a standalone notebook (instead of lab) need to use the Loading will only work in JupyterLab, not in a standard notebook. Seems to be the direction of the jupyter project this means this method of Lab=True, since moving to lab instead of standalone notebook installations This will load the extension using your defaults from pyproject.toml ifĪvailable, or use the black defaults. PY310, ) The other way: % load_ext jupyter_black load ( lab = False, line_length = 79, verbosity = "DEBUG", target_version = black. load ?įor example: import black import jupyter_black jupyter_black. To look at configuration options: jupyter_black. Python3 -m pip install jupyter-black jupyterįrom here, there are two ways to load the extension: Configurable (recommended): import jupyter_black jupyter_black. This extension helps you automatically blacken Slightly more responsive (no longer requires setTimeout and a delay)īlack is an extremely popular python formatter.Uses black.format_cell to greatly simplify the codebase.Override settings such as line length and black.TargetVersion if.Try to read black config from pyproject.toml if available.Once loaded, automatically format syntactically correct jupyter cells withĮnhancements compared to dnanhkhoa/nb_black:
A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code