o knh @s~ddlmZddlmZmZddlmZddlm Z ddl m Z m Z ddl mZddlmZGd d d eZGd d d Zd S)) annotations)AnyIterator)parse_requirement)ParserSyntaxError)Marker_normalize_extra_values) SpecifierSet)canonicalize_namec@seZdZdZdS)InvalidRequirementzJ An invalid requirement was found, users should refer to PEP 508. N)__name__ __module__ __qualname____doc__rrA/usr/local/lib/python3.10/dist-packages/packaging/requirements.pyr sr c@sLeZdZdZdddZdd d Zdd d ZdddZdddZdddZ dS) 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_stringstrreturnNonec Cszt|}Wnty}ztt||d}~ww|j|_|jp"d|_t|jp)g|_t|j |_ d|_ |j durIt t |_ t |j |j _dSdSN)_parse_requirementrr rnameurlsetextrasr specifiermarkerr__new__r _markers)selfrparsederrr__init__"s     zRequirement.__init__r Iterator[str]ccsz|V|jrdt|j}d|dV|jrt|jV|jr/d|jV|jr/dV|jr;d|jVdSdS)N,[]z@  z; )rjoinsortedrrrr)r"rformatted_extrasrrr _iter_parts1s zRequirement._iter_partscCsd||jS)N)r+r.rr"rrr__str__CszRequirement.__str__cCs d|dS)Nzrr0rrr__repr__Fs zRequirement.__repr__intcCs t|jjg|t|jRSr)hash __class__r r.r rr0rrr__hash__Is zRequirement.__hash__otherrboolcCsRt|tstSt|jt|jko(|j|jko(|j|jko(|j|jko(|j|jkSr) isinstancerNotImplementedr rrrrr)r"r7rrr__eq__Qs     zRequirement.__eq__N)rrrr)rrrr&)rr)rr3)r7rrr8) r rrrr%r.r1r2r6r;rrrrrs    rN) __future__rtypingrr_parserrr _tokenizerrmarkersrr specifiersr utilsr ValueErrorr rrrrrs