Skip to content

Commit

Permalink
yarn v1: Drop unused read_package_from function
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
slimreaper35 committed Dec 3, 2024
1 parent 432a7e1 commit a427df7
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions cachi2/core/package_managers/yarn_classic/workspaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
from itertools import chain
from pathlib import Path
from typing import Any, Generator, Iterable
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit a427df7

Please sign in to comment.