MCPcopy
hub / github.com/pex-tool/pex / load

Method load

pex/wheel.py:116–138  ·  view source on GitHub ↗
(
        cls,
        location,  # type: Text
        known_tags=(),  # type: Tuple[Tag, ...]
        project_name=None,  # type: Optional[ProjectName]
    )

Source from the content-addressed store, hash-verified

114
115 @classmethod
116 def load(
117 cls,
118 location, # type: Text
119 known_tags=(), # type: Tuple[Tag, ...]
120 project_name=None, # type: Optional[ProjectName]
121 ):
122 # type: (...) -> WHEEL
123 wheel = cls._CACHE.get((location, project_name))
124 if not wheel:
125 metadata_files = load_metadata(
126 location, project_name=project_name, restrict_types_to=(MetadataType.DIST_INFO,)
127 )
128 if not metadata_files:
129 raise WheelMetadataLoadError(
130 "Could not find any metadata in {wheel}.".format(wheel=location)
131 )
132 if not known_tags and location.endswith(".whl"):
133 known_tags = parse_tags_from_filename(location)
134 wheel = cls.from_metadata_files(metadata_files, known_tags=known_tags)
135 cls._CACHE[(location, project_name)] = wheel
136 if project_name is None:
137 cls._CACHE[(location, wheel.files.metadata.project_name)] = wheel
138 return wheel
139
140 @classmethod
141 def from_distribution(

Callers 15

_maybe_rewrite_projectFunction · 0.45
build_pex_sciesFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
from_optionsMethod · 0.45
is_python_scriptFunction · 0.45
findMethod · 0.45
iter_distributionsMethod · 0.45
_activateMethod · 0.45
loadMethod · 0.45

Calls 5

load_metadataFunction · 0.90
parse_tags_from_filenameFunction · 0.85
getMethod · 0.45
from_metadata_filesMethod · 0.45

Tested by

no test coverage detected