Viewing File: /usr/lib/python3.6/site-packages/setuptools/command/__pycache__/egg_info.cpython-36.opt-1.pyc

3

Xoh`@sdZddlmZddlmZddlmZddlm	Z	ddlZddlZddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'j(Z(ddl)m*Z*ddlm+Z+ddZ,GdddeZ-GdddeZGdddeZ.ddZ/ddZ0ddZ1dd Z2d!d"Z3d#d$Z4d%d&Z5d'd(Z6d0d*d+Z7d,d-Z8d.d/Z9dS)1zUsetuptools.command.egg_info

Create a distribution's .egg-info directory and contents)FileList)DistutilsInternalError)convert_path)logN)six)map)Command)sdist)walk_revctrl)edit_config)	bdist_egg)parse_requirements	safe_name
parse_versionsafe_versionyield_lines
EntryPointiter_entry_pointsto_filename)glob)	packagingcCsd}|jtjj}tjtj}d|f}xt|D]\}}|t|dk}|dkrv|rd|d7}q4|d||f7}q4d}t|}	x:||	kr||}
|
dkr||d7}n|
d	kr||7}n|
d
kr|d}||	kr||dkr|d}||	kr||dkr|d}x&||	kr6||dkr6|d}qW||	krR|tj|
7}nR||d|}d}
|ddkrd
}
|dd}|
tj|7}
|d|
f7}|}n|tj|
7}|d7}qW|s4||7}q4W|d7}tj|tj	tj
BdS)z
    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.
    z[^%s]z**z.*z
(?:%s+%s)*r*?[!]^Nz[%s]z\Z)flags)splitospathsepreescape	enumeratelencompile	MULTILINEDOTALL)rZpatZchunksr#Z
valid_charcchunkZ
last_chunkiZ	chunk_lencharZinner_iinnerZ
char_classr0/usr/lib/python3.6/egg_info.pytranslate_pattern$sV




r2c@seZdZdZd)d*d+d,gZdgZddiZddZeddZ	e	j
ddZ	ddZddZd-ddZ
ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(S).egg_infoz+create a distribution's .egg-info directory	egg-base=eLdirectory containing .egg-info directories (default: top of the source tree)tag-dated0Add date stamp (e.g. 20050528) to version number
tag-build=b-Specify explicit tag to add to version numberno-dateD"Don't include date stamp [default]cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrF)egg_nameegg_versionegg_baser3	tag_buildtag_datebroken_egg_infovtags)selfr0r0r1initialize_optionsszegg_info.initialize_optionscCsdS)Nr0)rGr0r0r1tag_svn_revisionszegg_info.tag_svn_revisioncCsdS)Nr0)rGvaluer0r0r1rIscCs0tj}|j|d<d|d<t|t|ddS)z
        Materialize the value of date into the
        build tag. Install build keys in a deterministic order
        to avoid arbitrary reordering on subsequent builds.
        rCrrD)r3N)collectionsOrderedDicttagsrdict)rGfilenamer3r0r0r1save_version_infoszegg_info.save_version_infocCsVt|jj|_|j|_|j|_t|j}y6t	|t
jj}|rFdnd}t
t||j|jfWn,tk
rtjjd|j|jfYnX|jdkr|jj}|pijdtj|_|jdt|jd|_|jtjkrtjj|j|j|_d|jkr|j|j|jj_|jj}|dk	rR|j |jj!krR|j|_"t|j|_#d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrBz	.egg-info-)$rdistributionZget_namer@rMrFtagged_versionrAr
isinstancerversionZVersionlistr

ValueError	distutilserrorsZDistutilsOptionErrorrBZpackage_dirgetr!curdirZensure_dirnamerr3r"joincheck_broken_egg_infometadataZ
_patched_distkeylowerZ_versionZ_parsed_version)rGZparsed_versionZ
is_versionspecdirsZpdr0r0r1finalize_optionss8




zegg_info.finalize_optionsFcCsN|r|j|||n6tjj|rJ|dkr@|r@tjd||dS|j|dS)aWrite `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).
        Nz$%s not set in setup(), but %s exists)
write_filer!r"existsrwarndelete_file)rGwhatrOdataforcer0r0r1write_or_delete_files	
zegg_info.write_or_delete_filecCsDtjd||tjr|jd}|js@t|d}|j||jdS)zWrite `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.
        zwriting %s to %szutf-8wbN)	rinforZPY3encodedry_runopenwriteclose)rGrhrOrifr0r0r1rds


zegg_info.write_filecCs tjd||jstj|dS)z8Delete `filename` (if not a dry run) after announcing itzdeleting %sN)rrmror!unlink)rGrOr0r0r1rgszegg_info.delete_filecCs2|jj}|jr$|j|jr$t|St||jS)N)rRZget_versionrFendswithr)rGrUr0r0r1rSs
zegg_info.tagged_versioncCs|j|j|jj}x@tdD]4}|j|d|j}|||jtj	j
|j|jqWtj	j
|jd}tj	j|r||j||j
dS)Nzegg_info.writers)	installerznative_libs.txt)Zmkpathr3rRZfetch_build_eggrZrequireZresolvenamer!r"r\rergfind_sources)rGrvepwriternlr0r0r1run	s 
zegg_info.runcCs,d}|jr||j7}|jr(|tjd7}|S)Nrz-%Y%m%d)rCrDtimeZstrftime)rGrUr0r0r1rMs
z
egg_info.tagscCs4tjj|jd}t|j}||_|j|j|_dS)z"Generate SOURCES.txt manifest filezSOURCES.txtN)	r!r"r\r3manifest_makerrRmanifestr|filelist)rGZmanifest_filenameZmmr0r0r1rx s

zegg_info.find_sourcescCsd|jd}|jtjkr&tjj|j|}tjj|r`tjddddd||j	|j	|_
||_	dS)Nz	.egg-inforQNz
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.
)r@rBr!r[r"r\rerrfr3rE)rGZbeir0r0r1r](s

zegg_info.check_broken_egg_infoN)r4r5r6)r7r8r9)r:r;r<)r=r>r?)F)__name__
__module____qualname__descriptionZuser_optionsZboolean_optionsZnegative_optrHpropertyrIsetterrPrcrkrdrgrSr|rMrxr]r0r0r0r1r3ws(

/
r3c@s|eZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZdS)rcCs<|j|\}}}}|dkrV|jddj|x"|D]}|j|s4tjd|q4Wn|dkr|jddj|x"|D]}|j|sxtjd|qxWn|dkr|jd	dj|x"|D]}|j|stjd
|qWnZ|dkr(|jddj|x&|D]}|j|stjd
|qWn|dkrx|jd|dj|fx|D]"}|j	||sPtjd||qPWn|dkr|jd|dj|fx|D]"}|j
||stjd||qWnp|dkr|jd||j|s8tjd|n>|dkr,|jd||j|s8tjd|nt
d|dS)Nincludezinclude  z%warning: no files found matching '%s'excludezexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %sz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'graftzgraft z+warning: no directories found matching '%s'prunezprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')Z_parse_template_linedebug_printr\rrrfrglobal_includeglobal_excluderecursive_includerecursive_excluderrr)rGlineactionZpatternsdirZdir_patternpatternr0r0r1process_template_line;sd













zFileList.process_template_linecCsVd}xLtt|jdddD]2}||j|r|jd|j||j|=d}qW|S)z
        Remove all files from the file list that match the predicate.
        Return True if any matching files were removed
        Frz
 removing Tr)ranger'filesr)rGZ	predicatefoundr-r0r0r1
_remove_filesszFileList._remove_filescCs$ddt|D}|j|t|S)z#Include files that match 'pattern'.cSsg|]}tjj|s|qSr0)r!r"isdir).0rsr0r0r1
<listcomp>sz$FileList.include.<locals>.<listcomp>)rextendbool)rGrrr0r0r1rs
zFileList.includecCst|}|j|jS)z#Exclude files that match 'pattern'.)r2rmatch)rGrrr0r0r1rszFileList.excludecCs8tjj|d|}ddt|ddD}|j|t|S)zN
        Include all files anywhere in 'dir/' that match the pattern.
        z**cSsg|]}tjj|s|qSr0)r!r"r)rrsr0r0r1rsz.FileList.recursive_include.<locals>.<listcomp>T)	recursive)r!r"r\rrr)rGrrZfull_patternrr0r0r1rs
zFileList.recursive_includecCs ttjj|d|}|j|jS)zM
        Exclude any file anywhere in 'dir/' that match the pattern.
        z**)r2r!r"r\rr)rGrrrr0r0r1rszFileList.recursive_excludecCs$ddt|D}|j|t|S)zInclude all files from 'dir/'.cSs"g|]}tjj|D]}|qqSr0)rXrfindall)rZ	match_diritemr0r0r1rsz"FileList.graft.<locals>.<listcomp>)rrr)rGrrr0r0r1rs
zFileList.graftcCsttjj|d}|j|jS)zFilter out files from 'dir/'.z**)r2r!r"r\rr)rGrrr0r0r1rszFileList.prunecsJ|jdkr|jttjjd|fdd|jD}|j|t|S)z
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        Nz**csg|]}j|r|qSr0)r)rrs)rr0r1rsz+FileList.global_include.<locals>.<listcomp>)Zallfilesrr2r!r"r\rr)rGrrr0)rr1rs

zFileList.global_includecCsttjjd|}|j|jS)zD
        Exclude all files anywhere that match the pattern.
        z**)r2r!r"r\rr)rGrrr0r0r1rszFileList.global_excludecCs8|jdr|dd}t|}|j|r4|jj|dS)N
rr)rur
_safe_pathrappend)rGrr"r0r0r1rs


zFileList.appendcCs|jjt|j|dS)N)rrfilterr)rGpathsr0r0r1rszFileList.extendcCstt|j|j|_dS)z
        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)rVrrr)rGr0r0r1_repairszFileList._repaircCsd}tj|}|dkr(tjd|dStj|d}|dkrNtj||ddSy tjj|shtjj|rldSWn&tk
rtj||t	j
YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFzutf-8T)
unicode_utilsfilesys_decoderrfZ
try_encoder!r"reUnicodeEncodeErrorsysgetfilesystemencoding)rGr"Zenc_warnZu_pathZ	utf8_pathr0r0r1rs
zFileList._safe_pathN)rrrrrrrrrrrrrrrrrr0r0r0r1r8sI



rc@s\eZdZdZddZddZddZdd	Zd
dZdd
Z	e
ddZddZddZ
dS)r~zMANIFEST.incCsd|_d|_d|_d|_dS)Nr)Zuse_defaultsrZ
manifest_onlyZforce_manifest)rGr0r0r1rHsz!manifest_maker.initialize_optionscCsdS)Nr0)rGr0r0r1rcszmanifest_maker.finalize_optionscCsdt|_tjj|js|j|jtjj|jr<|j	|j
|jj|jj|jdS)N)
rrr!r"rerwrite_manifestadd_defaultstemplateZ
read_templateprune_file_listsortZremove_duplicates)rGr0r0r1r|s

zmanifest_maker.runcCstj|}|jtjdS)N/)rrreplacer!r#)rGr"r0r0r1_manifest_normalizes
z"manifest_maker._manifest_normalizecsBjjfddjjD}dj}jtj|f|dS)zo
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        csg|]}j|qSr0)r)rrs)rGr0r1r sz1manifest_maker.write_manifest.<locals>.<listcomp>zwriting manifest file '%s'N)rrrrZexecuterd)rGrmsgr0)rGr1rs

zmanifest_maker.write_manifestcCs|j|stj||dS)N)_should_suppress_warningr	rf)rGrr0r0r1rf$s
zmanifest_maker.warncCstjd|S)z;
        suppress missing-file warnings from sdist
        zstandard file .*not found)r$r)rr0r0r1r(sz'manifest_maker._should_suppress_warningcCsttj||jj|j|jj|jtt}|rB|jj|nt	j
j|jrX|j|j
d}|jj|jdS)Nr3)r	rrrrrrVr
rr!r"reZ
read_manifestget_finalized_commandrr3)rGZrcfilesZei_cmdr0r0r1r/s


zmanifest_maker.add_defaultscCsZ|jd}|jj}|jj|j|jj|tjtj	}|jj
d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex)rrRZget_fullnamerrZ
build_baser$r%r!r#Zexclude_pattern)rGrZbase_dirr#r0r0r1r;s

zmanifest_maker.prune_file_listN)rrrrrHrcr|rrrfstaticmethodrrrr0r0r0r1r~sr~c	Cs8dj|}|jd}t|d}|j|WdQRXdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    
zutf-8rlN)r\rnrprq)rOcontentsrsr0r0r1rdEs

rdcCs|tjd||jsx|jj}|j|j|_}|j|j|_}z|j	|j
Wd|||_|_Xt|jdd}tj
|j
|dS)Nz
writing %sZzip_safe)rrmrorRr^rArUr@rwwrite_pkg_infor3getattrrZwrite_safety_flag)cmdbasenamerOr^ZoldverZoldnameZsafer0r0r1rRsrcCstjj|rtjddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)r!r"rerrf)rrrOr0r0r1warn_depends_obsoleteesrcCs,t|pf}dd}t||}|j|dS)NcSs|dS)Nrr0)rr0r0r1<lambda>osz%_write_requirements.<locals>.<lambda>)rr
writelines)streamZreqslinesZ	append_crr0r0r1_write_requirementsms
rcCsn|j}tj}t||j|jp"i}x2t|D]&}|jdjft	t|||q.W|j
d||jdS)Nz
[{extra}]
Zrequirements)rRrStringIOrZinstall_requiresextras_requiresortedrqformatvarsrkgetvalue)rrrOZdistrirZextrar0r0r1write_requirementsts
rcCs,tj}t||jj|jd||jdS)Nzsetup-requirements)iorrrRZsetup_requiresrkr)rrrOrir0r0r1write_setup_requirementssrcCs:tjdd|jjD}|jd|djt|ddS)NcSsg|]}|jdddqS).rr)r )rkr0r0r1rsz(write_toplevel_names.<locals>.<listcomp>ztop-level namesr)rNfromkeysrRZiter_distribution_namesrdr\r)rrrOZpkgsr0r0r1write_toplevel_namessrcCst|||ddS)NT)	write_arg)rrrOr0r0r1
overwrite_argsrFcCsHtjj|d}t|j|d}|dk	r4dj|d}|j||||dS)Nrr)r!r"splitextrrRr\rk)rrrOrjZargnamerJr0r0r1rs
rcCs|jj}t|tjs|dkr"|}nr|dk	rg}xZt|jD]J\}}t|tjsttj||}dj	tt
t|j}|j
d||fq<Wdj	|}|jd||ddS)Nrz	[%s]
%s

rzentry pointsT)rRZentry_pointsrTrZstring_typesritemsrZparse_groupr\rstrvaluesrrk)rrrOryriZsectionrr0r0r1
write_entriess
rcCs^tjdttjjdrZtjd2}x*|D]"}tj	d|}|r*t
|jdSq*WWdQRXdS)zd
    Get a -r### off of PKG-INFO Version in case this is an sdist of
    a subversion revision.
    z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rNr)warningsrfDeprecationWarningr!r"rerrpr$rintgroup)rsrrr0r0r1get_pkg_info_revisions
r)F):__doc__Zdistutils.filelistrZ	_FileListZdistutils.errorsrZdistutils.utilrrXrr!r$rrrr}rKZsetuptools.externrZsetuptools.extern.six.movesrZ
setuptoolsrZsetuptools.command.sdistr	r
Zsetuptools.command.setoptrZsetuptools.commandrZ
pkg_resourcesr
rrrrrrrZsetuptools.unicode_utilsrZsetuptools.globrrr2r3r~rdrrrrrrrrrrr0r0r0r1<module>sR(
SBEI



Back to Directory File Manager