8fdZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z dgZ ejdZd d hZd Zd Zd ZGddeZejdZdZeZ[eZddZdS)zG Parser for the environment markers micro-language defined in PEP 508. N) string_types)in_venv parse_marker) LegacyVersion interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")python_versionpython_full_versionc>t|to|tvSN) isinstancer_VERSION_MARKERSss {/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/distlib/markers.py_is_version_markerrs a & & @10@+@@cHt|tr|sdS|ddvS)NFr'")r r)os r _is_literalr#s. a & &au Q45=rcJdt|DS)Nc\h|])}t|d*S)r)LVgroups).0ms r z _get_versions..*s, D D D!Bqxxzz!}   D D Dr)_VERSION_PATTERNfinditerrs r _get_versionsr!)s% D D'7'@'@'C'C D D DDrc NeZdZdZdddddddd d d d d d ZdZdS) Evaluatorz< This class is used to evaluate marker expressions. c||kSr xys rzEvaluator.3 16rc||kSr r%r&s rr)zEvaluator.4s AFrc||kp||kSr r%r&s rr)zEvaluator.516?QUrc||kSr r%r&s rr)zEvaluator.6r*rc||kSr r%r&s rr)zEvaluator.7 !a%rc||kp||kSr r%r&s rr)zEvaluator.8r-rc||kSr r%r&s rr)zEvaluator.9r0rc||kp||kSr r%r&s rr)zEvaluator.:r-rc |o|Sr r%r&s rr)zEvaluator.;s AG!rc |p|Sr r%r&s rr)zEvaluator.<s 16rc ||vSr r%r&s rr)zEvaluator.=s 16rc ||vSr r%r&s rr)zEvaluator.>s qzr) =====~=!=<<=>>=andorinnot inct|tr6|ddvr |dd}na||vrtd|z||}nAt|tsJ|d}||jvrt d|z|d}|d }t |dr-t |d rtd |d |d ||||}|||}t|st|r#|d vrt|}t|}n1t|r"|d vrt|}t|}|j|||}|S)z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rrrzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison:  )r<r=r>r?r9r8r;r:)rBrC) r r SyntaxErrordict operationsNotImplementedErrorrevaluaterrr!) selfexprcontextresultrFelhserhsrGrHs rrNzEvaluator.evaluateAs dL ) ) 3Aw%adw&&%&.format_full_versionjsQ $ DJJJ C  7?? tAwT[!1!11 1Grimplementation0r) implementation_nameimplementation_versionos_nameplatform_machineplatform_python_implementationplatform_releaseplatform_systemplatform_versionplatform_in_venvr r sys_platform)hasattrsysrgrdnameplatformr _DIGITSmatchgrouposmachinepython_implementationreleasesystemrar)rfrkrjppvrpvrRs rdefault_contextrhss$%%!!4!4   &"("(!05!$   ! # #C cA B2"87$,..*2*H*J*J$,..#?,,$,.. NN"   F MrcJ t|\}}n'#t$r}td|d|d}~wwxYw|r!|ddkrtd|d|tt}|r||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: z: Nr#z$unexpected trailing data in marker: )r ExceptionrJrKDEFAULT_CONTEXTupdate evaluatorrN)markerexecution_contextrPresterQs rrrs'!&)) dd '''k!6611&'' '' *Q3k!6644)** *?##G*()))   dG , ,,s 949r )rXr{rerurwcompatrutilrrrdrr__all__compilerrrrr!objectr#rxrrrrr%rrrsY  ''''''''(((((( -2:CEE$&;<AAA EEE55555555p "*[ ! !"""J"/## IKK ------r