_d ddlZddlmZmZmZmZddlmZ ddl m Z ddl m Z mZddlmZGdd eZGd d Zy) N)AnyListOptionalSet)parse_requirement)ParserSyntaxError)Marker_normalize_extra_values) SpecifierSetceZdZdZy)InvalidRequirementzJ An invalid requirement was found, users should refer to PEP 508. N)__name__ __module__ __qualname____doc__K/usr/lib/python3/dist-packages/setuptools/_vendor/packaging/requirements.pyrrsrrcTeZdZdZdeddfdZdefdZdefdZdefdZ d e de fd Z y) 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. requirement_stringreturnNcr t|}|j|_|j rt jj|j }|jdk(r7t jj||j k7rStd|jr$|jr|js$|jstd|j |j |_nd|_t|jr |jng|_ t|j|_d|_|j Ct#j$t"|_t'|j |j _yy#t$r}tt||d}~wwxYw)NfilezInvalid URL givenz Invalid URL: )_parse_requirementr rstrnameurlurllibparseurlparsescheme urlunparsenetlocsetextrasr specifiermarkerr __new__r _markers)selfrparsede parsed_urls r__init__zRequirement.__init__!sE 4'(:;F  ::..vzz:J  F*<<**:6&**D,-@AA ''J,=,=%%j.?.?(= )EFF&,jjDHDH #V]]FMM K '3F4D4D'E(, == $ ..0DK#:6==#IDKK  %'! 4$SV,! 3 4s F F6F11F6c |jg}|jr9djt|j}|j d|d|j r$|j t |j |jr;|j d|j|jr|j d|jr|j d|jdj|S)N,[]z@  z; ) rr'joinsortedappendr(rrr))r,partsformatted_extrass r__str__zRequirement.__str__;s II; ;;"xxt{{(;<  LL1-.a0 1 >> LLT^^, - 88 LL2dhhZ ){{ S! ;; LL2dkk]+ ,wwu~rcd|dS)Nzrr,s r__repr__zRequirement.__repr__OsvS))rcVt|jjt|fSN)hash __class__rrr>s r__hash__zRequirement.__hash__Rs T^^,,c$i899rotherc8t|tstS|j|jk(xrj|j|jk(xrO|j |j k(xr4|j |j k(xr|j|jk(SrA) isinstancerNotImplementedrr'r(rr))r,rEs r__eq__zRequirement.__eq__Us%-! ! II # , u||+ ,%//1 ,EII% , u||+  r) rrrrrr0r<r?intrDrboolrIrrrrrsTJ3J4J4(*#*:#:  C  D  rr) urllib.parser typingrrrr_parserrr _tokenizerr markersr r specifiersr ValueErrorrrrrrrSs4 ++<)4$ K K r