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

Method id

pex/resolver.py:131–155  ·  view source on GitHub ↗
(self, complete=False)

Source from the content-addressed store, hash-verified

129 return target_description
130
131 def id(self, complete=False):
132 # type: (bool) -> str
133
134 if self.universal_target:
135 id_components = ["universal"]
136 if self.universal_target.implementation:
137 id_components.append(str(self.universal_target.implementation))
138 id_components.append(
139 "-and-".join(map(str, self.universal_target.systems or TargetSystem.values()))
140 )
141 if complete:
142 id_components.append(
143 hashlib.sha1(str(self.universal_target.marker()).encode("utf-8")).hexdigest()
144 )
145 return "-".join(id_components)
146
147 if isinstance(self.target, LocalInterpreter):
148 # e.g.: CPython 2.7.18
149 return self.target.interpreter.version_string
150 if isinstance(self.target, AbbreviatedPlatform):
151 return str(self.target.platform)
152 if isinstance(self.target, CompletePlatform):
153 return str(self.target.platform.tag)
154
155 return self.target.id
156
157
158def _uniqued_download_requests(requests=None):

Callers 4

createMethod · 0.80
finalize_logMethod · 0.80
_spawn_reportMethod · 0.80
_spawn_downloadMethod · 0.80

Calls 6

appendMethod · 0.80
joinMethod · 0.45
valuesMethod · 0.45
hexdigestMethod · 0.45
encodeMethod · 0.45
markerMethod · 0.45

Tested by

no test coverage detected