JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrB :a@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZy ddlZWnek rdZYnXddlZddlZddlZddlZddlZy ddlZWnek rddlZYnXddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e 1e2Z3e 4dZ5e 4dZ6e 4d Z7e 4d Z8e 4d Z9e 4d Z:e 4d Z;e 4dZddZ?ddZ@ddZAdddZBddZCddZDdd ZEejFd!d"ZGejFd#d$ZHejFdd&d'ZIGd(d)d)eJZKd*d+ZLGd,d-d-eJZMd.d/ZNGd0d1d1eJZOe 4d2e jPZQd3d4ZRdd5d6ZSd7d8ZTd9d:ZUd;d<ZVd=d>ZWd?d@ZXe 4dAe jYZZe 4dBZ[ddCdDZ\e 4dEZ]dFdGZ^dHdIZ_dJdKZ`dLZadMdNZbdOdPZcGdQdRdReJZdGdSdTdTeJZeGdUdVdVeJZfdWZgddYdZZhd[d\Zid]ZjGd^d_d_eJZke 4d`Zle 4daZme 4dbZndcddZdedfZoerddglmpZqmrZrmsZsGdhdidie$jtZtGdjdkdkeqZpGdldmdmepe'ZuGdndodoe%jvZverGdpdqdqe%jwZwGdrdsdse%jxZxdtduZyGdvdwdweJZzGdxdydyezZ{Gdzd{d{ezZ|Gd|d}d}e(Z}Gd~ddeJZ~ddZGdddeJZddZddZddZddddZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cs6ddfddfddfdd|S) ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). cSs0t|}|r,|d}||d}n|s:tdn|d}|dkrVtd|d|d}|dd}|g}x|r|d|krPqv|d|kr|||dd}qvt|}|std|||d||d}qvWd|}td|||d|}|dd }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqZoqpartssr,=/opt/alt/python37/lib/python3.7/site-packages/distlib/util.py marker_varAs:               z parse_marker..marker_varcs|rR|ddkrR|dd\}}|ddkr@td||dd}n^|\}}xL|rt|}|stP|d}||d}|\}}|||d}q`W|}||fS)Nr(r)zunterminated parenthesis: %s)oplhsrhs)r%r MARKER_OPrrr)r&r(r2r'r1r3)markerr.r,r- marker_expres       z!parse_marker..marker_exprcsV|\}}x@|rLt|}|s"P||d}|\}}d||d}qW||fS)Nand)r1r2r3)ANDrr)r&r2r'r3)r6r,r- marker_andxs   z parse_marker..marker_andcsV|\}}x@|rLt|}|s"P||d}|\}}d||d}qW||fS)Nor)r1r2r3)ORrr)r&r2r'r3)r9r,r-r5s   zparse_marker..markerr,)Z marker_stringr,)r5r9r6r.r- parse_marker8s $ r<cCs2|}|r|drdSt|}|s4td||d}||d}d}}}}|r<|ddkr<|dd}|dkrtd||d|} ||dd}g}xx| r0t| }|std | | |d| |d} | sP| dd krtd | | dd} qW|s.get_versionsr/r0zunterminated parenthesis: %szinvalid constraint: %sz~=;zinvalid requirement: %szunexpected trailing data: %sz%s %sz, cSsg|] }d|qS)z%s %sr,).0Zconr,r,r- sz%parse_requirement..)nameextrasZ constraintsr5urlZ requirement)strip startswithrrr rrfindr%r" NON_SPACErschemenetlocrBrCr<r$r)reqr&r'ZdistnamerKZ mark_exprrDuriir+trF_rEZrsr,r,r-parse_requirements                           rXcCsdd}i}x|D]\}}}tj||}xt|D]t}tj||} x`t| D]T} ||| } |dkrt|| dqP||| } |tjjdd} | d| || <qPWq4WqW|S)z%Find destinations for resources filescSsD|tjjd}|tjjd}||s.t|t|ddS)N/)r!ospathseprNAssertionErrorlenr%)rootr[r,r,r- get_rel_pathsz)get_resources_dests..get_rel_pathNrY)rZr[r$rpopr!r\rstrip)Zresources_rootZrulesr`Z destinationsbasesuffixdestprefixZabs_baseZabs_globZabs_pathZ resource_fileZrel_pathZrel_destr,r,r-get_resources_destss  rgcCs(ttdrd}ntjttdtjk}|S)NZ real_prefixT base_prefix)hasattrsysrfgetattr)r(r,r,r-in_venv(s rlcCstj}t|tst|}|S)N)rj executable isinstancerr)r(r,r,r-get_executable2s  rocCsR|}xHt|}|}|s|r|}|r|d}||kr8P|rd|||f}qW|S)Nrz %c: %s %s)r lower)promptZ allowed_charsZ error_promptdefaultpr+cr,r,r-proceedDs rucCs<t|tr|}i}x |D]}||kr||||<qW|S)N)rnrsplit)dkeysr(keyr,r,r-extract_by_keyTs  rzcCstjddkrtd|}|}t|}yrt|}|ddd}xR|D]F\}}x<|D]0\}}d||f}t |} | dk st | ||<qdWqRW|St k r| ddYnXdd } t } y| | |Wn<t jk r|t|}t|}| | |YnXi}xb| D]V} i|| <}xB| | D]4\} }d| |f}t |} | dk spt | || <qFWq*W|S) Nrzutf-8 extensionszpython.exportsexportsz%s = %scSs$t|dr||n ||dS)N read_file)rir~readfp)cpstreamr,r,r- read_streamqs  z!read_exports..read_stream)rj version_infocodecs getreaderreadr jsonloaditemsget_export_entryr] Exceptionseekr ConfigParserMissingSectionHeaderErrorclosetextwrapdedentsections)rdataZjdatar(groupentrieskrEr+entryrrryrJvaluer,r,r- read_exports]sD      rcCstjddkrtd|}t}x||D]p\}}||x\|D]P}|j dkr`|j }nd|j |j f}|j rd|d |j f}| ||j|qJWq.W||dS)Nrr{zutf-8z%s:%sz%s [%s]z, )rjrr getwriterrrr add_sectionvaluesrdrfflagsr$setrJwrite)r}rrrrErr+r,r,r- write_exportss  rc cs$t}z |VWdt|XdS)N)tempfilemkdtemprrmtree)Ztdr,r,r-tempdirs rc cs.t}zt|dVWdt|XdS)N)rZgetcwdchdir)rwcwdr,r,r-rs   rc cs.t}zt|dVWdt|XdS)N)socketZgetdefaulttimeoutZsetdefaulttimeout)ZsecondsZctor,r,r-socket_timeouts   rc@seZdZddZdddZdS)cached_propertycCs ||_dS)N)func)selfrr,r,r-__init__szcached_property.__init__NcCs,|dkr |S||}t||jj||S)N)robject __setattr____name__)robjclsrr,r,r-__get__s  zcached_property.__get__)N)r __module__ __qualname__rrr,r,r,r-rsrcCstjdkr|S|s|S|ddkr.td||ddkrFtd||d}xtj|krj|tjqRW|svtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. rYrzpath '%s' cannot be absolutezpath '%s' cannot end with '/')rZr\ ValueErrorrvcurdirremover[r$)pathnamepathsr,r,r- convert_paths       rc@seZdZd$ddZddZddZdd Zd%d d Zd&ddZddZ ddZ ddZ ddZ ddZ d'ddZddZddZd d!Zd"d#Zd S)( FileOperatorFcCs||_t|_|dS)N)dry_runrensured _init_record)rrr,r,r-rszFileOperator.__init__cCsd|_t|_t|_dS)NF)recordr files_written dirs_created)rr,r,r-rszFileOperator._init_recordcCs|jr|j|dS)N)rradd)rr[r,r,r-record_as_writtenszFileOperator.record_as_writtencCsHtj|s tdtj|tj|s0dSt|jt|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)rZr[existsrabspathstatst_mtime)rsourcetargetr,r,r-newers  zFileOperator.newerTcCs|tj|td|||jsd}|rdtj|rDd|}n tj|rdtj |sdd|}|rtt |dt ||| |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirrZr[dirnameloggerinforislinkrisfilerrcopyfiler)rinfileoutfilecheckmsgr,r,r- copy_files    zFileOperator.copy_fileNcCstj|rt|tj|td|||jsv|dkrJt |d}nt j |d|d}zt ||Wd| X||dS)NzCopying stream %s to %swbw)encoding)rZr[isdirr]rrrrropenrr copyfileobjrr)rZinstreamrrZ outstreamr,r,r- copy_streams  zFileOperator.copy_streamc Cs\|tj||jsNtj|r.t|t|d}||WdQRX| |dS)Nr) rrZr[rrrrrrr)rr[rfr,r,r-write_binary_file's   zFileOperator.write_binary_filecCs||||dS)N)rencode)rr[rrr,r,r-write_text_file0szFileOperator.write_text_filecCsrtjdkstjdkrntjdkrnxN|D]F}|jr?zFileOperator.cCs|tj|}||jkrxtj|sx|j|tj|\}}||t d||j sft ||j rx|j |dS)Nz Creating %s)rZr[rrrrrvrrrrmkdirrr)rr[rwrr,r,r-rAs    zFileOperator.ensure_dirc Cst|| }td|||js|s0|||rX|s:d}n||sHt|t|d}i}|rvtt drvt j j |d<t j |||df|| ||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT)r rrrrrNr]r^ri py_compiler CHECKED_HASHcompiler) rr[optimizeforcerfZhashed_invalidationZdpathZdiagpathZcompile_kwargsr,r,r- byte_compileMs   zFileOperator.byte_compilecCstj|rtj|r^tj|s^td||js@t ||j r||j kr|j |nPtj|rpd}nd}td|||jst ||j r||j kr|j |dS)NzRemoving directory tree at %slinkfilezRemoving %s %s)rZr[rrrrdebugrrrrrrr)rr[r+r,r,r-ensure_removed^s"       zFileOperator.ensure_removedcCsHd}x>|sBtj|r&t|tj}Ptj|}||kr)rJrfrdr)rr,r,r-__repr__s zExportEntry.__repr__cCsDt|tsd}n0|j|jko>|j|jko>|j|jko>|j|jk}|S)NF)rnrrJrfrdr)rotherr(r,r,r-__eq__s     zExportEntry.__eq__N) rrrrrrrrr__hash__r,r,r,r-rs   rz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cst|}|s0d}d|ks"d|krtd|n|}|d}|d}|d}|dkrf|d}}n"|dkrztd||d\}}|d } | dkrd|ksd|krtd|g} nd d | d D} t|||| }|S) Nr>r?zInvalid specification '%s'rJcallable:rrrcSsg|] }|qSr,)rM)rHrr,r,r-rIsz$get_export_entry..r@)ENTRY_REsearchr groupdictcountrvr) Z specificationr'r(rwrJr[Zcolonsrfrdrr,r,r-rs2    rcCs|dkr d}tjdkr.dtjkr.tjd}n tjd}tj|rft|tj}|st d|n|dd\}}d|kr.|}n|dd\}}|rJt|}|rVt|}|||fS)NrArr)rsplitrvr)rRusernamepasswordrfr,r,r-parse_credentials*sr.cCstd}t||S)N)rZumask)r(r,r,r-get_process_umask9s  r1cCs>d}d}x$t|D]\}}t|tsd}PqW|dk s:t|S)NTF) enumeraternrr])seqr(rUr+r,r,r-is_string_sequence>s  r4z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|dd}t|}|r@|d}|d|}|rt|t|dkrtt |d|}|r| }|d|||dd|f}|dkrt |}|r|d|d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\br{) rr!PYTHON_VERSIONrrstartr^rerescaperPROJECT_NAME_AND_VERSION)filenameZ project_namer(Zpyverr'nr,r,r-split_filenameMs"   r>z-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCs:t|}|std||}|d|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'rJZver)NAME_VERSION_RErrrrMrp)rsr'rwr,r,r-parse_name_and_versionis  r@cCst}t|pg}t|pg}d|kr8|d||O}x|D]x}|dkrV||q>|dr|dd}||krtd|||kr||q>||krtd|||q>W|S)N*r6rzundeclared extra: %s)rrrrNrr#)Z requestedZ availabler(rZunwantedr,r,r- get_extrasxs&        rCc Csi}yNt|}|}|d}|ds8td|ntd|}t |}Wn0t k r}zt d||Wdd}~XYnX|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %szutf-8z&Failed to get external data for %s: %s) r rgetrNrrrrrrr exception)rLr(Zrespheadersctreaderer,r,r-_get_external_datas   rJz'https://www.red-dove.com/pypi/projects/cCs*d|d|f}tt|}t|}|S)Nz%s/%s/project.jsonr)upperr _external_data_base_urlrJ)rJrLr(r,r,r-get_project_datas rMcCs(d|d||f}tt|}t|S)Nz%s/%s/package-%s.jsonr)rKr rLrJ)rJversionrLr,r,r-get_package_datas rOc@s(eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsPtj|st|t|jd@dkr6td|tjtj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rZr[rr$rrrr#rnormpathrc)rrcr,r,r-rs    zCache.__init__cCst|S)zN Converts a resource prefix to a directory name in the cache. )r()rrfr,r,r- prefix_to_dirszCache.prefix_to_dirc Csg}xt|jD]r}tj|j|}y>tj|s@tj|rLt|ntj|rbt |Wqt k r| |YqXqW|S)z" Clear the cache. ) rZrrcr[r$rrrrrrrr")rZ not_removedfnr,r,r-clears  z Cache.clearN)rrr__doc__rrSrUr,r,r,r-rPsrPc@s:eZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dS)N) _subscribers)rr,r,r-rszEventMixin.__init__TcCsD|j}||krt|g||<n"||}|r6||n ||dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)rXrr" appendleft)revent subscriberr"subssqr,r,r-rs  zEventMixin.addcCs,|j}||krtd||||dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)rXrr)rrZr[r\r,r,r-rs zEventMixin.removecCst|j|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. r,)iterrXrD)rrZr,r,r-get_subscribersszEventMixin.get_subscribersc Ospg}xT||D]F}y||f||}Wn"tk rJtdd}YnX||qWtd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)r_rrrEr"r)rrZargskwargsr(r[rr,r,r-publish s    zEventMixin.publishN)T) rrrrVrrrr_rbr,r,r,r-rWs   rWc@s^eZdZddZddZdddZdd Zd d Zd d ZddZ e ddZ e ddZ dS) SequencercCsi|_i|_t|_dS)N)_preds_succsr_nodes)rr,r,r-r(szSequencer.__init__cCs|j|dS)N)rfr)rnoder,r,r-add_node-szSequencer.add_nodeFcCs||jkr|j||rx&t|j|dD]}|||q.Wx&t|j|dD]}|||qVWx&t|jD]\}}|sz|j|=qzWx&t|jD]\}}|s|j|=qWdS)Nr,)rfrrrdrDrerr)rrgZedgesrsr+rrEr,r,r- remove_node0s   zSequencer.remove_nodecCs<||ks t|j|t||j|t|dS)N)r]rd setdefaultrrre)rpredsuccr,r,r-r@s z Sequencer.addcCs||ks ty|j|}|j|}Wn tk rDtd|YnXy||||Wn$tk rtd||fYnXdS)Nz%r not a successor of anythingz%r not a successor of %r)r]rdreKeyErrorrr)rrkrlpredsZsuccsr,r,r-rEs   zSequencer.removecCs||jkp||jkp||jkS)N)rdrerf)rstepr,r,r-is_stepRszSequencer.is_stepcCs||std|g}g}t}||xd|r|d}||krd||kr||||q0|||||j|d}| |q0Wt |S)Nz Unknown: %rrr,) rprrr"rarrrdrDextendreversed)rfinalr(Ztodoseenrornr,r,r- get_stepsVs"        zSequencer.get_stepscsVdggiig|jfddxD]}|kr:|q:WS)Nrcsd|<d|<dd7<|y |}Wntk rVg}YnXxR|D]J}|kr|t|||<q^|kr^t|||<q^W||krg}x }||||krPqWt|}|dS)Nrr)r"rminratuple)rgZ successorsZ successorZconnected_componentZ component)graphindex index_counterlowlinksr(stack strongconnectr,r-r}zs.       z3Sequencer.strong_connections..strongconnect)re)rrgr,)rxryrzr{r(r|r}r-strong_connectionsos"  zSequencer.strong_connectionscCsrdg}x8|jD].}|j|}x|D]}|d||fq"WqWx|jD]}|d|qHW|dd|S)Nz digraph G {z %s -> %s;z %s;} )rdr"rfr$)rr(rlrnrkrgr,r,r-dots     z Sequencer.dotN)F) rrrrrhrirrrprupropertyr~rr,r,r,r-rc's   3rc)z.tar.gzz.tar.bz2z.tarz.zipz.tgzz.tbzz.whlTc sXfdd}tjtd}|dkr|dr>d}nH|drRd}d}n4|drfd }d }n |d rzd }d }n td|z|dkrt|d }|r|}xD|D] }||qWn.t ||}|r| }x|D] }||qW|dkr6t j ddkr6x.| D]"} t| jts| jd| _qW|Wd|rR|XdS)NcsRt|ts|d}tjtj|}|rB|tjkrNt d|dS)Nzutf-8zpath outside destination: %r) rnrdecoderZr[rr$rNr\r)r[rs)dest_dirplenr,r- check_paths   zunarchive..check_path)z.zipz.whlzip)z.tar.gzz.tgzZtgzzr:gz)z.tar.bz2z.tbzZtbzzr:bz2z.tartarrBzUnknown format for %rrr{zutf-8)rZr[rr^r)rrnamelisttarfilerZgetnamesrjrZ getmembersrnrJrr extractallr) Zarchive_filenamerformatrrarchivernamesrJtarinfor,)rrr- unarchivesH           rc Cst}t|}t|db}xZt|D]L\}}}x@|D]8}tj||}||d} tj| |} ||| q8Wq(WWdQRX|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOr^rrZwalkr[r$r) directoryr(Zdlenzfr_r rrJZfullZrelrer,r,r-zip_dirs   r)rKMGTPc@sreZdZdZdddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressUNKNOWNrdcCs<|dks||kst||_|_||_d|_d|_d|_dS)NrF)r]rvcurmaxstartedelapseddone)rZminvalZmaxvalr,r,r-rs  zProgress.__init__cCsV|j|kst|jdks&||jks&t||_t}|jdkrF||_n ||j|_dS)N)rvr]rrtimerr)rZcurvalZnowr,r,r-update s zProgress.updatecCs |dks t||j|dS)Nr)r]rr)rZincrr,r,r- increments zProgress.incrementcCs||j|S)N)rrv)rr,r,r-r8s zProgress.startcCs |jdk r||jd|_dS)NT)rrr)rr,r,r-stops  z Progress.stopcCs|jdkr|jS|jS)N)runknown)rr,r,r-maximum!szProgress.maximumcCsD|jr d}n4|jdkrd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rrrrv)rr(rEr,r,r- percentage%s zProgress.percentagecCs:|dkr|jdks|j|jkr$d}ntdt|}|S)Nrz??:??:??z%H:%M:%S)rrrvrstrftimegmtime)rZdurationr(r,r,r-format_duration0szProgress.format_durationcCs|jrd}|j}n^d}|jdkr&d}nJ|jdks<|j|jkrBd}n.t|j|j}||j|j}|d|j}d|||fS)NZDonezETA rrrz%s: %s)rrrrrvfloatr)rrfrVr,r,r-ETA9s z Progress.ETAcCsN|jdkrd}n|j|j|j}xtD]}|dkr6P|d}q(Wd||fS)Nrgig@@z%d %sB/s)rrrvUNITS)rr(Zunitr,r,r-speedLs   zProgress.speedN)rr)rrrrrrrr8rrrrrrrr,r,r,r-rs     rz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<t|rd}t||t|r4d}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrr_CHECK_MISMATCH_SET_iglob) path_globrr,r,r-ras    rc cst|d}t|dkrpt|dks,t||\}}}x|dD](}x"td|||fD] }|Vq\WqBWnd|krxt|D] }|VqWn|dd\}}|dkrd}|dkrd}n|d}|d }xHt |D]:\}}} tj |}x"ttj ||D] } | VqWqWdS) Nrr{r@rz**r rArY\) RICH_GLOBrvr^r]rr$ std_iglobr%rZrr[rR) rZrich_path_globrfrrditemr[ZradicaldirrrTr,r,r-rls*       r) HTTPSHandlermatch_hostnameCertificateErrorc@seZdZdZdZddZdS)HTTPSConnectionNTcCst|j|jf|j}t|ddr0||_|t tj }t tdrV|j tj O_ |jrl||j|ji}|jrtj|_|j|jdttddr|j|d<|j|f||_|jr|jry$t|j|jtd|jWn0tk r|jtj|jYnXdS)NZ _tunnel_hostF OP_NO_SSLv2)ZcafileZHAS_SNIZserver_hostnamezHost verified: %s)rZcreate_connectionhostZporttimeoutrksockZ_tunnelsslZ SSLContextZPROTOCOL_SSLv23rioptionsrZ cert_fileZload_cert_chainZkey_fileca_certsZ CERT_REQUIREDZ verify_modeZload_verify_locationsZ wrap_socket check_domainrZ getpeercertrrrshutdownZ SHUT_RDWRr)rrcontextrar,r,r-connects0      zHTTPSConnection.connect)rrrrrrr,r,r,r-rsrc@s&eZdZd ddZddZddZdS) rTcCst|||_||_dS)N)BaseHTTPSHandlerrrr)rrrr,r,r-rs zHTTPSHandler.__init__cOs$t||}|jr |j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr)rr`rar(r,r,r- _conn_makers zHTTPSHandler._conn_makerc CsVy||j|Stk rP}z$dt|jkr>td|jnWdd}~XYnXdS)Nzcertificate verify failedz*Unable to verify server certificate for %s)Zdo_openrrstrreasonrr)rrSrIr,r,r- https_opens zHTTPSHandler.https_openN)T)rrrrrrr,r,r,r-rs rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrSr,r,r- http_openszHTTPSOnlyHandler.http_openN)rrrrr,r,r,r-rsrc@seZdZdddZddZdS) TransportrcCs||_tj||dS)N)rrrr)rr use_datetimer,r,r-rszTransport.__init__cCsD||\}}}|jr$||jdkr:||_|t|f|_|jdS)Nrr) get_host_info _connection_extra_headersrZHTTPConnection)rrhehZx509r,r,r-make_connections zTransport.make_connectionN)r)rrrrrr,r,r,r-rs rc@seZdZdddZddZdS) SafeTransportrcCs||_tj||dS)N)rrrr)rrrr,r,r-rszSafeTransport.__init__cCs\||\}}}|si}|j|d<|jr6||jdkrR||_|tj|df|f|_|jdS)Nrrr)rrrrrr)rrrrrar,r,r-rs   zSafeTransport.make_connectionN)r)rrrrrr,r,r,r-rs rc@seZdZddZdS) ServerProxycKst|dd|_}|dk r^t|d}|dd}|dkr@t}nt}|||d|d<}||_tjj ||f|dS)NrrrZhttps)r transport) rarrrDrrrrrr)rrTrarrQrZtclsrVr,r,r-rs  zServerProxy.__init__N)rrrrr,r,r,r-rsrcKs6tjddkr|d7}nd|d<d|d<t||f|S)Nrr{brnewlinezutf-8r)rjrr)rTrrar,r,r- _csv_opens  rc@s4eZdZedededdZddZddZd S) CSVBaser@"r) delimiterZ quotecharZlineterminatorcCs|S)Nr,)rr,r,r- __enter__(szCSVBase.__enter__cGs|jdS)N)rr)rrr,r,r-__exit__+szCSVBase.__exit__N)rrrrdefaultsrrr,r,r,r-r!s  rc@s(eZdZddZddZddZeZdS) CSVReadercKs\d|kr4|d}tjddkr,td|}||_nt|dd|_tj|jf|j|_dS)Nrrr{zutf-8r[rB) rjrrrrrcsvrHr)rrarr,r,r-r0szCSVReader.__init__cCs|S)Nr,)rr,r,r-__iter__;szCSVReader.__iter__cCsJt|j}tjddkrFx,t|D] \}}t|ts"|d||<q"W|S)Nrr{zutf-8)nextrHrjrr2rnrr)rr(rUrr,r,r-r>s   zCSVReader.nextN)rrrrrr__next__r,r,r,r-r/s rc@seZdZddZddZdS) CSVWritercKs$t|d|_tj|jf|j|_dS)Nr)rrrwriterr)rrTrar,r,r-rIs zCSVWriter.__init__cCsRtjddkrBg}x*|D]"}t|tr0|d}||qW|}|j|dS)Nrr{zutf-8)rjrrnrrr"rwriterow)rrowrBrr,r,r-rMs   zCSVWriter.writerowN)rrrrrr,r,r,r-rHsrcsHeZdZeejZded<d fdd ZddZdd Zd d Z Z S) Configurator inc_convertZincNcs"tt|||pt|_dS)N)superrrrZrrc)rconfigrc) __class__r,r-r`szConfigurator.__init__c sfddd}t|s*|}dd}dd}|r\tfdd|D}fd dD}t|}|||}|rx$|D]\}} t||| qW|S) Ncszt|ttfr*t|fdd|D}nLt|trld|krH|}qvi}x(|D]}||||<qRWn |}|S)Ncsg|] }|qSr,r,)rHrU)convertr,r-rIgszBConfigurator.configure_custom..convert..z())rnrrwtypedictconfigure_customr)or(r)rrr,r-res    z.Configurator.configure_custom..convertz()r z[]r,csg|] }|qSr,r,)rHr)rr,r-rIzsz1Configurator.configure_custom..cs$g|]}t|r||fqSr,)r)rHr)rrr,r-rI{s)rarrrwrrsetattr) rrrtpropsr`rrar(r=rEr,)rrrr-rds     zConfigurator.configure_customcCs4|j|}t|tr0d|kr0|||j|<}|S)Nz())rrnrr)rryr(r,r,r- __getitem__s zConfigurator.__getitem__c CsFtj|stj|j|}tj|ddd}t|}WdQRX|S)z*Default converter for the inc:// protocol.rBzutf-8)rN) rZr[isabsr$rcrrrr)rrrr(r,r,r-rs  zConfigurator.inc_convert)N) rrrrrZvalue_convertersrrrr __classcell__r,r,)rr-r[s  rc@s*eZdZdZd ddZddZdd ZdS) SubprocessMixinzC Mixin for running subprocesses and capturing their output FNcCs||_||_dS)N)verboseprogress)rrrr,r,r-rszSubprocessMixin.__init__cCsn|j}|j}xT|}|sP|dk r0|||q|sBtjdntj|dtjqW|dS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nr zutf-8) rrreadlinerjstderrrrflushr)rrrrrr+r,r,r-rHs zSubprocessMixin.readercKstj|ftjtjd|}tj|j|jdfd}|tj|j|jdfd}|| | | |j dk r| ddn|j rt jd|S)N)stdoutrr)rr`rzdone.mainzdone. ) subprocessPopenPIPE threadingThreadrHrr8rwaitr$rrrjr)rcmdrarsZt1Zt2r,r,r- run_commands   zSubprocessMixin.run_command)FN)rrrrVrrHr r,r,r,r-rs rcCstdd|S)z,Normalize a python package name a la PEP 503z[-_.]+r6)r9subrp)rJr,r,r-normalize_namesrc@s.eZdZdZdZd ddZddZdd ZdS) PyPIRCFilezhttps://upload.pypi.org/legacy/pypiNcCs.|dkrtjtjdd}||_||_dS)Nrz.pypirc)rZr[r$r"r<rL)rrTrLr,r,r-rszPyPIRCFile.__init__c Csi}tj|jr|jp|j}t}||j| }d|kr2| dd}dd| dD}|gkr~d|kr|dg}nx|D]}d|i}| |d|d<xHd |jfd |j fd fD].\}} | ||r| ||||<q| ||<qW|dkr||jdfkr|j|d <q|d|kr|d |kri}qWnRd |krd }| |d r\| |d }n|j}| |d| |d |||j d}|S)N distutilsz index-serverscSs g|]}|dkr|qS)r)rM)rHserverr,r,r-rIsz#PyPIRCFile.read..rrrr, repositoryrealm)r-Nz server-loginr-)r,r-rrr)rZr[rr<rLDEFAULT_REPOSITORYrRawConfigParserrrrDrv DEFAULT_REALM has_option) rr(rrr index_servers_serversrryrrr,r,r-rsN                 zPyPIRCFile.readc Cslt}|j}|||ds,|d|dd||dd|t|d}||WdQRXdS)Nrr,r-r) rrr<r has_sectionrrrr)rr,r-rrTrr,r,r-rs    zPyPIRCFile.update)NN)rrrrrrrrr,r,r,r-rs  :rcCst|jdS)zG Read the PyPI access configuration as supported by distutils. )rL)rrLr)ryr,r,r- _load_pypirc srcCst|j|jdS)N)rrr,r-)ryr,r,r- _store_pypirc&src CstjdkrFdtjkrdSdtjkr.dSdtjkr@dStjSdtjkrZtjdStjd ksnttd sttjSt\}}}}}| d d }| d d d d}|dddkrd||fS|dddkr(|ddkrd}dt |dd|ddf}ddd}|d|tj 7}n|dddkrLdd l m }|S|dd!d"krd"}td#tj}||}|r|}n>|dd!d$krddl} ddl} | | j|||\}}}d%|||fS)&aReturn a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. on Linux, the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. ramd64z win-amd64z(arm)z win-arm32z(arm64)z win-arm64_PYTHON_HOST_PLATFORMrunamerYrr5rWr6Nlinuxz%s-%ssunosr5solarisz%d.%sr{32bit64bit)ilz.%saix) aix_platformcygwinz[\d.]+darwinz%s-%s-%s)rZrJrjrNrpplatformr rir r!intmaxsizeZ _aix_supportr*r9rASCIIrr _osx_supportdistutils.sysconfigget_platform_osx sysconfigget_config_vars) osnamerreleaserNmachinebitnessr*rel_rer'r2rr,r,r-get_host_platform.sL         r<win32z win-amd64z win-arm32)Zx86Zx64ZarmcCs2tjdkrtStjd}|tkr*tSt|S)NrZVSCMD_ARG_TGT_ARCH)rZrJr<r rD_TARGET_TO_PLAT)Zcross_compilation_targetr,r,r- get_platforms   r?)NN)r)N)N)NT)r collectionsr contextlibrZglobrrrrloggingrZrr9rr ImportErrorrrjrrrrZdummy_threadingrrrcompatrrrr r r r r rrrrrrrrrrrrr getLoggerrrrrrCrBr4r;r8rPr#r<rXrgrlrorurzrrcontextmanagerrrrrrrrrrVERBOSErrr&r(r*r.r1r4Ir;r7r>r?r@rCrJrLrMrOrPrWrcZARCHIVE_EXTENSIONSrrrrrrrrrrrrrrrrrrrrrrrrrrrr<r>r?r,r,r,r-s      \         Y}   /  8  )    ,H  6]    !)  7.QR