U ÀÒ.e#ã@sŠdZddlZddlZddlZddlZddlmZmZmZddl m Z m Z dgZ dd„Z Gd d „d eƒZd d „ZeƒZ[eƒZdd d„ZdS)zG Parser for the environment markers micro-language defined in PEP 508. éNé)Úpython_implementationÚurlparseÚ string_types)Úin_venvÚ parse_markerÚ interpretcCst|tƒr|sdS|ddkS)NFrú'")Ú isinstancer)Úo©r ú?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/markers.pyÚ _is_literalsrc @sfeZdZdZdd„dd„dd„dd„dd„dd„d d„d d„d d„d d„d d„dd„dœ Zdd„ZdS)Ú Evaluatorz; This class is used to evaluate marker expessions. cCs||kS©Nr ©ÚxÚyr r r Ú$ózEvaluator.cCs||kSrr rr r r r%rcCs||kp||kSrr rr r r r&rcCs||kSrr rr r r r'rcCs||kSrr rr r r r(rcCs||kp||kSrr rr r r r)rcCs||kSrr rr r r r*rcCs||kp||kSrr rr r r r+rcCs|o|Srr rr r r r,rcCs|p|Srr rr r r r-rcCs||kSrr rr r r r.rcCs||kSrr rr r r r/r) z==z===z~=z!=úz>=ÚandÚorÚinznot inc CsÔt|tƒrB|ddkr$|dd…}qÐ||kr8td|ƒ‚||}nŽt|tƒsPt‚|d}||jkrntd|ƒ‚|d}|d }t|dƒr¨t|d ƒr¨td |||fƒ‚| ||¡}| ||¡}|j|||ƒ}|S) zƒ Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rr réÿÿÿÿzunknown variable: %sÚopzop not implemented: %sÚlhsÚrhszinvalid comparison: %s %s %s) r rÚ SyntaxErrorÚdictÚAssertionErrorÚ operationsÚNotImplementedErrorrÚevaluate) ÚselfÚexprÚcontextÚresultrZelhsZerhsrrr r r r$2s$        zEvaluator.evaluateN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r"r$r r r r rsôrc Cs€dd„}ttdƒr(|tjjƒ}tjj}nd}d}||tjt ¡t ¡t  ¡t  ¡t ¡t t ƒƒt  ¡t  ¡dd…tjdœ }|S)NcSs<d|j|j|jf}|j}|dkr8||dt|jƒ7}|S)Nz%s.%s.%sÚfinalr)ÚmajorÚminorÚmicroÚ releaselevelÚstrÚserial)ÚinfoÚversionZkindr r r Úformat_full_versionNs z,default_context..format_full_versionÚimplementationÚ0Úé) Úimplementation_nameÚimplementation_versionZos_nameZplatform_machineZplatform_python_implementationZplatform_releaseZplatform_systemZplatform_versionZplatform_in_venvZpython_full_versionÚpython_versionZ sys_platform)ÚhasattrÚsysr7r5ÚnameÚosÚplatformÚmachinerÚreleaseÚsystemr2rr=)r6r<r;r(r r r Údefault_contextMs(   ôrFc Cs†zt|ƒ\}}Wn2tk rB}ztd||fƒ‚W5d}~XYnX|rd|ddkrdtd||fƒ‚ttƒ}|rz| |¡t ||¡S)zò Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z)Unable to interpret marker syntax: %s: %sNrú#z*unexpected trailing data in marker: %s: %s)rÚ Exceptionrr ÚDEFAULT_CONTEXTÚupdateÚ evaluatorr$)ZmarkerZexecution_contextr&ÚrestÚer'r r r rqs " )N)r,rAr?rBÚreÚcompatrrrÚutilrrÚ__all__rÚobjectrrFrIrKrr r r r Ús/