v]c@sdZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&m'Z'm(Z(dd l)m*Z*dd l+m,Z,ddl-m.Z.m/Z/ddl)m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:m;Z;m<Z<ddl5m=Z=m>Z>ddl?m@Z@ddlAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPdd lQZAeRZSejTddeAjUddddddgZVd ZWd!ZXe,jYr(d"ZZd#Z[nd$ZZd%Z[d&Z\de0fd'YZ]d(Z^d)Z_d*Z`d+Zad,ZbdeHfd-YZcd.ecfd/YZdejejfd0d1d2kredZcnd3Zgd4Zhd5Zid6Zjekd7Zld8Zmd9Znd:ejokr0enZpn d;Zpd<d=Zqd>Zrd?Zsd@ZtyddAlmuZvWnewk rdBZvnXdCZudDexfdEYZyeyjzZ{dFeyfdGYZ|dHfdIYZ}dJe}fdKYZ~dLe~fdMYZe}jZe}jZdNZdOZeehdPZdQZdRZekdSZe"jdTZdUe*fdVYZd S(Ws% Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html i(tglob(t get_platform(t convert_patht subst_vars(tDistutilsArgErrortDistutilsOptionErrortDistutilsErrortDistutilsPlatformError(tINSTALL_SCHEMESt SCHEME_KEYS(tlogtdir_util(t first_line_re(tfind_executableN(tget_config_varstget_path(tSetuptoolsDeprecationWarning(tsix(t configparsertmap(tCommand(t run_setup(t rmtree_safe(tsetopt(tunpack_archive(t PackageIndextparse_requirement_argt URL_SCHEME(t bdist_eggtegg_info(tWheel(t yield_linestnormalize_pathtresource_stringtensure_directorytget_distributiontfind_distributionst Environmentt Requirementt Distributiont PathMetadatat EggMetadatat WorkingSettDistributionNotFoundtVersionConflictt DEVELOP_DISTtdefaulttcategorytsamefilet easy_installtPthDistributionstextract_wininst_cfgtmaintget_exe_prefixescCstjddkS(NtPi(tstructtcalcsize(((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pytis_64bitPscCstjj|o!tjj|}ttjdo9|}|rUtjj||Stjjtjj|}tjjtjj|}||kS(s Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. R0(tostpathtexiststhasattrR0tnormpathtnormcase(tp1tp2t both_existt use_samefiletnorm_p1tnorm_p2((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR0Ts$cCs|S(N((ts((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt _to_bytesfscCs1ytj|dtSWntk r,tSXdS(Ntascii(Rt text_typetTruet UnicodeErrortFalse(RF((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pytisasciiis  cCs |jdS(Ntutf8(tencode(RF((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRGqscCs.y|jdtSWntk r)tSXdS(NRH(RORJRKRL(RF((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRMts   cCstj|jjddS(Ns s; (ttextwraptdedenttstriptreplace(ttext((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt|tcBsreZdZdZeZdddddddddddddddddddddgZdddd dd-d0d6d9g Ze j rd=e j Z ej d>de fej d>nidd'6ZeZd?Zd@ZdAZedBZdCZdDZdEZdFZdGZdHZdIZdJZdKZej dLj!Z"ej dMj!Z#ej dNj!Z$dOZ%dPZ&dQZ'dRZ(dSZ)dTZ*e+j,dUZ-e.dVZ/e.dWZ0dXZ1edYZ2dZZ3d[Z4d\Z5dd]Z6ed^Z7d_dd`Z8daZ9dbZ:dcZ;ddZ<deZ=dfZ>ej dgj!Z?ej dhZ@didjZAej dkj!ZBdlZCdmZDdnZEdoZFdpZGdqZHdrZIdsZJej dtj!ZKduZLdvZMdwZNeOdxeOdydzd{d|ZPeOdyd}d{d~ZQdZRRS(s'Manage a download/build/install processs Find/get/install Python packagessprefix=sinstallation prefixszip-oktzsinstall package as a zipfiles multi-versiontms%make apps have to require() a versiontupgradetUs1force upgrade (searches PyPI for latest versions)s install-dir=tdsinstall package to DIRs script-dir=RFsinstall scripts to DIRsexclude-scriptstxsDon't install scriptss always-copytas'Copy all needed packages to install dirs index-url=tis base URL of Python Package Indexs find-links=tfs(additional URL(s) to search for packagessbuild-directory=tbs/download/extract/build in DIR; keep the resultss optimize=tOslalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]srecord=s3filename in which to record list of installed filess always-unziptZs*don't install as a zipfile, no matter whats site-dirs=tSs)list of directories where .pth files workteditabletes+Install specified packages in editable formsno-depstNsdon't install dependenciess allow-hosts=tHs$pattern(s) that hostnames must matchslocal-snapshots-oktls(allow building eggs from local checkoutstversions"print version information and exits no-find-linkss9Don't load find-links defined in packages being installeds!install in user site-package '%s'tusercCsd|_d|_|_d|_|_|_d|_d|_d|_ d|_ d|_ |_ d|_ |_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tj rtj!|_"tj#|_$nd|_"d|_$d|_%d|_&d|_'|_(d|_)i|_*t+|_,d|_-|j.j/|_/|j.j0||j.j1ddS(NiR1(2RjtNonetzip_oktlocal_snapshots_okt install_dirt script_dirtexclude_scriptst index_urlt find_linkstbuild_directorytargstoptimizetrecordRYt always_copyt multi_versionRdtno_depst allow_hoststroottprefixt no_reportRitinstall_purelibtinstall_platlibtinstall_headerst install_libtinstall_scriptst install_datat install_basetinstall_platbasetsitetENABLE_USER_SITEt USER_BASEtinstall_userbaset USER_SITEtinstall_usersitet no_find_linkst package_indextpth_filetalways_copy_fromt site_dirstinstalled_projectsRLtsitepy_installedt_dry_runt distributiontverboset_set_command_optionstget_option_dict(tself((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pytinitialize_optionssF                         cCs*d|D}tt|j|dS(Ncss9|]/}tjj|s-tjj|r|VqdS(N(R:R;R<tislink(t.0tfilename((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pys s(tlistRt _delete_path(Rtblockerstextant_blockers((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pytdelete_blockersscCsetjd||jrdStjj|o?tjj| }|rNtntj}||dS(Ns Deleting %s( R tinfotdry_runR:R;tisdirRtrmtreetunlink(RR;tis_treetremover((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs  %cCs=tjd }td}d}|jtGHtdS(sT Render the Setuptools version and installation details, then exit. it setuptoolss=setuptools {dist.version} from {dist.location} (Python {ver})N(tsysRiR#tformattlocalst SystemExit(tvertdistttmpl((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt_render_versions   c Cs|jo|jtjjd}tdd\}}i |jjd6|jjd6|jjd6|d6|dd!d 6|d|d d 6|d 6|d6|d 6|d6t tddd6|_ t j r|j |j d<|j|j dt<|j;|_;d|j;kod knst=nWqt=k rt(d"qXn|j*r|j> rt?d#n|j@st?d$ng|_AdS()NiR|t exec_prefixt dist_namet dist_versiont dist_fullnamet py_versionitpy_version_shortitpy_version_nodott sys_prefixtsys_exec_prefixtabiflagsRVtuserbasetusersiteRnRoRsRRRtinstallRvt,s"%s (in --site-dirs) does not exists$ (in --site-dirs) is not on sys.pathshttps://pypi.org/simple/t*t search_paththostsRus--optimize must be 0, 1, or 2s9Must specify a build directory (-b) when using --editables:No urls, filenames, or requirements specified (see --help)(RnRn(RnRo(RvRv(RuRu(BRiRRtsplitRRtget_namet get_versiont get_fullnametgetattrt config_varsRRRRt_fix_install_dir_for_user_sitetexpand_basedirst expand_dirst_expandRoRkRnRRLtset_undefined_optionsRjR~RRR R;t get_site_dirst all_site_dirsRR:t expanduserRRRR twarnRtappendRdtcheck_site_dirRqt shadow_pathtinsertRzRt create_indexR%t local_indexRrt isinstanceRt string_typesRmtscan_egg_linkstadd_find_linksRutintt ValueErrorRsRRttoutputs( RRR|RR>RFRR[t path_itemR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pytfinalize_optionss          4    . !        cCs|j stj rdS|j|jdkrFd}t|n|j|_|_t j j ddd}|j |dS(s; Fix the install_dir if "--user" was used. Ns$User base directory is not specifiedtposixtunixt_user( RjRRtcreate_home_pathRRkRRRR:tnameRSt select_scheme(Rtmsgt scheme_name((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRts cCsx|D]y}t||}|dk rtjdksFtjdkr[tjj|}nt||j}t|||qqWdS(NRtnt( RRkR:RR;RRRtsetattr(Rtattrstattrtval((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt _expand_attrss  cCs|jdddgdS(sNCalls `os.path.expanduser` on install_base, install_platbase and root.RRR{N(R(R((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRscCs)ddddddg}|j|dS(s+Calls `os.path.expanduser` on install dirs.R~RRRRRN(R(Rtdirs((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs cCs|j|jjkr(tj|jnzx%|jD]}|j||j q5W|jr|j}|j rt |j }x/t t |D]}||||||jr dSx*tjj|D]}|j|q#WdS(N(Rpt ScriptWritertbesttget_argst write_script(RRRt((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR+s cCspt|j}t||}|rS|j|t}tj||}n|j|t|ddS(s/Generate a legacy script wrapper and install itR`N( R7RStis_python_scriptt_load_templateRRbt get_headerReRG(RRR,t script_texttdev_pathRt is_scripttbody((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR)#s cCs=d}|r!|jdd}ntd|}|jdS(s There are a couple of template scripts in the package. This function loads one of them and prepares it for use. s script.tmpls.tmpls (dev).tmplRsutf-8(RSR!tdecode(RjRt raw_bytes((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRg-s ttc Cs|jg|D]}tjj|j|^q tjd||jtjj|j|}|j||jrzdSt }t |tjj |rtj |nt |d|}|j|WdQXt|d|dS(s1Write an executable file to the scripts directorysInstalling %s script to %sNRi(RR:R;RRoR RR1Rt current_umaskR"R<RRRtchmod( RR,R`tmodeRR\ttargettmaskR_((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRe<s,    cCs|jjdr(|j||gS|jjdrP|j||gS|jjdrx|j||gS|}tjj|r|jd rt|||j n'tjj |rtjj |}n|j |r|j r|dk r|j|||}ntjj|d}tjj|sttjj|dd}|stdtjj |nt|dkrtd tjj |n|d }n|jrtj|j||gS|j||SdS( Ns.eggs.exes.whls.pyssetup.pyRs"Couldn't find a setup script in %sisMultiple setup scripts in %si(RRDt install_eggt install_exet install_wheelR:R;tisfileRtunpack_progressRtabspatht startswithRsRkRaRR<RRRRdR Rtreport_editabletbuild_and_install(RRR]R8R^t setup_scripttsetups((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRFPs<"  cCs[tjj|r3t|tjj|d}nttj|}tj |d|S(NsEGG-INFOtmetadata( R:R;RR(RR)t zipimportt zipimporterR't from_filename(Rtegg_pathR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRG|s cCs%tjj|jtjj|}tjj|}|jsLt|n|j|}t ||s tjj |rtjj | rt j |d|jn2tjj|r|jtj|fd|nyt}tjj |r*|j|rtjd}}qtjd}}ng|j|rY|j||jd}}n8t}|j|rtjd}}ntjd}}|j|||f|dtjj|tjj|ft|d|Wq tk rt|dtq Xn|j||j|S(NRs Removing tMovingtCopyingt Extractings %s to %stfix_zipimporter_caches(R:R;RRnR#RzRR"RGR0RRR t remove_treeR<RRRLR{R[R\tcopytreeRYtmkpathtunpack_and_compileRJtcopy2Rtupdate_dist_cachesRR1(RRR8t destinationRtnew_dist_is_zippedR_RX((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRusT   %      cCst|}|dkr+td|ntdd|jddd|jdddt}tjj||j d}||_ |d}tjj|d }tjj|d }t |t |||_ |j||tjj|st|d } | jd xU|jdD]D\} } | d kr*| jd| jddj| fq*q*W| jntjj|d} |jgtj|D]} tjj| | d^qtj||d|jd|j|j||S(Ns(%s is not a valid distutils Windows .exeRERRRitplatforms.eggs.tmpsEGG-INFOsPKG-INFORsMetadata-Version: 1.0 ttarget_versions%s: %s t_t-R&iRR(R3RkRR'tgetRR:R;Rtegg_nameRAR"R(t _providert exe_to_eggR<RRtitemsRSttitleRRRbRdRt make_zipfileRRRu(RR]R8tcfgRRtegg_tmpt _egg_infotpkg_infR_tktvRoRt((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRvs<       0 3c st|ggifd}t||g}xD]}|jjdrV|jd}|d}tj|dd|d=%(version)s") # this version or higher s Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) t Installedc Csd}|jr\|j r\|d|j7}|jtttjkr\|d|j7}q\n|j }|j }|j }d}|t S(s9Helpful installation message for display to package userss %(what)s %(eggloc)s%(extras)ss RV( RxR}t_easy_install__mv_warningRnRR RR;t_easy_install__id_warningRARERiR( RtreqRtwhatRtegglocRRitextras((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRPJs   sR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs-tjj|}tj}d|jtS(Ns (R:R;RRRt_easy_install__editable_msgR(RRR~Rtpython((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR|cs cCstjjdttjjdtt|}|jdkrid|jd}|jdd|n"|jdkr|jddn|jr|jdd nt j d |t |dd j |yt ||Wn-tk r}td |jdfnXdS( Nsdistutils.command.bdist_eggsdistutils.command.egg_infoiRiiRs-qs-ns Running %s %st sSetup script exited with %s(Rtmodulest setdefaultRRRRRRR RRRRRRRt(RR~R^RtR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRhs   $c Csddg}tjdddtjj|}z|jtjj||j||j|||t|g}g}x?|D]7}x.||D]"}|j|j |j |qWqW| r|j rt j d|n|SWdt|t j|jXdS(NRs --dist-dirR|s egg-dist-tmp-tdirs+No eggs found in %s (setup script problem?)(R5R6R:R;Rt_set_fetcher_optionsRRR%RuRARR RRRR( RR~R^Rttdist_dirtall_eggsteggsR3R((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR}|s$    $   c Cs|jjdj}d }i}xF|jD]8\}}||krOq1n|d||jdd egg path translations for a given .exe filesPURELIB/RVsPLATLIB/pywin32_system32sPLATLIB/sSCRIPTS/sEGG-INFO/scripts/sDATA/lib/site-packagesRiisPKG-INFOis .egg-infois EGG-INFO/s.pths -nspkg.pthtPURELIBtPLATLIBs\Rs%s/%s/N(sPURELIB/RV(sPLATLIB/pywin32_system32RV(sPLATLIB/RV(sSCRIPTS/sEGG-INFO/scripts/(sDATA/lib/site-packagesRV(R.R/(RtZipFiletinfolistRRRRDRRtupperRRtPY3RmRRRRSR{RRRtsorttreverse( t exe_filenameRRWRRRR`tpthR\ty((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR5s>  "#" 3 +  cBs\eZdZeZddZdZdZedZ dZ dZ dZ RS( s)A .pth file with Distribution paths in itcCs||_ttt||_ttjj|j|_|j t j |gddx6t |jD]%}tt|jt|tqoWdS(N(RRRR RR:R;Rtbasedirt_loadR%t__init__RkRRRNR$RJ(RRRR;((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR;0s  cCsg|_t}tj|j}tjj|jr3t |jd}x|D]}|j drpt }qOn|j }|jj ||j sO|jj drqOnttjj|j|}|jdcCs7yt||dWnttfk r.tSXtSdS(s%Is this string a valid Python script?texecN(RVt SyntaxErrort TypeErrorRLRJ(RTR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt is_pythonxs cCsVy1tj|dd}|jd}WdQXWnttfk rK|SX|dkS(sCDetermine if the specified executable is a .sh (contains a #! line)Rslatin-1iNs#!(RRRRR (Rtfptmagic((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pytis_shs cCstj|gS(s@Quote a command line argument according to Windows parsing rules(t subprocesst list2cmdline(R[((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt nt_quote_argscCsb|jds|jdr"tSt||r5tS|jdr^d|jdjkStS(sMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. s.pys.pyws#!Ri(RDRJRyR{t splitlinesRRL(RiR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRfs(RqcGsdS(N((Rt((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt_chmodscCsQtjd||yt||Wn&tjk rL}tjd|nXdS(Nschanging mode of %s to %oschmod failed: %s(R RRR:terror(R;RrRe((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRqs t CommandSpeccBseZdZgZeZedZedZedZ edZ edZ dZ e dZdZe d Ze d ZRS( sm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCs|S(sV Choose the best CommandSpec class based on environmental conditions. ((RO((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRcscCs(tjjtj}tjjd|S(Nt__PYVENV_LAUNCHER__(R:R;R>RRRR(ROt_default((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt_sys_executablescCsOt||r|St|tr,||S|dkrB|jS|j|S(sg Construct a CommandSpec from a parameter to build_scripts, which may be None. N(RRRktfrom_environmentt from_string(ROtparam((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt from_params   cCs||jgS(N(R(RO((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRscCstj||j}||S(s} Construct a command spec from a simple string representing a command line parseable by shlex.split. (tshlexRt split_args(ROtstringR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRscCsMtj|j||_tj|}t|sIdg|jd*ndS(Ns-xi(RRt_extract_optionstoptionsR}R~RM(RRitcmdline((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pytinstall_optionss cCsQ|djd}tj|}|rA|jdpDdnd}|jS(sH Extract any options from the first line of the script. s iiRV(RRWtmatchtgroupRR(t orig_scripttfirstRR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs!cCs|j|t|jS(N(t_renderRR(R((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt as_headerscCsDd}x7|D]/}|j|r |j|r |dd!Sq W|S(Ns"'ii(R{RD(titemt_QUOTEStq((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt _strip_quotess  cCs%tjd|D}d|dS(Ncss$|]}tj|jVqdS(N(RRRR(RR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pys ss#!s (R}R~(RR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs(RRRRRRRPRcRRRRRRRRRR(((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs   tWindowsCommandSpeccBseZedeZRS(R(RRRRLR(((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRsRbcBseZdZejdjZeZe d e dZ e d e dZ e d dZedZe dZe dZe dZe d d d ZRS( s` Encapsulates behavior around writing entry point scripts for console and gui apps. s # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) cCsMtjdt|rtntj}|jd||}|j||S(Ns Use get_argsRV(twarningsRtEasyInstallDeprecationWarningtWindowsScriptWriterRbRctget_script_headerRd(RORRtwininsttwritertheader((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pytget_script_args scCs5tjdtdd|r%d}n|j||S(NsUse get_headert stacklevelis python.exe(RRRRh(RORiRR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR(s c cs|dkr|j}nt|j}xdD]}|d}xn|j|jD]W\}}|j||jt}|j ||||} x| D] } | VqWqZWq4WdS(s Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. tconsoletguit_scriptsN(RR( RkRhR7RSt get_entry_mapRt_ensure_safe_nameRRt_get_script_args( RORRRttype_RRtepRiRtR((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRd0s   "  cCs+tjd|}|r'tdndS(s? Prevent paths in *_scripts entry point names. s[\\/]s+Path separators not allowed in script namesN(RUtsearchR(Rt has_path_sep((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRBscCs*tjdt|r tjS|jS(NsUse best(RRRRRc(ROt force_windows((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyt get_writerKscCs?tjdks-tjdkr7tjdkr7tjS|SdS(sD Select the best ScriptWriter for this environment. twin32tjavaRN(RRR:Rt_nameRRc(RO((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRcQs- ccs|||fVdS(N((RORRRRi((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR[sRVcCs/|jjj|}|j||jS(s;Create a #! line, getting options (if any) from script_text(tcommand_spec_classRcRRR(RORiRtcmd((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRh`s N(RRRRPRQRRRRRPRkRLRRRdRRRRcRRh(((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRb s    RcBsYeZeZedZedZedZedZe dZ RS(cCstjdt|jS(NsUse best(RRRRc(RO((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRkscCs2tdtd|}tjjdd}||S(sC Select the best ScriptWriter suitable for Windows RtnaturaltSETUPTOOLS_LAUNCHER(RtWindowsExecutableLauncherWriterR:RR(ROt writer_lookuptlauncher((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRcqs  c cstdddd|}|tjdjjdkr`djt}tj|t nddd d d dd g}|j ||j ||}g|D]}||^q} ||||d | fVdS(s For Windows, add a .py extensionRs.pyaRs.pywtPATHEXTt;sK{ext} not listed in PATHEXT; scripts will not be recognized as executables.s.pys -script.pys.pycs.pyos.exeRoN( RR:RRRRRRRt UserWarningROt_adjust_header( RORRRRitextRRR\R((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyR~s"  cCsud}d}|dkr(||}}ntjtj|tj}|jd|d|}|j|rq|S|S(s Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). s pythonw.exes python.exeRRtrepl(RURVtescapet IGNORECASEtsubt _use_header(RORt orig_headerRTRt pattern_obt new_header((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs cCs/|dd!jd}tjdkp.t|S(s Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. iit"R(RRRRR (Rt clean_header((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs ( RRRRRPRRcRRRR(((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRhs  RcBseZedZRS(c cs|dkr$d}d}dg}nd}d}dddg}|j||}g|D]} || ^qX} ||||d | fV|d t|d fVts|d } | t|d fVnd S(sG For Windows, add a .py extension and an .exe launcher Rs -script.pyws.pywtclis -script.pys.pys.pycs.pyoRos.exeR`s .exe.manifestN(Rtget_win_launcherR9tload_launcher_manifest( RORRRRit launcher_typeRRthdrR\Rtm_name((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs    (RRRPR(((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRscCsGd|}tr(|jdd}n|jdd}td|S(s Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. s%s.exet.s-64.s-32.R(R9RSR!(ttypet launcher_fn((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs   cCs>tjtd}tjr&|tS|jdtSdS(Nslauncher manifest.xmlsutf-8(RR!RRtPY2tvarsRm(Rtmanifest((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRs  cCstj|||S(N(R[R(R;t ignore_errorstonerror((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRscCs tjd}tj||S(Ni(R:tumask(ttmp((sE/tmp/pip-install-vZZv26/setuptools/setuptools/command/easy_install.pyRps cCsMddl}tjj|jd}|tjd s"                 d             A ) ) 'l   R          T ^A