From 8276846fb2699c928a400b3f52850fa1f2eac444 Mon Sep 17 00:00:00 2001 From: "Kiyohito Kunii (Kiyo)" <8097799+921kiyo@users.noreply.github.com> Date: Tue, 25 Feb 2020 12:01:23 +0000 Subject: [PATCH] [KED-1409] Move ipython_loader from kedro.extras to tools (#448) --- RELEASE.md | 2 +- docs/source/04_user_guide/11_ipython.md | 6 +++--- {kedro/extras => tests/tools}/ipython/__init__.py | 0 tests/{extras => tools}/ipython/test_ipython_loader.py | 5 ++--- {tests/extras/ipython => tools}/__init__.py | 0 {kedro/extras => tools}/ipython/README.md | 0 tools/ipython/__init__.py | 0 {kedro/extras => tools}/ipython/ipython_loader.py | 0 8 files changed, 6 insertions(+), 7 deletions(-) rename {kedro/extras => tests/tools}/ipython/__init__.py (100%) rename tests/{extras => tools}/ipython/test_ipython_loader.py (98%) rename {tests/extras/ipython => tools}/__init__.py (100%) rename {kedro/extras => tools}/ipython/README.md (100%) create mode 100644 tools/ipython/__init__.py rename {kedro/extras => tools}/ipython/ipython_loader.py (100%) diff --git a/RELEASE.md b/RELEASE.md index b374f1a91e..c1194ebc7f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -26,7 +26,7 @@ * `kedro/contrib/decorators/memory_profiler.py` copied to `kedro/extras/decorators/memory_profiler.py`. * `kedro/contrib/io/transformers/transformers.py` copied to `kedro/extras/transformers/time_profiler.py`. * `kedro/contrib/colors/logging/color_logger.py` copied to `kedro/extras/logging/color_logger.py`. -* `extras/ipython_loader.py` copied to `kedro/extras/ipython/ipython_loader.py`. +* `extras/ipython_loader.py` copied to `tools/ipython/ipython_loader.py`. * `kedro/contrib/io/cached/cached_dataset.py` copied to `kedro/io/cached_dataset.py`. * `kedro/contrib/io/catalog_with_default/data_catalog_with_default.py` copied to `kedro/io/data_catalog_with_default.py`. * `kedro/contrib/config/templated_config.py` copied to `kedro/config/templated_config.py`. diff --git a/docs/source/04_user_guide/11_ipython.md b/docs/source/04_user_guide/11_ipython.md index 451884ec79..cd00aa5260 100644 --- a/docs/source/04_user_guide/11_ipython.md +++ b/docs/source/04_user_guide/11_ipython.md @@ -269,9 +269,9 @@ There are optional extra scripts that can help improve your Kedro experience for ### IPython loader -The script `kedro/extras/ipython/ipython_loader.py` helps to locate IPython startup directory and run all Python scripts in it when working with Jupyter notebooks and IPython sessions. It should work identically not just within a Kedro project, but also with any project that contains IPython startup scripts. +The script `tools/ipython/ipython_loader.py` helps to locate IPython startup directory and run all Python scripts in it when working with Jupyter notebooks and IPython sessions. It should work identically not just within a Kedro project, but also with any project that contains IPython startup scripts. -This script will automatically locate `.ipython/profile_default/startup` directory starting from the current working directory and going up the directory tree. If the directory was found, all Python scripts in it are be executed. +This script will automatically locate `.ipython/profile_default/startup` directory starting from the current working directory and going up the directory tree. If the directory was found, all Python scripts in it are executed. > *Note:* This script will only run startup scripts from the first encountered `.ipython/profile_default/startup` directory. All consecutive `.ipython` directories higher up in the directory tree will be disregarded. @@ -281,7 +281,7 @@ To install this script simply download it into your default IPython config direc ```bash mkdir -p ~/.ipython/profile_default/startup -wget -O ~/.ipython/profile_default/startup/ipython_loader.py https://raw.githubusercontent.com/quantumblacklabs/kedro/master/kedro/extras/ipython/ipython_loader.py +wget -O ~/.ipython/profile_default/startup/ipython_loader.py https://raw.githubusercontent.com/quantumblacklabs/kedro/master/tools/ipython/ipython_loader.py ``` #### Prerequisites diff --git a/kedro/extras/ipython/__init__.py b/tests/tools/ipython/__init__.py similarity index 100% rename from kedro/extras/ipython/__init__.py rename to tests/tools/ipython/__init__.py diff --git a/tests/extras/ipython/test_ipython_loader.py b/tests/tools/ipython/test_ipython_loader.py similarity index 98% rename from tests/extras/ipython/test_ipython_loader.py rename to tests/tools/ipython/test_ipython_loader.py index c2de4db3c9..c037a05ac9 100644 --- a/tests/extras/ipython/test_ipython_loader.py +++ b/tests/tools/ipython/test_ipython_loader.py @@ -30,9 +30,8 @@ from pathlib import Path import pytest - -from kedro.extras.ipython import ipython_loader -from kedro.extras.ipython.ipython_loader import locate_ipython_startup_dir +from tools.ipython import ipython_loader +from tools.ipython.ipython_loader import locate_ipython_startup_dir @pytest.fixture diff --git a/tests/extras/ipython/__init__.py b/tools/__init__.py similarity index 100% rename from tests/extras/ipython/__init__.py rename to tools/__init__.py diff --git a/kedro/extras/ipython/README.md b/tools/ipython/README.md similarity index 100% rename from kedro/extras/ipython/README.md rename to tools/ipython/README.md diff --git a/tools/ipython/__init__.py b/tools/ipython/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/kedro/extras/ipython/ipython_loader.py b/tools/ipython/ipython_loader.py similarity index 100% rename from kedro/extras/ipython/ipython_loader.py rename to tools/ipython/ipython_loader.py