v]c@s|dZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'j(Z(ddl)m*Z*ddlm+Z+ddlm,Z,dZ-dd(dYZ.de.efdYZ/defdYZdefdYZ0dZ1dZ2dZ3dZ4dZ5d Z6d!Z7d"Z8e9d#Z:d$Z;d%Z<d&e,fd'YZ=dS()sUsetuptools.command.egg_info Create a distribution's .egg-info directory and contentsi(tFileList(tDistutilsInternalError(t convert_path(tlogN(tsix(tmap(tCommand(tsdist(t walk_revctrl(t edit_config(t bdist_egg(tparse_requirementst safe_namet parse_versiont safe_versiont yield_linest EntryPointtiter_entry_pointst to_filename(tglob(t packaging(tSetuptoolsDeprecationWarningcCsd}|jtjj}tjtj}d|f}xt|D]\}}|t|dk}|dkr|r|d7}qG|d||f7}qGnd}t|} x|| krA||} | dkr||d7}nJ| d kr||7}n1| d kr!|d} | | krB|| d krB| d} n| | krk|| d krk| d} nx*| | kr|| d kr| d} qnW| | kr|tj| 7}q4||d| !} d} | dd krd } | d} n| tj| 7} |d| f7}| }n|tj| 7}|d7}qW|sG||7}qGqGW|d7}tj|dtj tj BS(s Translate a file path glob like '*.txt' in to a regular expression. This differs from fnmatch.translate which allows wildcards to match directory separators. It also knows about '**/' which matches any number of directories. ts[^%s]is**s.*s (?:%s+%s)*it*t?t[t!t]t^s[%s]s\Ztflags( tsplittostpathtseptretescapet enumeratetlentcompilet MULTILINEtDOTALL(RtpattchunksR!t valid_chartctchunkt last_chunktit chunk_lentchartinner_itinnert char_class((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyttranslate_pattern$sV                t InfoCommoncBsAeZdZdZedZdZdZeeZ RS(cCst|jjS(N(R t distributiontget_name(tself((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytname{scCsE|jj}|jr4|j|jr4t|St||jS(N(R7t get_versiontvtagstendswithR(R9tversion((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyttagged_versions cCsBd}|jr||j7}n|jr>|tjd7}n|S(NRs-%Y%m%d(t tag_buildttag_datettimetstrftime(R9R>((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyttagss   N( t__name__t __module__tNoneR@RAtpropertyR:R?RDR<(((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyR6ws   tegg_infocBseZdZddddgZdgZidd 6Zd ZedZej dZdZ dZ e dZ dZdZdZdZdZRS(s+create a distribution's .egg-info directorys egg-base=tesLdirectory containing .egg-info directories (default: top of the source tree)stag-datetds0Add date stamp (e.g. 20050528) to version numbers tag-build=tbs-Specify explicit tag to add to version numbersno-datetDs"Don't include date stamp [default]cCs1d|_d|_d|_d|_t|_dS(N(RGtegg_basetegg_nameRIt egg_versiontFalsetbroken_egg_info(R9((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytinitialize_optionss     cCsdS(N((R9((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyttag_svn_revisionscCsdS(N((R9tvalue((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRTscCs@tj}|j|dtVersiontlistR t ValueErrort distutilsterrorstDistutilsOptionErrorRNRGR7t package_dirtgetRtcurdirtensure_dirnameRRIR tjointcheck_broken_egg_infotmetadatat _patched_disttkeytlowert_versiont_parsed_version(R9tparsed_versiont is_versiontspectdirstpd((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytfinalize_optionss6 !   ! !  $ cCsl|r|j|||nLtjj|rh|dkrX| rXtjd||dS|j|ndS(sWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). s$%s not set in setup(), but %s existsN(t write_fileRR texistsRGRtwarnt delete_file(R9twhatRYtdatatforce((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytwrite_or_delete_files  cCsdtjd||tjr.|jd}n|js`t|d}|j||jndS(sWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. swriting %s to %ssutf-8twbN( RtinfoRtPY3tencodetdry_runtopentwritetclose(R9RyRYRztf((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRus   cCs-tjd||js)tj|ndS(s8Delete `filename` (if not a dry run) after announcing its deleting %sN(RR~RRtunlink(R9RY((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRxs cCs|j|jtj|jd|jj}xXtdD]J}|jd||j }|||j tj j |j|j q<Wtj j |jd}tj j |r|j|n|jdS(Nsegg_info.writerst installersnative_libs.txt(tmkpathRIRtutimeRGR7tfetch_build_eggRtrequiretresolveR:R RgRvRxt find_sources(R9Rteptwritertnl((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytruns  ,cCsJtjj|jd}t|j}||_|j|j|_dS(s"Generate SOURCES.txt manifest files SOURCES.txtN( RR RgRItmanifest_makerR7tmanifestRtfilelist(R9tmanifest_filenametmm((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyR*s   cCs|jd}|jtjkr:tjj|j|}ntjj|rtjddddd||j |j |_ ||_ ndS(Ns .egg-infoR[iNs Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ( RORNRReR RgRvRRwRIRR(R9tbei((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRh2s   (s egg-base=RJsLdirectory containing .egg-info directories (default: top of the source tree)(stag-dateRKs0Add date stamp (e.g. 20050528) to version number(s tag-build=RLs-Specify explicit tag to add to version number(sno-dateRMs"Don't include date stamp [default](RERFt descriptiont user_optionstboolean_optionst negative_optRSRHRTtsetterRZRtRQR|RuRxRRRh(((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRIs&     1     RcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZRS(cCs|j|\}}}}|dkrw|jddj|x|D](}|j|sHtjd|qHqHWnx|dkr|jddj|xO|D](}|j|stjd|qqWn|dkr/|jd dj|x|D](}|j|stjd |qqWn|d kr|jd dj|x|D](}|j|s\tjd |q\q\Wnd|dkr|jd|dj|fx5|D].}|j ||stjd||qqWn|dkr[|jd|dj|fx|D].}|j ||s&tjd||q&q&Wn|dkr|jd||j |stjd|qnR|dkr|jd||j |stjd|qnt d|dS(Ntincludesinclude t s%warning: no files found matching '%s'texcludesexclude s9warning: no previously-included files found matching '%s'sglobal-includesglobal-include s>warning: no files found matching '%s' anywhere in distributionsglobal-excludesglobal-exclude sRwarning: no previously-included files matching '%s' found anywhere in distributionsrecursive-includesrecursive-include %s %ss:warning: no files found matching '%s' under directory '%s'srecursive-excludesrecursive-exclude %s %ssNwarning: no previously-included files matching '%s' found under directory '%s'tgraftsgraft s+warning: no directories found matching '%s'tprunesprune s6no previously-included directories found matching '%s's'this cannot happen: invalid action '%s'(t_parse_template_linet debug_printRgRRRwRtglobal_includetglobal_excludetrecursive_includetrecursive_excludeRRR(R9tlinetactiontpatternstdirt dir_patterntpattern((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytprocess_template_lineEsd                         cCsrt}xett|jdddD]D}||j|r&|jd|j||j|=t}q&q&W|S(s Remove all files from the file list that match the predicate. Return True if any matching files were removed iis removing (RQtrangeR%tfilesRtTrue(R9t predicatetfoundR/((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyt _remove_filess&  cCsHgt|D]}tjj|s |^q }|j|t|S(s#Include files that match 'pattern'.(RRR tisdirtextendtbool(R9RRR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs1 cCst|}|j|jS(s#Exclude files that match 'pattern'.(R5Rtmatch(R9RR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs cCsftjj|d|}gt|dtD]}tjj|s+|^q+}|j|t|S(sN Include all files anywhere in 'dir/' that match the pattern. s**t recursive(RR RgRRRRR(R9RRt full_patternRR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs  cCs.ttjj|d|}|j|jS(sM Exclude any file anywhere in 'dir/' that match the pattern. s**(R5RR RgRR(R9RRR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRscCsOgt|D]%}tjj|D] }|^q#q }|j|t|S(sInclude all files from 'dir/'.(RR`RtfindallRR(R9Rt match_dirtitemR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs % cCs+ttjj|d}|j|jS(sFilter out files from 'dir/'.s**(R5RR RgRR(R9RR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRscCsy|jdkr|jnttjjd|}g|jD]}|j|rA|^qA}|j|t |S(s Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. s**N( tallfilesRGRR5RR RgRRR(R9RRRR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs  + cCs+ttjjd|}|j|jS(sD Exclude all files anywhere that match the pattern. s**(R5RR RgRR(R9RR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRscCsN|jdr|d }nt|}|j|rJ|jj|ndS(Ns i(R=Rt _safe_pathRtappend(R9RR ((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs   cCs |jjt|j|dS(N(RRtfilterR(R9tpaths((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRscCs"tt|j|j|_dS(s Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N(R^RRR(R9((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyt_repairscCsd}tj|}|dkr6tjd|tStj|d}|dkrktj||dtSy,tjj |stjj |rt SWn*t k rtj||t j nXdS(Ns!'%s' not %s encodable -- skippings''%s' in unexpected encoding -- skippingsutf-8(t unicode_utilstfilesys_decodeRGRRwRQt try_encodeRR RvRtUnicodeEncodeErrortsystgetfilesystemencoding(R9R tenc_warntu_patht utf8_path((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs  $ (RERFRRRRRRRRRRRRRR(((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRBs I        RcBseeZdZdZdZdZdZdZdZe dZ dZ d Z RS( s MANIFEST.incCs(d|_d|_d|_d|_dS(Ni(t use_defaultsRt manifest_onlytforce_manifest(R9((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRS s   cCsdS(N((R9((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRtscCst|_tjj|js.|jn|jtjj|jrZ|j n|j |jj |jj |jdS(N( RRRR RvRtwrite_manifestt add_defaultsttemplatet read_templatetprune_file_listtsorttremove_duplicates(R9((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs       cCs"tj|}|jtjdS(Nt/(RRtreplaceRR!(R9R ((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyt_manifest_normalizescCsb|jjg|jjD]}|j|^q}d|j}|jt|j|f|dS(so Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. swriting manifest file '%s'N(RRRRRtexecuteRu(R9RRtmsg((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyR"s ( cCs&|j|s"tj||ndS(N(t_should_suppress_warningRRw(R9R((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRw.scCstjd|S(s; suppress missing-file warnings from sdist sstandard file .*not found(R"R(R((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyR2scCstj||j|jj|j|jj|jtt}|re|jj |n"t j j |jr|j nt j j dr|jjdn|jd}|jj|jdS(Nssetup.pyRI(RRt check_licenseRRRRR^RRRR Rvt read_manifesttget_finalized_commandRRI(R9trcfilestei_cmd((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyR9s   cCsy|jd}|jj}|jj|j|jj|tjtj }|jj d|d|dddS(Ntbuilds(^|s)(RCS|CVS|\.svn)tis_regexi( RR7t get_fullnameRRt build_baseR"R#RR!texclude_pattern(R9Rtbase_dirR!((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRLs( RERFRRSRtRRRRwt staticmethodRRR(((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs     cCsGdj|}|jd}t|d}|j|WdQXdS(s{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. s sutf-8R}N(RgRRR(RYtcontentsR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRuVscCstjd||js|jj}|j|j|_}|j|j|_}z|j |j Wd|||_|_Xt |jdd}t j|j |ndS(Ns writing %stzip_safe(RR~RR7RiRPR>ROR:twrite_pkg_infoRItgetattrRGR twrite_safety_flag(tcmdtbasenameRYRitoldvertoldnametsafe((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRcs  cCs&tjj|r"tjdndS(NssWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.(RR RvRRw(RRRY((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytwarn_depends_obsoletevscCs;t|p d}d}t||}|j|dS(NcSs|dS(Ns ((R((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytR((RRt writelines(tstreamtreqstlinest append_cr((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyt_write_requirements~s cCs|j}tj}t||j|jp1i}x>t|D]0}|jdjt t|||qAW|j d||j dS(Ns [{extra}] t requirements( R7RtStringIORtinstall_requirestextras_requiretsortedRtformattvarsR|tgetvalue(RRRYtdistRzRtextra((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytwrite_requirementss  cCs<tj}t||jj|jd||jdS(Nssetup-requirements(tioRRR7tsetup_requiresR|R(RRRYRz((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytwrite_setup_requirementss cCsetjg|jjD]}|jddd^q}|jd|djt|ddS(Nt.iistop-level namess (RXtfromkeysR7titer_distribution_namesRRuRgR(RRRYtktpkgs((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytwrite_toplevel_namess2cCst|||tdS(N(t write_argR(RRRY((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyt overwrite_argscCsgtjj|d}t|j|d}|dk rMdj|d}n|j||||dS(Nis (RR tsplitextRR7RGRgR|(RRRYR{targnameRU((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs  cCs|jj}t|tjs*|dkr3|}n|dk rg}xt|jD]n\}}t|tjstj ||}dj tt t |j }n|jd||fqXWdj |}n|jd||tdS(Ns s [%s] %s Rs entry points(R7t entry_pointsR\Rt string_typesRGRtitemsRt parse_groupRgRtstrtvaluesRR|R(RRRYRRztsectionR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyt write_entriess   'cCs}tjdttjjdrytjdC}x9|D]1}tj d|}|r;t |j dSq;WWdQXndS(sd Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. s$get_pkg_info_revision is deprecated.sPKG-INFOsVersion:.*-r(\d+)\s*$iNi( twarningsRwtEggInfoDeprecationWarningRR RvRRR"Rtinttgroup(RRR((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytget_pkg_info_revisions  RcBseZdZRS(sqClass for warning about deprecations in eggInfo in setupTools. Not ignored by default, unlike DeprecationWarning.(RERFt__doc__(((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pyRs((>R tdistutils.filelistRt _FileListtdistutils.errorsRtdistutils.utilRR`RRR"RRRRBRVtsetuptools.externRtsetuptools.extern.six.movesRt setuptoolsRtsetuptools.command.sdistRRtsetuptools.command.setoptR tsetuptools.commandR t pkg_resourcesR R R RRRRRtsetuptools.unicode_utilsRtsetuptools.globRRRR5R6RIRRuRRRRRRRRQRRRR(((sA/tmp/pip-install-vZZv26/setuptools/setuptools/command/egg_info.pytsT         : SP