def install_wheel(
    wheel: Path,
    environment: BaseEnvironment,
    direct_url: dict[str, Any] | None = None,
    install_links: bool = False,
    rename_pth: bool = False,
    requested: bool = False,
) -> str:
    """Only create .pth files referring to the cached package.
    If the cache doesn't exist, create one.
    """
    interpreter = str(environment.interpreter.executable)
    script_kind = environment.script_kind
    # the cache_method can be any of "symlink", "hardlink", "copy" and "pth"
    cache_method: str = environment.project.config["install.cache_method"]
    dist_name = wheel.name.split("-")[0]
    link_method: LinkMethod | None
    if not install_links or dist_name == "editables":
        link_method = "copy"
    else:
        link_method = _get_link_method(cache_method)

    additional_metadata: dict[str, bytes] = {"INSTALLER": b"pdm"}
    if direct_url is not None:
        additional_metadata["direct_url.json"] = json.dumps(direct_url, indent=2).encode()
    if requested:
        additional_metadata["REQUESTED"] = b""

    destination = InstallDestination(
        scheme_dict=environment.get_paths(dist_name),
        interpreter=interpreter,
        script_kind=script_kind,
        link_method=link_method,
        rename_pth=rename_pth,
    )
    if install_links:
        package = environment.project.package_cache.cache_wheel(wheel)
        source = PackageWheelSource(package)
        if link_method == "symlink":
            # Track usage when symlink is used
            additional_metadata["REFER_TO"] = package.path.as_posix().encode()
        dist_info_dir = install(source, destination=destination, additional_metadata=additional_metadata)
        if link_method == "symlink":
            package.add_referrer(dist_info_dir)
    else:
        with WheelFile.open(wheel) as source:
            dist_info_dir = install(source, destination=destination, additional_metadata=additional_metadata)
    return dist_info_dir
Only create .pth files referring to the cached package.
    If the cache doesn't exist, create one.
    
src/pdm/installers/installers.py