(cls, spec)
| 1305 | class 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] |
nothing calls this directly
no test coverage detected