From 16b98abca94343770aad561ea659380c97d473b4 Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sat, 10 Dec 2022 19:49:33 +0000 Subject: [PATCH] make black[jupyter] installation cross-shell (#3394) --- README.md | 2 +- docs/getting_started.md | 2 +- src/black/handle_ipynb_magics.py | 2 +- tests/test_no_ipynb.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c2dd9e6..b12ddfb 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Try it out now using the [Black Playground](https://black.vercel.app). Watch the ### Installation _Black_ can be installed by running `pip install black`. It requires Python 3.7+ to run. -If you want to format Jupyter Notebooks, install with `pip install 'black[jupyter]'`. +If you want to format Jupyter Notebooks, install with `pip install "black[jupyter]"`. If you can't wait for the latest _hotness_ and want to install from GitHub, use: diff --git a/docs/getting_started.md b/docs/getting_started.md index 1825f3b..33fb2f9 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -17,7 +17,7 @@ Also, you can try out _Black_ online for minimal fuss on the ## Installation _Black_ can be installed by running `pip install black`. It requires Python 3.7+ to run. -If you want to format Jupyter Notebooks, install with `pip install 'black[jupyter]'`. +If you want to format Jupyter Notebooks, install with `pip install "black[jupyter]"`. If you can't wait for the latest _hotness_ and want to install from GitHub, use: diff --git a/src/black/handle_ipynb_magics.py b/src/black/handle_ipynb_magics.py index 693f1a6..9e1af75 100644 --- a/src/black/handle_ipynb_magics.py +++ b/src/black/handle_ipynb_magics.py @@ -64,7 +64,7 @@ def jupyter_dependencies_are_installed(*, verbose: bool, quiet: bool) -> bool: if verbose or not quiet: msg = ( "Skipping .ipynb files as Jupyter dependencies are not installed.\n" - "You can fix this by running ``pip install black[jupyter]``" + 'You can fix this by running ``pip install "black[jupyter]"``' ) out(msg) return False diff --git a/tests/test_no_ipynb.py b/tests/test_no_ipynb.py index 3e0b159..b63ecde 100644 --- a/tests/test_no_ipynb.py +++ b/tests/test_no_ipynb.py @@ -17,7 +17,7 @@ def test_ipynb_diff_with_no_change_single() -> None: result = runner.invoke(main, [str(path)]) expected_output = ( "Skipping .ipynb files as Jupyter dependencies are not installed.\n" - "You can fix this by running ``pip install black[jupyter]``\n" + 'You can fix this by running ``pip install "black[jupyter]"``\n' ) assert expected_output in result.output @@ -32,6 +32,6 @@ def test_ipynb_diff_with_no_change_dir(tmp_path: pathlib.Path) -> None: result = runner.invoke(main, [str(tmp_path)]) expected_output = ( "Skipping .ipynb files as Jupyter dependencies are not installed.\n" - "You can fix this by running ``pip install black[jupyter]``\n" + 'You can fix this by running ``pip install "black[jupyter]"``\n' ) assert expected_output in result.output -- 2.39.5