diff --git a/src/pip/_internal/metadata/importlib/_dists.py b/src/pip/_internal/metadata/importlib/_dists.py index 5e92b12755e..cf8685439a9 100644 --- a/src/pip/_internal/metadata/importlib/_dists.py +++ b/src/pip/_internal/metadata/importlib/_dists.py @@ -2,6 +2,7 @@ import importlib.metadata import pathlib import zipfile +from os import PathLike from typing import ( Collection, Dict, @@ -95,6 +96,11 @@ def read_text(self, filename: str) -> Optional[str]: raise UnsupportedWheel(error) return text + def locate_file(self, path: str | PathLike[str]) -> pathlib.Path: + # This method doesn't make sense for our in-memory wheel, but the API + # requires us to define it. + raise NotImplementedError + class Distribution(BaseDistribution): def __init__(