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

Method parse

pex/dist_metadata.py:1307–1322  ·  view source on GitHub ↗
(cls, spec)

Source from the content-addressed store, hash-verified

1305class NamedEntryPoint(object):
1306 @classmethod
1307 def parse(cls, spec):
1308 # type: (str) -> NamedEntryPoint
1309
1310 # This file format is defined here:
1311 # https://packaging.python.org/en/latest/specifications/entry-points/#file-format
1312
1313 components = spec.split("=")
1314 if len(components) != 2:
1315 raise ValueError("Invalid entry point specification: {spec!r}.".format(spec=spec))
1316
1317 name, value = components
1318 try:
1319 entry_point = parse_entry_point(value)
1320 except ValueError:
1321 raise ValueError("Invalid entry point specification: {spec!r}.".format(spec=spec))
1322 return cls(name=name.strip(), entry_point=entry_point)
1323
1324 name = attr.ib() # type: str
1325 entry_point = attr.ib() # type: Union[ModuleEntryPoint, CallableEntryPoint]

Callers

nothing calls this directly

Calls 2

parse_entry_pointFunction · 0.85
stripMethod · 0.80

Tested by

no test coverage detected