a oe @svddlZddlmZmZmZmZddlmZ ddl m Z ddl m Z mZddlmZGdd d eZGd d d ZdS) N)AnyListOptionalSet)parse_requirement)ParserSyntaxError)Marker_normalize_extra_values) SpecifierSetc@seZdZdZdS)InvalidRequirementzJ An invalid requirement was found, users should refer to PEP 508. N)__name__ __module__ __qualname____doc__rrJC:\Program Files\Certbot\pkgs\setuptools\_vendor\packaging\requirements.pyr sr c@sZeZdZdZeddddZedddZedd d Zedd d Z e e d ddZ 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. N)requirement_stringreturnc Cs z t|}Wn2ty>}ztt||WYd}~n d}~00|j|_|jrtj|j}|j dkrtj ||jkrtdn(|j r|j r|j s|j std|j|j|_nd|_t |j r|j ng|_ t|j|_d|_|jdurtt|_t|j|j_dS)NfilezInvalid URL givenz Invalid URL: )_parse_requirementrr strnameurlurllibparseurlparsescheme urlunparsenetlocsetextrasr specifiermarkerr __new__r Z_markers)selfrparsedeZ parsed_urlrrr__init__!s0 $       zRequirement.__init__)rcCs|jg}|jr0dt|j}|d|d|jrF|t|j|jrn|d|j|jrn|d|jr|d|jd|S)N,[]z@  z; ) rr"joinsortedappendr#rrr$)r&partsZformatted_extrasrrr__str__;s zRequirement.__str__cCs d|dS)Nzrr&rrr__repr__OszRequirement.__repr__cCst|jjt|fSN)hash __class__r rr4rrr__hash__RszRequirement.__hash__)otherrcCsJt|tstS|j|jkoH|j|jkoH|j|jkoH|j|jkoH|j|jkSr6) isinstancerNotImplementedrr"r#rr$)r&r:rrr__eq__Us      zRequirement.__eq__) r rrrrr)r3r5intr9rboolr=rrrrrs  r) urllib.parsertypingrrrrZ_parserrrZ _tokenizerrZmarkersr r Z specifiersr ValueErrorr rrrrrs