3 9f/ @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"j$d,d-ed.ed/Bed0Bed1Bed2Bed3Bed4Bed5BZ%e%ed6Bed7BZ&e&j$d8d-ed9ed:BZ'e'j$d;d-ed<ed=BZ(e"e'BZ)ee)e&e)Z*e*j$d>d-ed?j+Z,ed@j+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__rr/usr/lib/python3.6/markers.pyrsc@seZdZdZdS)rzP An invalid operation was attempted on a value that doesn't support it. N)rrrrrrrrrsc@seZdZdZdS)rz\ A name was attempted to be used that does not exist inside of the environment. N)rrrrrrrrr%sc@s,eZdZddZddZddZddZd S) NodecCs ||_dS)N)value)selfrrrr__init__.sz Node.__init__cCs t|jS)N)strr)rrrr__str__1sz Node.__str__cCsdj|jjt|S)Nz <{0}({1!r})>)format __class__rr!)rrrr__repr__4sz Node.__repr__cCstdS)N)NotImplementedError)rrrr serialize7szNode.serializeN)rrrr r"r%r'rrrrr,src@seZdZddZdS)VariablecCst|S)N)r!)rrrrr'=szVariable.serializeN)rrrr'rrrrr(;sr(c@seZdZddZdS)ValuecCs dj|S)Nz"{0}")r#)rrrrr'CszValue.serializeN)rrrr'rrrrr)Asr)c@seZdZddZdS)OpcCst|S)N)r!)rrrrr'Isz Op.serializeN)rrrr'rrrrr*Gsr*implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_version sys_platformos_namezos.namez sys.platformzplatform.versionzplatform.machinezplatform.python_implementationpython_implementationZextra)zos.namez sys.platformzplatform.versionzplatform.machinezplatform.python_implementationr6cCsttj|d|dS)Nr)r(ALIASESget)sltrrrisr<z===z==z>=z<=z!=z~=>sz(_coerce_parse_result..) isinstancer)resultsrrrrGs rGTcCst|tttfstt|trHt|dkrHt|dttfrHt|dSt|trdd|D}|rndj|Sddj|dSn"t|trdjdd |DS|SdS) Nrrcss|]}t|ddVqdS)F)firstN)_format_marker)rHmrrr sz!_format_marker.. rErFcSsg|] }|jqSr)r')rHrOrrrrJsz"_format_marker..)rKlistrDrAssertionErrorlenrNjoin)markerrMinnerrrrrNs    rNcCs||kS)Nr)lhsrhsrrrr<scCs||kS)Nr)rXrYrrrr<s)r?znot inr>z<=z==z!=z>=r=c Cslytdj|j|g}Wntk r.Yn X|j|Stj|j}|dkrbtdj||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.) rrUr'rcontains _operatorsr8rr#)rXoprYspecZoperrrr_eval_ops r_cCs&|j|t}|tkr"tdj||S)Nz/{0!r} does not exist in evaluation environment.)r8 _undefinedrr#) environmentnamerrrr_get_envs   rcc Csgg}x|D]}t|tttfs$tt|trD|djt||q t|tr|\}}}t|trvt||j }|j }n|j }t||j }|djt |||q |dkst|dkr |jgq Wt dd|DS) NrrBrCcss|]}t|VqdS)N)all)rHitemrrrrPsz$_evaluate_markers..rf)rBrC) rKrRrDrrSappend_evaluate_markersr(rcrr_any) ZmarkersragroupsrVrXr]rYZ lhs_valueZ rhs_valuerrrrhs"        rhcCs2dj|}|j}|dkr.||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r# releaselevelr!serial)infoversionZkindrrrformat_full_versions  rpc Cslttdr ttjj}tjj}nd}d}||tjtjtj tj tjtj tj tj ddtjd S)Nimplementation0rZ) r-r+r5r1r/r2r0r.r,r3r4) hasattrsysrprqrorbosplatformmachinereleasesystemr3r6)Ziverr-rrrrs    c@s.eZdZddZddZddZd dd ZdS) rcCs`yttj||_WnFtk rZ}z*dj|||j|jd}t|WYdd}~XnXdS)Nz+Invalid marker: {0!r}, parse error at {1!r})rGMARKERZ parseString_markersrr#locr)rrVeZerr_strrrrr s zMarker.__init__cCs t|jS)N)rNr})rrrrr"szMarker.__str__cCsdjt|S)Nz)r#r!)rrrrr%szMarker.__repr__NcCs$t}|dk r|j|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)rupdaterhr})rraZcurrent_environmentrrrevaluate s  zMarker.evaluate)N)rrrr r"r%rrrrrrs)T)AZ __future__rrroperatorrvrwruZsetuptools.extern.pyparsingrrrrr r r r r LZ_compatrZ specifiersrr__all__ ValueErrorrrrobjectrr(r)r*ZVARIABLEr7ZsetParseActionZ VERSION_CMPZ MARKER_OPZ MARKER_VALUEZBOOLOPZ MARKER_VARZ MARKER_ITEMsuppressZLPARENZRPARENZ MARKER_EXPRZ MARKER_ATOMr|rGrNltleeqnegegtr\r_r`rcrhrprrrrrrsx    6