From a427df75ceae2050476e1a8bfa5d96be18faa289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0oltis?= Date: Thu, 28 Nov 2024 12:40:22 +0100 Subject: [PATCH] yarn v1: Drop unused read_package_from function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function is not used anymore since it was replaced in the previous patch by having PackageJson attribute inside the Workspace model that cares of loading json file. Signed-off-by: Michal Ĺ oltis --- cachi2/core/package_managers/yarn_classic/workspaces.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cachi2/core/package_managers/yarn_classic/workspaces.py b/cachi2/core/package_managers/yarn_classic/workspaces.py index 02f091c3c..67584c1e1 100644 --- a/cachi2/core/package_managers/yarn_classic/workspaces.py +++ b/cachi2/core/package_managers/yarn_classic/workspaces.py @@ -1,4 +1,3 @@ -import json from itertools import chain from pathlib import Path from typing import Any, Generator, Iterable @@ -85,11 +84,6 @@ def _extract_workspaces_globs(package: dict[str, Any]) -> list[str]: return workspaces_globs -def _read_package_from(path: RootedPath) -> dict[str, Any]: - """Read package.json from a path.""" - return json.loads(path.join_within_root("package.json").path.read_text()) - - def extract_workspace_metadata(package_path: RootedPath) -> list[Workspace]: """Extract workspace metadata from a package.""" package_json = PackageJson.from_file(package_path.join_within_root("package.json"))