3

U'íc8ã@sfddlZddlZddlZddlmZmZmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZmZddlmZmZmZGdd„deƒZeejejƒZed	ƒj ƒZ!ed
ƒj ƒZ"edƒj ƒZ#edƒj ƒZ$ed
ƒj ƒZ%edƒj ƒZ&edƒj ƒZ'edƒZ(eee(ƒeBZ)e
eee)ƒƒZ*e*dƒZ+e*Z,edƒdƒZ-e'e-Z.e,ee%e,ƒZ/e!ee/ƒe"dƒZ0eej1ej2ej3BƒZ4eej1ej2ej3BƒZ5e4e5AZ6e
e6ee%e6ƒd
dddƒZ7ee#e7e$e7BƒZ8e8j9dd„ƒee8ƒdƒZ:e:j9dd„ƒeeƒƒdƒZej9dd„ƒe&Z;e;eZ<e:ee<ƒZ=e.ee<ƒZ>e+ee0ƒe>e=BZ?ee?eZ@e@jAdƒGdd „d ƒZBdS)!éN)ÚListÚOptionalÚSet)
ÚCombineÚLiteralrÚParseExceptionÚRegexÚWordÚ
ZeroOrMoreÚoriginalTextForÚ	stringEndÚstringStarté)ÚMARKER_EXPRÚMarker)ÚLegacySpecifierÚ	SpecifierÚSpecifierSetc@seZdZdZdS)ÚInvalidRequirementzJ
    An invalid requirement was found, users should refer to PEP 508.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__©rrú;/tmp/pip-build-gk9425m9/packaging/packaging/requirements.pyrsrú[ú]ú(ú)ú,ú;ú@z-_.Únamez[^ ]+ÚurlÚextrasF)Ú
joinStringÚadjacentÚ	_raw_speccCs
|jpdS)NÚ)r')ÚsÚlÚtrrrÚ<lambda>@sr,Ú	specifiercCs|dS)Nrr)r)r*r+rrrr,CsÚmarkercCst||j|j…ƒS)N)rÚ_original_startÚ
_original_end)r)r*r+rrrr,Gszx[]c@s<eZdZdZeddœdd„Zedœdd„Zedœd	d
„ZdS)ÚRequirementzÁParse 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.
    N)Úrequirement_stringÚreturncCsytj|ƒ}WnHtk
rV}z,td||j|jd…›d|j›ƒ‚WYdd}~XnX|j|_|jrÒtj	j
|jƒ}|jdkrštj	j|ƒ|jkrÈtdƒ‚n.|jo¤|j
s¸|jrÈ|j
rÈtd|j›ƒ‚|j|_nd|_t|jrê|jjƒngƒ|_t|jƒ|_|jr|jnd|_dS)NzParse error at "éz": ÚfilezInvalid URL givenz
Invalid URL: )ÚREQUIREMENTÚparseStringrrÚlocÚmsgr"r#ÚurllibÚparseÚurlparseÚschemeÚ
urlunparseÚnetlocÚsetr$ÚasListrr-r.)Úselfr2ÚreqÚeÚ
parsed_urlrrrÚ__init__ds&6


zRequirement.__init__)r3cCs|jg}|jr0djt|jƒƒ}|jd|›dƒ|jrF|jt|jƒƒ|jrn|jd|j›ƒ|jrn|jdƒ|jr†|jd|j›ƒdj|ƒS)Nrrrz@ ú z; r()	r"r$ÚjoinÚsortedÚappendr-Ústrr#r.)rBÚpartsZformatted_extrasrrrÚ__str__}s
zRequirement.__str__cCsd|›dS)Nz<Requirement('z')>r)rBrrrÚ__repr__‘szRequirement.__repr__)rrrrrKrFrMrNrrrrr1Wsr1)CÚreÚstringÚurllib.parser:ÚtypingrrZ	TOptionalrÚ	pyparsingrrÚLrrr	r
rrr
ÚmarkersrrÚ
specifiersrrrÚ
ValueErrorrÚ
ascii_lettersÚdigitsÚALPHANUMÚsuppressÚLBRACKETÚRBRACKETÚLPARENÚRPARENÚCOMMAÚ	SEMICOLONÚATÚPUNCTUATIONÚIDENTIFIER_ENDÚ
IDENTIFIERÚNAMEÚEXTRAÚURIÚURLÚEXTRAS_LISTÚEXTRASÚ
_regex_strÚVERBOSEÚ
IGNORECASEÚVERSION_PEP440ÚVERSION_LEGACYÚVERSION_ONEÚVERSION_MANYÚ
_VERSION_SPECÚsetParseActionÚVERSION_SPECÚMARKER_SEPARATORÚMARKERÚVERSION_AND_MARKERÚURL_AND_MARKERÚNAMED_REQUIREMENTr6r7r1rrrrÚ<module>sZ0