From 3af6144a77b3fea0a432d51a298b619fe805e014 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Pilla Date: Thu, 20 Jun 2024 19:03:45 -0500 Subject: [PATCH] Fix numpy 2.0 e2e test fail with lower requirements (#1949) * merge main from remote Signed-off-by: ravi-kumar-pilla * pin numpy for lower_requirements Signed-off-by: ravi-kumar-pilla * fix file permissions Signed-off-by: ravi-kumar-pilla * update release note Signed-off-by: ravi-kumar-pilla * testing 3.9 e2e test fail Signed-off-by: ravi-kumar-pilla * pin numpy in requirements Signed-off-by: ravi-kumar-pilla * pin numpy during e2e test Signed-off-by: ravi-kumar-pilla * address PR comments1 Signed-off-by: ravi-kumar-pilla * overkill Signed-off-by: ravi-kumar-pilla * add sphinx doc build fix Signed-off-by: ravi-kumar-pilla --------- Signed-off-by: ravi-kumar-pilla --- RELEASE.md | 5 +---- .../source/publish_and_share_kedro_viz_on_azure.md | 2 +- package/features/steps/cli_steps.py | 14 ++++++++++++++ package/features/steps/lower_requirements.txt | 3 +++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 43b48161ea..7ec4625c3e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -8,12 +8,9 @@ Please follow the established format: # Release 9.2.0 ## Major features and improvements + - Enable/disable preview for all the datasets when publishing Kedro-Viz from CLI. (#1894) - Enable/disable preview for all the datasets when publishing Kedro-Viz from UI. (#1895) - -## Bug fixes and other changes - -## Major features and improvements - Display published URLs. (#1907) ## Bug fixes and other changes diff --git a/docs/source/publish_and_share_kedro_viz_on_azure.md b/docs/source/publish_and_share_kedro_viz_on_azure.md index 3eb79348dd..b2254d5095 100644 --- a/docs/source/publish_and_share_kedro_viz_on_azure.md +++ b/docs/source/publish_and_share_kedro_viz_on_azure.md @@ -54,7 +54,7 @@ The process of uploading your site's files will be done through Kedro-Viz. 3. Obtain parameters: In the app registration's overview pane, note down the Application (Client) ID and Directory (Tenant) ID. -4. Add client secret: Create a [client secret](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-a-client-secret) +4. Add client secret: Create a [client secret](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=client-secret#add-credentials) for the app registration. 5. Assign IAM role: Assign an [Access Control (IAM) role](https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal?tabs=delegate-condition) to the storage account. diff --git a/package/features/steps/cli_steps.py b/package/features/steps/cli_steps.py index eab975a681..c452217521 100644 --- a/package/features/steps/cli_steps.py +++ b/package/features/steps/cli_steps.py @@ -29,6 +29,17 @@ def _create_config_file(context, include_example): yaml.dump(config, config_file, default_flow_style=False) +def _add_package_pin(requirements_path: str, package_name: str, version: str) -> None: + """Adds a package pin to the requirements file""" + with open(requirements_path, "r") as req_file: + requirements = req_file.readlines() + + requirements.append(f"{package_name}=={version}") + + with open(requirements_path, "w") as req_file: + req_file.writelines(requirements) + + @given("I have prepared a config file with example code") def create_config_file_with_example(context): """Behave step to create a temporary config file @@ -80,6 +91,9 @@ def install_project_requirements(context): """Run ``pip install -r requirements.txt``.""" if context.kedro_version != "latest": requirements_path = str(context.root_project_dir) + "/src/requirements.txt" + # numpy 2.0 breaks with old versions of pandas and this + # could be removed when the lowest version supported is updated + _add_package_pin(requirements_path, "numpy", "1.26.4") else: requirements_path = str(context.root_project_dir) + "/requirements.txt" diff --git a/package/features/steps/lower_requirements.txt b/package/features/steps/lower_requirements.txt index c8cf3c5225..1a149e7ad9 100644 --- a/package/features/steps/lower_requirements.txt +++ b/package/features/steps/lower_requirements.txt @@ -13,3 +13,6 @@ strawberry-graphql==0.192.0 networkx==2.5 orjson==3.9 secure==0.3.0 +# numpy 2.0 breaks with old versions of pandas and this +# could be removed when the lowest version supported is updated +numpy==1.26.4