3 9f@srddlmZmZmZddlZddlZddlmZmZm Z m Z ddlm Z m Z m Z mZmZddlmZddlmZddlmZmZdd lmZmZmZGd d d eZe ejejZ ed j!Z"ed j!Z#edj!Z$edj!Z%edj!Z&edj!Z'edj!Z(e dZ)e e e)e BZ*ee e e*Z+e+dZ,e+Z-eddZ.e(e.Z/e-e e&e-Z0e"e e0e#dZ1eej2ej3ej4BZ5eej2ej3ej4BZ6e5e6AZ7ee7e e&e7ddddZ8e e$e8e%e8BZ9e9j:dde e9dZ;e;j:dde edZej:d de'Ze/e e=Z?e,e e1e?e>BZ@ee@eZAGd!d"d"eBZCdS)#)absolute_importdivisionprint_functionN) stringStart stringEndoriginalTextForParseException) ZeroOrMoreWordOptionalRegexCombine)Literal)parse) MARKER_EXPRMarker)LegacySpecifier Specifier SpecifierSetc@seZdZdZdS)InvalidRequirementzJ An invalid requirement was found, users should refer to PEP 508. N)__name__ __module__ __qualname____doc__rr"/usr/lib/python3.6/requirements.pyrsr[](),;@z-_.namez[^ ]+urlextrasF)Z joinStringZadjacent _raw_speccCs |jpdS)N)r')sltrrr6sr, specifiercCs|dS)Nrr)r)r*r+rrrr,9smarkercCst||j|jS)N)rZ_original_startZ _original_end)r)r*r+rrrr,=sc@s(eZdZdZddZddZddZdS) RequirementzParse a requirement. Parse a given requirement string into its parts, such as name, specifier, URL, and extras. Raises InvalidRequirement on a badly-formed requirement string. cCsytj|}Wn@tk rN}z$tdj||j|jdWYdd}~XnX|j|_|jrtj|j}|j ot|j s|j r|j rtd|j|_nd|_t |j r|j j ng|_ t|j|_|jr|jnd|_dS)Nz+Invalid requirement, parse error at "{0!r}"zInvalid URL given) REQUIREMENTZ parseStringrrformatlocr$r%urlparseschemeZnetlocsetr&ZasListrr-r.)selfZrequirement_stringZreqeZ parsed_urlrrr__init__Xs"*   zRequirement.__init__cCsz|jg}|jr*|jdjdjt|j|jr@|jt|j|jrX|jdj|j|j rp|jdj|j dj|S)Nz[{0}]r!z@ {0}z; {0}r() r$r&appendr2joinsortedr-strr%r.)r7partsrrr__str__mszRequirement.__str__cCsdjt|S)Nz)r2r=)r7rrr__repr__~szRequirement.__repr__N)rrrrr9r?r@rrrrr/Ksr/)DZ __future__rrrstringreZsetuptools.extern.pyparsingrrrrr r r r r rLZ"setuptools.extern.six.moves.urllibrr4ZmarkersrrZ specifiersrrr ValueErrorrZ ascii_lettersZdigitsZALPHANUMsuppressZLBRACKETZRBRACKETZLPARENZRPARENCOMMAZ SEMICOLONATZ PUNCTUATIONZIDENTIFIER_ENDZ IDENTIFIERNAMEZEXTRAZURIZURLZ EXTRAS_LISTZEXTRASZ _regex_strVERBOSE IGNORECASEZVERSION_PEP440ZVERSION_LEGACYZ VERSION_ONEZ VERSION_MANYZ _VERSION_SPECZsetParseActionZ VERSION_SPECZMARKER_SEPERATORZMARKERZVERSION_AND_MARKERZURL_AND_MARKERZNAMED_REQUIREMENTr1objectr/rrrrsZ