ó ž­ēSc@s®dZddlmZddlmZddlmZddlZddl Z ddl Z ddl Z ddl m Z ddlmZddlmZmZmZdd l mZdd lmZdd lmZmZmZmZmZmZmZmZddlj Z d e fd „ƒYZ!defd„ƒYZdefd„ƒYZ"d„Z#d„Z$d„Z%d„Z&d„Z'd„Z(d„Z)e*d„Z+d„Z,d„Z-dS(sUsetuptools.command.egg_info Create a distribution's .egg-info directory and contentsi’’’’(tFileList(t convert_path(tlogN(tCommand(tsdist(t basestringtPY3tStringIO(t svn_utils(t walk_revctrl(tparse_requirementst safe_namet parse_versiont safe_versiont yield_linest EntryPointtiter_entry_pointst to_filenametegg_infocBs»eZdZdd d!d"d#d$gZddgZidd 6dd6Zd„Zd„Zd„Ze d„Z d„Z d„Z d„Z d„Zd„Zed„ƒZd„Zd„ZRS(%s+create a distribution's .egg-info directorys egg-base=tesLdirectory containing .egg-info directories (default: top of the source tree)stag-svn-revisiontrs,Add subversion revision ID to version numberstag-datetds0Add date stamp (e.g. 20050528) to version numbers tag-build=tbs-Specify explicit tag to add to version numbersno-svn-revisiontRs*Don't add subversion revision ID [default]sno-datetDs"Don't include date stamp [default]cCsUd|_d|_d|_d|_d|_d|_d|_t|_ d|_ dS(Ni( tNonetegg_namet egg_versiontegg_baseRt tag_buildttag_svn_revisionttag_datetFalsetbroken_egg_infotvtags(tself((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytinitialize_options+s        c CsKddlm}tdtddddd|jƒƒƒ}|||ƒdS(Ni’’’’(t edit_configRRiRR(tsetuptools.command.setoptR%tdictttags(R#tfilenameR%tvalues((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytsave_version_info6scCs±t|jjƒƒ|_|jƒ|_|jƒ|_y$tt d|j|jfƒƒWn3t k rt j j d|j|jfƒ‚nX|jdkrĢ|jj}|p“ijdtjƒ|_n|jdƒt|jƒd|_|jtjkr"tjj|j|jƒ|_nd|jkr>|jƒn|j|jj_|jj}|dk r­|j|jjƒkr­|j|_t |jƒ|_!d|j_ndS(Ns%s==%ss2Invalid distribution name or version syntax: %s-%stRs .egg-infot-("R t distributiontget_nameRR(R"ttagged_versionRtlistR t ValueErrort distutilsterrorstDistutilsOptionErrorRRt package_dirtgettostcurdirtensure_dirnameRRtpathtjointcheck_broken_egg_infotmetadatatversiont _patched_disttkeytlowert_versionR t_parsed_version(R#tdirstpd((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytfinalize_optionsBs4    ! !  $ cCsl|r|j|||ƒnLtjj|ƒrh|dkrX| rXtjd||ƒdS|j|ƒndS(s¹Write `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_fileR8R;texistsRRtwarnt delete_file(R#twhatR)tdatatforce((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_or_delete_filels  cCsatjd||ƒtr+|jdƒ}n|js]t|dƒ}|j|ƒ|jƒndS(sŖWrite `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(RtinfoRtencodetdry_runtopentwritetclose(R#RLR)RMtf((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRH€s  cCs-tjd|ƒ|js)tj|ƒndS(s8Delete `filename` (if not a dry run) after announcing its deleting %sN(RRQRSR8tunlink(R#R)((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRKŽs cCsE|jjƒ}|jr4|j|jƒr4t|ƒSt||jƒS(N(R.t get_versionR"tendswithR (R#R?((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR0”s cCsµ|j|jƒ|jj}xNtdƒD]@}|jd|ƒ}|||jtjj |j|jƒƒq)Wtjj |jdƒ}tjj |ƒr§|j |ƒn|j ƒdS(Nsegg_info.writerst installersnative_libs.txt( tmkpathRR.tfetch_build_eggRtloadtnameR8R;R<RIRKt find_sources(R#R[teptwritertnl((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytrunœs ,cCs}d}|jr||j7}n|jrN|jƒ}|rN|d|7}qNn|jryddl}||jdƒ7}n|S(NR,s-r%si’’’’s-%Y%m%d(RRtget_svn_revisionRttimetstrftime(R#R?trevRf((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR(Ŗs     cCsttjjtjƒjƒƒS(N(tstrRtSvnInfoR^R8R9t get_revision(((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyReøscCsJtjj|jdƒ}t|jƒ}||_|jƒ|j|_dS(s"Generate SOURCES.txt manifest files SOURCES.txtN( R8R;R<Rtmanifest_makerR.tmanifestRdtfilelist(R#tmanifest_filenametmm((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR`¼s   cCsŽ|jd}|jtjkr:tjj|j|ƒ}ntjj|ƒrŠtjddddd||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. ( RRR8R9R;R<RIRRJRR!(R#tbei((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR=Äs   (s egg-base=RsLdirectory containing .egg-info directories (default: top of the source tree)(stag-svn-revisionRs,Add subversion revision ID to version number(stag-dateRs0Add date stamp (e.g. 20050528) to version number(s tag-build=Rs-Specify explicit tag to add to version number(sno-svn-revisionRs*Don't add subversion revision ID [default](sno-dateRs"Don't include date stamp [default](t__name__t __module__t descriptiont user_optionstboolean_optionst negative_optR$R+RGR RORHRKR0RdR(t staticmethodReR`R=(((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs0     *       RcBs2eZdZd„Zd„Zd„Zd„ZRS(s@File list that accepts only existing, platform-independent pathscCsN|jdƒr|d }nt|ƒ}|j|ƒrJ|jj|ƒndS(Ns i’’’’(RZRt _safe_pathtfilestappend(R#titemR;((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR{×s   cCs |jjt|j|ƒƒdS(N(RztextendtfilterRy(R#tpaths((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR}ßscCs"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(R1R~RyRz(R#((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_repairāscCsČd}tj|ƒ}|dkr6tjd|ƒtStj|dƒ}|dkrktj||dƒtSy,tjj |ƒs’tjj |ƒr–t SWn*t k rĆtj||t j ƒƒnXdS(Ns!'%s' not %s encodable -- skippings''%s' in unexpected encoding -- skippingsutf-8(t unicode_utilstfilesys_decodeRRRJR t try_encodeR8R;RItTruetUnicodeEncodeErrortsystgetfilesystemencoding(R#R;tenc_warntu_patht utf8_path((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRyģs  $ (RrRst__doc__R{R}R€Ry(((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRŌs    RlcBsVeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( s MANIFEST.incCs(d|_d|_d|_d|_dS(Ni(t use_defaultstprunet manifest_onlytforce_manifest(R#((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR$s   cCsdS(N((R#((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRG scCs™tƒ|_tjj|jƒs.|jƒn|jjƒ|jƒtjj|j ƒrg|j ƒn|j ƒ|jj ƒ|jj ƒ|jƒdS(N(RRnR8R;RIRmtwrite_manifesttfindallt add_defaultsttemplatet read_templatetprune_file_listtsorttremove_duplicates(R#((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRds        cCs"tj|ƒ}|jtjdƒS(Nt/(RR‚treplaceR8tsep(R#R;((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_manifest_normalizescCsb|jjƒg|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(RnR€RzR›RmtexecuteRH(R#RWRztmsg((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR!s ( cCs&|jdƒs"tj||ƒndS(Nsstandard file not found:(t startswithRRJ(R#R((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRJ-scCs©tj|ƒ|jj|jƒ|jj|jƒttƒƒ}|r[|jj|ƒn"t j j |jƒr}|j ƒn|j dƒ}|jjdd|jƒdS(NRt*tprefix(RR’RnR{R“RmR1R R}R8R;RIt read_manifesttget_finalized_commandtinclude_patternR(R#trcfilestei_cmd((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR’1s  cCs…|jdƒ}|jjƒ}|jjdd|jƒ|jjdd|ƒtjt j ƒ}|jjd|d|ddƒdS(NtbuildR s(^|s)(RCS|CVS|\.svn)tis_regexi( R¢R.t get_fullnameRntexclude_patternRt build_basetretescapeR8Rš(R#R¦tbase_dirRš((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR•=s( RrRsR“R$RGRdR›RRJR’R•(((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRls     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-8RPN(R<RRRTRU(R)tcontentsRW((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRHGscCs»tjd|ƒ|js·|jj}|j|j|_}|j|j|_}z|j |j ƒWd|||_|_Xt |jddƒ}ddl m}|j|j |ƒndS(Ns writing %stzip_safei’’’’(t bdist_egg(RRQRSR.R>RR?RR_twrite_pkg_infoRtgetattrRtsetuptools.commandR°twrite_safety_flag(tcmdtbasenameR)R>toldvertoldnametsafeR°((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyR±Ts  cCs&tjj|ƒr"tjdƒndS(NssWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.(R8R;RIRRJ(RµR¶R)((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytwarn_depends_obsoletegscCs;t|p dƒ}d„}t||ƒ}|j|ƒdS(NcSs|dS(Ns ((tline((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytqs((Rtmapt writelines(tstreamtreqstlinest append_cr((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_write_requirementsos cCs|j}tƒ}t||jƒ|jp.i}x>t|ƒD]0}|jdjtƒƒt|||ƒq>W|j d||j ƒƒdS(Ns [{extra}] t requirements( R.RRĆtinstall_requirestextras_requiretsortedRUtformattvarsROtgetvalue(RµR¶R)tdistRMRĘtextra((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_requirementsvs  cCs_tjg|jjƒD]}|jddƒd^qƒ}|jd|dj|ƒdƒdS(Nt.iistop-level namess (R'tfromkeysR.titer_distribution_namestsplitRHR<(RµR¶R)tktpkgs((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_toplevel_namess2cCst|||tƒdS(N(t write_argR„(RµR¶R)((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyt overwrite_arg‹scCsgtjj|ƒd}t|j|dƒ}|dk rMdj|ƒd}n|j||||ƒdS(Nis (R8R;tsplitextR²R.RR<RO(RµR¶R)RNtargnametvalue((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyRՏs  cCsš|jj}t|tƒs'|dkr0|}n¦|dk rÖg}xt|jƒƒD]k\}}t|tƒs©tj||ƒ}dj tt t |j ƒƒƒƒ}n|j d||fƒqUWdj |ƒ}n|jd||tƒdS(Ns s [%s] %s R,s entry points(R.t entry_pointst isinstanceRRRĒtitemsRt parse_groupR<R½RiR*R{ROR„(RµR¶R)RaRMtsectionR®((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyt write_entries—s   'cCsntjjdƒrjtddƒ}x9|D]1}tjd|ƒ}|r(t|jdƒƒSq(W|jƒndS(NsPKG-INFOtrUsVersion:.*-r(\d+)\s*$ii( R8R;RIRTR«tmatchtinttgroupRV(RWR»Rį((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pytget_pkg_info_revisionØs  (.R‹tdistutils.filelistRt _FileListtdistutils.utilRR3Rtdistutils.errorsR8R«R†t setuptoolsRtsetuptools.command.sdistRtsetuptools.compatRRRRR t pkg_resourcesR R R R RRRRtsetuptools.unicode_utilsRRRlRHR±RŗRĆRĶRŌRÖR RÕRßRä(((sE/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.pyts6    :¼0C