U .e: @s@ddlmZmZmZddlZddlZddlZddlZddlm Z m Z m Z m Z ddlm Z mZmZmZddlmZddlmZddlmZmZd d d d d gZGdd d eZGdd d eZGdd d eZGdddeZGdddeZGdddeZ GdddeZ!ededBedBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*BZ"d#d"ddddd+Z#e"$d,d-ed.ed/Bed0Bed1Bed2Bed3Bed4Bed5BZ%e%ed6Bed7BZ&e&$d8d-ed9ed:BZ'e'$d;d-ed<ed=BZ(e"e'BZ)ee)e&e)Z*e*$d>d-ed?+Z,ed@+Z-eZ.e*ee,e.e-BZ/e.e/e e(e.>e e.e Z0dAdBZ1dSdDdEZ2dFd-dGd-ej3ej4ej5ej6ej7ej8dHZ9dIdJZ:eZ;dKdLZdQd Z?GdRd d eZ@dS)T)absolute_importdivisionprint_functionN)ParseException ParseResults stringStart stringEnd) ZeroOrMoreGroupForward QuotedString)Literal) string_types) SpecifierInvalidSpecifier InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentc@seZdZdZdS)rzE An invalid marker was found, users should refer to PEP 508. N__name__ __module__ __qualname____doc__rrA/usr/lib/python3.8/site-packages/pip/_vendor/packaging/markers.pyrsc@seZdZdZdS)rzP An invalid operation was attempted on a value that doesn't support it. Nrrrrrr"sc@seZdZdZdS)rz\ A name was attempted to be used that does not exist inside of the environment. Nrrrrrr(sc@s,eZdZddZddZddZddZd S) NodecCs ||_dSN)value)selfr rrr__init__0sz Node.__init__cCs t|jSr)strr r!rrr__str__3sz Node.__str__cCsd|jjt|S)Nz <{0}({1!r})>)format __class__rr#r$rrr__repr__6sz Node.__repr__cCstdSr)NotImplementedErrorr$rrr serialize9szNode.serializeN)rrrr"r%r(r*rrrrr/src@seZdZddZdS)VariablecCst|Srr#r$rrrr*>szVariable.serializeNrrrr*rrrrr+=sr+c@seZdZddZdS)ValuecCs d|S)Nz"{0}")r&r$rrrr*CszValue.serializeNr-rrrrr.Bsr.c@seZdZddZdS)OpcCst|Srr,r$rrrr*Hsz Op.serializeNr-rrrrr/Gsr/implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_version sys_platformos_nameos.name sys.platformplatform.versionplatform.machineplatform.python_implementationpython_implementationZextra)r;r<r=r>r?r@cCstt|d|dSNr)r+ALIASESgetsltrrrhrHz=====>=<=!=z~=><not inincCs t|dSrA)r/rDrrrrHorI'"cCs t|dSrA)r.rDrrrrHrrIandorcCs t|dSrA)tuplerDrrrrHyrI()cCs t|trdd|DS|SdS)NcSsg|] }t|qSr)_coerce_parse_result).0irrr sz(_coerce_parse_result..) isinstancer)resultsrrrrYs rYTcCst|tttfstt|trHt|dkrHt|dttfrHt|dSt|trdd|D}|rnd|Sdd|dSn"t|trddd |DS|SdS) Nrrcss|]}t|ddVqdS)F)firstN)_format_markerrZmrrr sz!_format_marker.. rWrXcSsg|] }|qSr)r*rarrrr\sz"_format_marker..)r]listrVrAssertionErrorlenr`join)markerr_innerrrrr`s      r`cCs||kSrrlhsrhsrrrrHrIcCs||kSrrrkrrrrHrI)rQrPrOrLrJrMrKrNcCslztd||g}Wntk r.Yn X||St|}|dkrbtd||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.) rrhr*rcontains _operatorsrCrr&)rloprmspecZoperrrr_eval_ops  rscCs&||t}|tkr"td||S)Nz/{0!r} does not exist in evaluation environment.)rC _undefinedrr&) environmentnamer rrr_get_envs  rwc Csgg}|D]}t|tttfs"tt|trB|dt||q t|tr|\}}}t|trtt||j }|j }n|j }t||j }|dt |||q |dkst|dkr |gq t dd|DS)N)rTrUrUcss|]}t|VqdSr)all)rZitemrrrrcsz$_evaluate_markers..) r]rerVrrfappend_evaluate_markersr+rwr rsany) ZmarkersrugroupsrirlrqrmZ lhs_valueZ rhs_valuerrrr|s"        r|cCs2d|}|j}|dkr.||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r& releaselevelr#serial)infoversionZkindrrrformat_full_versions  rcCsrttdr ttjj}tjj}nd}d}||tjtt t tt t d tddtjd S)Nimplementation0rn.) r2r0r:r6r4r7r5r3r1r8r9)hasattrsysrrrrvosplatformmachinereleasesystemr8r@rhZpython_version_tuple)Ziverr2rrrrs"   c@s.eZdZddZddZddZd dd ZdS) rc Cs`ztt||_WnFtk rZ}z(d|||j|jd}t|W5d}~XYnXdS)Nz+Invalid marker: {0!r}, parse error at {1!r})rYMARKERZ parseString_markersrr&Zlocr)r!rieZerr_strrrrr" szMarker.__init__cCs t|jSr)r`rr$rrrr%szMarker.__str__cCsdt|S)Nz)r&r#r$rrrr(szMarker.__repr__NcCs$t}|dk r||t|j|S)a$Evaluate a marker. Return the boolean from evaluating the given marker against the environment. environment is an optional argument to override all or part of the determined environment. The environment is determined from the current Python process. N)rupdater|r)r!ruZcurrent_environmentrrrevaluates  zMarker.evaluate)N)rrrr"r%r(rrrrrr s )T)AZ __future__rrroperatorrrrZpip._vendor.pyparsingrrrrr r r r r LZ_compatrZ specifiersrr__all__ ValueErrorrrrobjectrr+r.r/ZVARIABLErBZsetParseActionZ VERSION_CMPZ MARKER_OPZ MARKER_VALUEZBOOLOPZ MARKER_VARZ MARKER_ITEMsuppressZLPARENZRPARENZ MARKER_EXPRZ MARKER_ATOMrrYr`ltleeqnegegtrprsrtrwr|rrrrrrrs        >