diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a58705c42b..6175b898a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -174,6 +174,9 @@ Finally, you can use pseudo-random data, which is procedurally-generated on page > **Note**: Kedro-Viz>=3.8.0 will not work with projects created with Kedro<=0.16.6. Please consider migrating your project to Kedro>=0.17.0 before you develop against the latest version of Kedro-Viz. +> **Note**: Kedro-Viz>=7.0.0 will not work with projects created with Kedro<=0.17.0. Please consider migrating your project to Kedro>=0.18.0 before you develop against the latest version of Kedro-Viz. + + Before launching a development server with a real Kedro project, you'd need to have [Python](https://www.python.org/)(>=3.8) installed. We strongly recommend setting up [conda](https://docs.conda.io/en/latest/) to manage your Python versions and virtual environments. You can visit Kedro's [guide to installing conda](https://docs.kedro.org/en/latest/get_started/install.html#create-a-virtual-environment-for-your-kedro-project) for more information. The Kedro-Viz repository comes with an example project in the `demo-project` folder. This is used on the [public demo](https://demo.kedro.org/). To use it in your development environment, you need to install both the Kedro-Viz dependencies and a minimal set of dependencies for the demo project: diff --git a/package-lock.json b/package-lock.json index e4008ff167..199de11bfc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@quantumblack/kedro-viz", - "version": "6.6.1", + "version": "6.7.0", "dependencies": { "@apollo/client": "^3.5.6", "@emotion/react": "^11.10.6", @@ -67547,4 +67547,4 @@ } } } -} \ No newline at end of file +} diff --git a/package/features/steps/cli_steps.py b/package/features/steps/cli_steps.py index 4a59df418e..ef080c5f81 100644 --- a/package/features/steps/cli_steps.py +++ b/package/features/steps/cli_steps.py @@ -143,13 +143,7 @@ def check_kedroviz_up(context): try: assert context.result.poll() is None assert ( - # for Kedro 0.17.5 - "example_iris_data" - == sorted(data_json["nodes"], key=lambda i: i["name"])[0]["name"] - ) or ( - # for Kedro 0.18.0 onwards - "X_test" - == sorted(data_json["nodes"], key=lambda i: i["name"])[0]["name"] + "X_test" == sorted(data_json["nodes"], key=lambda i: i["name"])[0]["name"] ) finally: context.result.terminate() diff --git a/package/kedro_viz/integrations/kedro/data_loader.py b/package/kedro_viz/integrations/kedro/data_loader.py index 3945028742..d47864059d 100644 --- a/package/kedro_viz/integrations/kedro/data_loader.py +++ b/package/kedro_viz/integrations/kedro/data_loader.py @@ -3,7 +3,7 @@ load data from projects created in a range of Kedro versions. """ # pylint: disable=import-outside-toplevel, protected-access -# pylint: disable=missing-function-docstring, no-else-return +# pylint: disable=missing-function-docstring import base64 import json @@ -33,9 +33,6 @@ from kedro.io import DataCatalog from kedro.io.core import get_filepath_str from kedro.pipeline import Pipeline -from packaging.version import parse - -from kedro_viz.constants import KEDRO_VERSION logger = logging.getLogger(__name__) @@ -64,20 +61,9 @@ def _bootstrap(project_path: Path): """Bootstrap the integration by running various Kedro bootstrapping methods depending on the version """ - if KEDRO_VERSION >= parse("0.17.3"): - from kedro.framework.startup import bootstrap_project - - bootstrap_project(project_path) - return - - if KEDRO_VERSION >= parse("0.17.1"): - from kedro.framework.project import configure_project - from kedro.framework.startup import _get_project_metadata - - package_name = _get_project_metadata(project_path).package_name + from kedro.framework.startup import bootstrap_project - configure_project(package_name) - return + bootstrap_project(project_path) def _get_dataset_stats(project_path: Path) -> Dict: @@ -128,67 +114,29 @@ def load_data( """ _bootstrap(project_path) - if KEDRO_VERSION >= parse("0.17.3"): - from kedro.framework.project import pipelines - - with KedroSession.create( - project_path=project_path, - env=env, # type: ignore - save_on_close=False, - extra_params=extra_params, # type: ignore - ) as session: - # check for --ignore-plugins option - if ignore_plugins: - session._hook_manager = _VizNullPluginManager() - - context = session.load_context() - session_store = session._store - catalog = context.catalog - - # Pipelines is a lazy dict-like object, so we force it to populate here - # in case user doesn't have an active session down the line when it's first accessed. - # Useful for users who have `get_current_session` in their `register_pipelines()`. - pipelines_dict = dict(pipelines) - stats_dict = _get_dataset_stats(project_path) - - return catalog, pipelines_dict, session_store, stats_dict - elif KEDRO_VERSION >= parse("0.17.1"): - with KedroSession.create( - project_path=project_path, - env=env, # type: ignore - save_on_close=False, - extra_params=extra_params, # type: ignore - ) as session: - # check for --ignore-plugins option - if ignore_plugins: - session._hook_manager = _VizNullPluginManager() - - context = session.load_context() - session_store = session._store - stats_dict = _get_dataset_stats(project_path) - - return context.catalog, context.pipelines, session_store, stats_dict - else: - # Since Viz is only compatible with kedro>=0.17.0, this just matches 0.17.0 - from kedro.framework.startup import _get_project_metadata - - metadata = _get_project_metadata(project_path) - with KedroSession.create( - package_name=metadata.package_name, - project_path=project_path, - env=env, # type: ignore - save_on_close=False, - extra_params=extra_params, # type: ignore - ) as session: - # check for --ignore-plugins option - if ignore_plugins: - session._hook_manager = _VizNullPluginManager() - - context = session.load_context() - session_store = session._store - stats_dict = _get_dataset_stats(project_path) - - return context.catalog, context.pipelines, session_store, stats_dict + from kedro.framework.project import pipelines + + with KedroSession.create( + project_path=project_path, + env=env, # type: ignore + save_on_close=False, + extra_params=extra_params, # type: ignore + ) as session: + # check for --ignore-plugins option + if ignore_plugins: + session._hook_manager = _VizNullPluginManager() + + context = session.load_context() + session_store = session._store + catalog = context.catalog + + # Pipelines is a lazy dict-like object, so we force it to populate here + # in case user doesn't have an active session down the line when it's first accessed. + # Useful for users who have `get_current_session` in their `register_pipelines()`. + pipelines_dict = dict(pipelines) + stats_dict = _get_dataset_stats(project_path) + + return catalog, pipelines_dict, session_store, stats_dict # Try to access the attribute to trigger the import of dependencies, only modify the _load diff --git a/package/requirements.txt b/package/requirements.txt index 65a832693b..2b9932aaa5 100644 --- a/package/requirements.txt +++ b/package/requirements.txt @@ -1,5 +1,5 @@ packaging~=23.0 -kedro>=0.17.5 +kedro>=0.18.0 ipython>=7.0.0, <9.0 fastapi>=0.73.0,<0.200.0 pydantic<2 diff --git a/package/test_requirements.txt b/package/test_requirements.txt index 28b356886d..af13d03fc1 100644 --- a/package/test_requirements.txt +++ b/package/test_requirements.txt @@ -1,6 +1,6 @@ -r requirements.txt -kedro >=0.17.0 +kedro >=0.18.0 kedro-datasets[pandas.ParquetDataset, pandas.CSVDataset, pandas.ExcelDataset, plotly.JSONDataset]~=1.7 kedro-telemetry>=0.1.1 # for testing telemetry integration bandit~=1.7