def METHOD_NAME(project_path: Union[str, Path]) -> ProjectMetadata:
    """Read project metadata from `<project_root>/pyproject.toml` config file,
    under the `[tool.kedro]` section.
    Args:
        project_path: Local path to project root directory to look up `pyproject.toml` in.
    Raises:
        RuntimeError: `pyproject.toml` was not found or the `[tool.kedro]` section
            is missing, or config file cannot be parsed.
        ValueError: If project version is different from Kedro package version.
            Note: Project version is the Kedro version the project was generated with.
    Returns:
        A named tuple that contains project metadata.
    """
    project_path = Path(project_path).expanduser().resolve()
    pyproject_toml = project_path / _PYPROJECT
    if not pyproject_toml.is_file():
        raise RuntimeError(
            f"Could not find the project configuration file '{_PYPROJECT}' in {project_path}. "
            f"If you have created your project with Kedro "
            f"version <0.17.0, make sure to update your project template. "
            f"See https://github.com/kedro-org/kedro/blob/main/RELEASE.md"
            f"#migration-guide-from-kedro-016-to-kedro-0170 "
            f"for how to migrate your Kedro project."
        )
    try:
        metadata_dict = anyconfig.load(pyproject_toml)
    except Exception as exc:
        raise RuntimeError(f"Failed to parse '{_PYPROJECT}' file.") from exc
    try:
        metadata_dict = metadata_dict["tool"]["kedro"]
    except KeyError as exc:
        raise RuntimeError(
            f"There's no '[tool.kedro]' section in the '{_PYPROJECT}'. "
            f"Please add '[tool.kedro]' section to the file with appropriate "
            f"configuration parameters."
        ) from exc
    mandatory_keys = ["package_name", "project_name"]
    missing_keys = [key for key in mandatory_keys if key not in metadata_dict]
    if missing_keys:
        raise RuntimeError(f"Missing required keys {missing_keys} from '{_PYPROJECT}'.")
    # Temporary solution to keep project_version backwards compatible to be removed in 0.19.0
    if "project_version" in metadata_dict:
        warnings.warn(
            "project_version in pyproject.toml is deprecated, use kedro_init_version instead",
            DeprecationWarning,
        )
        metadata_dict["kedro_init_version"] = metadata_dict["project_version"]
    elif "kedro_init_version" in metadata_dict:
        metadata_dict["project_version"] = metadata_dict["kedro_init_version"]
    else:
        raise RuntimeError(
            f"Missing required key kedro_init_version from '{_PYPROJECT}'."
        )
    mandatory_keys.append("kedro_init_version")
    # check the match for major and minor version (skip patch version)
    if (
        metadata_dict["kedro_init_version"].split(".")[:2]
        != kedro_version.split(".")[:2]
    ):
        raise ValueError(_version_mismatch_error(metadata_dict["kedro_init_version"]))
    source_dir = Path(metadata_dict.get("source_dir", "src")).expanduser()
    source_dir = (project_path / source_dir).resolve()
    metadata_dict["source_dir"] = source_dir
    metadata_dict["config_file"] = pyproject_toml
    metadata_dict["project_path"] = project_path
    metadata_dict.pop("micropkg", {})  # don't include micro-packaging specs
    try:
        return ProjectMetadata(**metadata_dict)
    except TypeError as exc:
        expected_keys = mandatory_keys + ["source_dir"]
        raise RuntimeError(
            f"Found unexpected keys in '{_PYPROJECT}'. Make sure "
            f"it only contains the following keys: {expected_keys}."
        ) from exc