Re}dZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z dgZ ejdZd Zd ZGd d eZd ZeZ[eZddZdS)zG Parser for the environment markers micro-language defined in PEP 508. N) string_types)in_venv parse_marker)NormalizedVersion interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")cHt|tr|sdS|ddvS)NFr'") isinstancer)os /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/markers.py _is_literalrs. a & &au Q45=cg}t|D]<}|t|d=t |S)Nr)_VERSION_PATTERNfinditerappendNVgroupsset)sresultms r _get_versionsr!sY F  & &q ) ))) bA''(((( v;;rc NeZdZdZdddddddd d d d d d ZdZdS) Evaluatorz; This class is used to evaluate marker expessions. c||kSNxys r zEvaluator.- 16rc||kSrrr s r r#zEvaluator..s AFrc||kp||kSrrr s r r#zEvaluator./s16?QUrc||kSrrr s r r#zEvaluator.0r$rc||kSrrr s r r#zEvaluator.1 1q5rc||kp||kSrrr s r r#zEvaluator.2AFOa!erc||kSrrr s r r#zEvaluator.3r)rc||kp||kSrrr s r r#zEvaluator.4r+rc |o|Srrr s r r#zEvaluator.5s AG!rc |p|Srrr s r r#zEvaluator.6s 16rc ||vSrrr s r r#zEvaluator.7s 16rc ||vSrrr s r r#zEvaluator.8s qzr) =====~=!=<<=>>=andorinnot inct|tr6|ddvr |dd}nF||vrtd|z||}n&t|tsJ|d}||jvrt d|z|d}|d }t |dr-t |d rtd |d |d ||||}|||}|d ks|d kr#|d vrt|}t|}n(|d kr"|dvrt|}t|}|j|||}|S)z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rr rzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison:  python_version)r6r7r8r9r3r2r5r4)r<r=) r r SyntaxErrordict operationsNotImplementedErrorrevaluaterr) selfexprcontextrr@elhserhsrArBs r rIzEvaluator.evaluate;s dL ) ) 3Aw%adw&&%&.format_full_version^sQ $ DJJJ C  7?? tAwT[!1!11 1Grimplementation0) implementation_nameimplementation_versionos_nameplatform_machineplatform_python_implementationplatform_releaseplatform_systemplatform_versionplatform_in_venvpython_full_versionrD sys_platform)hasattrsysrar^nameosplatformmachinepython_implementationreleasesystemr[rrD)r`rfrers r default_contextry]ss$%%!!4!4S5G5O!P!P!05!$  3"87$,..*2*H*J*J$,..#?,,$,.. NN'688"133BQB7   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 ExceptionrErFDEFAULT_CONTEXTupdate evaluatorrI)markerexecution_contextrKresterLs r rrsU!&)) dd UUUkQRQRSTTTU YQ3k&&&RVRVWXXX?##G*()))   dG , ,,s 949r)rRrsrerqrtcompatrutilrrr^rr__all__compilerrrobjectrryr}rrrrr rs  '''''''',,,,,, -2:]^^  44444444l>"/## IKK ------r