def parse(cls, src, dist=None):
try:<EOL><INDENT>attrs = extras = ()<EOL>name,value = src.split('<STR_LIT:=>',<NUM_LIT:1>)<EOL>if '<STR_LIT:[>' in value:<EOL><INDENT>value,extras = value.split('<STR_LIT:[>',<NUM_LIT:1>)<EOL>req = Requirement.parse("<STR_LIT>"+extras)<EOL>if req.specs: raise ValueError<EOL>extras = req.extras<EOL><DEDENT>if '<STR_LIT::>' in value:<EOL><INDENT>value,attrs = value.split('<STR_LIT::>',<NUM_LIT:1>)<EOL>if not MODULE(attrs.rstrip()):<EOL><INDENT>raise ValueError<EOL><DEDENT>attrs = attrs.rstrip().split('<STR_LIT:.>')<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>",<EOL>src<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return cls(name.strip(), value.strip(), attrs, extras, dist)<EOL><DEDENT>
Parse a single entry point from string `src`

        Entry point syntax follows the form::

            name = some.module:some.attr [extra1,extra2]

        The entry name and module name are required, but the ``:attrs`` and
        ``[extras]`` parts are optional