U cf @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__rrP/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.pyr sr c@sjeZdZdZdddddZdddd d Zdd d d Zdd ddZdd ddZdddddZ 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. strNone)requirement_stringreturnc Csz t|}Wn0tk r<}ztt||W5d}~XYnX|j|_|jpNd|_t|jp\g|_t|j |_ d|_ |j dk rt t |_ t |j |j _dSN)_parse_requirementrr rnameurlsetextrasr specifiermarkerr__new__r _markers)selfrparsederrr__init__"s      zRequirement.__init__z Iterator[str])rrccst|V|jr*dt|j}d|dV|jrrr/rrr__repr__FszRequirement.__repr__intcCst|jjf|t|jSr)hash __class__r r-r rr/rrr__hash__Is zRequirement.__hash__rbool)otherrcCsRt|tstSt|jt|jkoP|j|jkoP|j|jkoP|j|jkoP|j|jkSr) isinstancerNotImplementedr rrrrr)r"r7rrr__eq__Qs     zRequirement.__eq__N) r rrrr%r-r0r1r5r:rrrrrs rN) __future__rtypingrr_parserrrZ _tokenizerrmarkersrr specifiersr utilsr ValueErrorr rrrrrs