Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B

cÞqægã@s
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddlZej d¡r ddlmmmmZnejejZyeZWnek
rÌdZYnXeZddlm Z ddlm!Z!ddd	d
gZ"d-dd„Z#ej$d.d
d„ƒZ%ej$dd„ƒZ&ej$dd„ƒZ'ej$dd„ƒZ(Gdd„de)ƒZ*Gdd„dƒZ+ej$dd„ƒZ,dd„Z-ej$dd„ƒZ.ej$dd „ƒZ/d!d"„Z0d#d$„Z1d%d
„Z2Gd&d„dƒZ3e4ed'ƒrÆej5gZ6ngZ6Gd(d„de3ƒZ7e 8ej9d)d*„d+ :¡Dƒ¡Z;Gd,d	„d	e ƒZ<dS)/éN)Úsix)ÚbuiltinsÚmapÚjava)ÚDistutilsError)Úworking_setÚAbstractSandboxÚDirectorySandboxÚSandboxViolationÚ	run_setupc	CsJd}t||ƒ}| ¡}WdQRX|dkr.|}t||dƒ}t|||ƒdS)z.
    Python 3 implementation of execfile.
    ÚrbNÚexec)ÚopenÚreadÚcompiler
)ÚfilenameÚglobalsÚlocalsÚmodeÚstreamÚscriptÚcode©rú:/tmp/pip-install-8f6s0m28/setuptools/setuptools/sandbox.pyÚ	_execfile#src
csDtjdd…}|dk	r$|tjdd…<z
|VWd|tjdd…<XdS)N)ÚsysÚargv)ÚreplÚsavedrrrÚ	save_argv0s
rc
cs.tjdd…}z
|VWd|tjdd…<XdS)N)rÚpath)rrrrÚ	save_path;s
r!ccs4tjj|ddtj}|t_z
dVWd|t_XdS)zL
    Monkey-patch tempfile.tempdir with replacement, ensuring it exists
    T)Úexist_okN)Ú
pkg_resourcesÚ
py31compatÚmakedirsÚtempfileÚtempdir)ÚreplacementrrrrÚ
override_tempDs
r)c	cs.t ¡}t |¡z
|VWdt |¡XdS)N)ÚosÚgetcwdÚchdir)ÚtargetrrrrÚpushdUs


r.c@seZdZdZedd„ƒZdS)ÚUnpickleableExceptionzP
    An exception representing another Exception that could not be pickled.
    c	CsJyt |¡t |¡fStk
rDddlm}| ||t|ƒƒ¡SXdS)z‰
        Always return a dumped (pickled) type and exc. If exc can't be pickled,
        wrap it in UnpickleableException first.
        r)r/N)ÚpickleÚdumpsÚ	ExceptionÚsetuptools.sandboxr/ÚdumpÚrepr)ÚtypeÚexcÚclsrrrr4ds
zUnpickleableException.dumpN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr4rrrrr/_sr/c@s(eZdZdZdd„Zdd„Zdd„ZdS)	ÚExceptionSaverz^
    A Context Manager that will save an exception, serialized, and restore it
    later.
    cCs|S)Nr)ÚselfrrrÚ	__enter__xszExceptionSaver.__enter__cCs |sdSt ||¡|_||_dS)NT)r/r4Ú_savedÚ_tb)r?r6r7ÚtbrrrÚ__exit__{s
zExceptionSaver.__exit__cCs6dt|ƒkrdSttj|jƒ\}}t |||j¡dS)z"restore and re-raise any exceptionrAN)Úvarsrr0ÚloadsrArÚreraiserB)r?r6r7rrrÚresume†szExceptionSaver.resumeN)r9r:r;r<r@rDrHrrrrr>rsr>c	#sVtj ¡‰tƒ}ˆVWdQRXtj ˆ¡‡fdd„tjDƒ}t|ƒ| ¡dS)z 
    Context in which imported modules are saved.

    Translates exceptions internal to the context into the equivalent exception
    outside the context.
    Nc3s$|]}|ˆkr| d¡s|VqdS)z
encodings.N)Ú
startswith)Ú.0Úmod_name)rrrú	<genexpr>Ÿszsave_modules.<locals>.<genexpr>)rÚmodulesÚcopyr>ÚupdateÚ_clear_modulesrH)Ú	saved_excZdel_modulesr)rrÚsave_moduless
rRcCsxt|ƒD]}tj|=q
WdS)N)ÚlistrrM)Zmodule_namesrKrrrrP©srPc	cs$t ¡}z
|VWdt |¡XdS)N)r#Ú__getstate__Ú__setstate__)rrrrÚsave_pkg_resources_state®s
rVccs–tj |d¡}tƒxtƒftƒtƒNtƒ<t|ƒ(t	|ƒt
dƒdVWdQRXWdQRXWdQRXWdQRXWdQRXWdQRXdS)NÚtempÚ
setuptools)r*r ÚjoinrVrRÚhide_setuptoolsr!rr)r.Ú
__import__)Ú	setup_dirÚtemp_dirrrrÚ
setup_context·s

r^cCst d¡}t| |¡ƒS)aH
    >>> _needs_hiding('setuptools')
    True
    >>> _needs_hiding('pkg_resources')
    True
    >>> _needs_hiding('setuptools_plugin')
    False
    >>> _needs_hiding('setuptools.__init__')
    True
    >>> _needs_hiding('distutils')
    True
    >>> _needs_hiding('os')
    False
    >>> _needs_hiding('Cython')
    True
    z1(setuptools|pkg_resources|distutils|Cython)(\.|$))ÚrerÚboolÚmatch)rKÚpatternrrrÚ
_needs_hidingÆs
rccCstttjƒ}t|ƒdS)a%
    Remove references to setuptools' modules from sys.modules to allow the
    invocation to import the most appropriate setuptools. This technique is
    necessary to avoid issues such as #315 where setuptools upgrading itself
    would fail to find a function declared in the metadata.
    N)ÚfilterrcrrMrP)rMrrrrZÛsrZcCsêtj tj |¡¡}t|ƒÄyˆ|gt|ƒtjdd…<tj d|¡t	 
¡t	j dd„¡t
|tƒrl|n| t ¡¡}t|ƒt|dd}t||ƒWdQRXWn4tk
rÚ}z|jrÊ|jdrʂWdd}~XYnXWdQRXdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs| ¡S)N)Úactivate)ÚdistrrrÚ<lambda>ïózrun_setup.<locals>.<lambda>Ú__main__)Ú__file__r9)r*r ÚabspathÚdirnamer^rSrrÚinsertrÚ__init__Ú	callbacksÚappendÚ
isinstanceÚstrÚencodeÚgetfilesystemencodingr	ÚdictrÚ
SystemExitÚargs)Zsetup_scriptrwr\Zdunder_fileÚnsÚvrrrræs

c@s.eZdZdZdZdd„Zdd„Zdd„Zd	d
„Zdd„Z	d
d„Z
x$dD]Zee
eƒrFe
eƒeƒe<qFWd$dd„Zer~edeƒZedeƒZx$dD]Zee
eƒrŽeeƒeƒe<qŽWdd„Zx$dD]Zee
eƒr¼eeƒeƒe<q¼Wdd„Zx$dD]Zee
eƒrêeeƒeƒe<qêWdd„Zdd„Zd d!„Zd"d#„ZdS)%rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcs‡fdd„ttƒDƒˆ_dS)Ncs$g|]}| d¡stˆ|ƒr|‘qS)Ú_)rIÚhasattr)rJÚname)r?rrú
<listcomp>sz,AbstractSandbox.__init__.<locals>.<listcomp>)ÚdirÚ_osÚ_attrs)r?r)r?rrnszAbstractSandbox.__init__cCs&x |jD]}tt|t||ƒƒqWdS)N)r€Úsetattrr*Úgetattr)r?Úsourcer|rrrÚ_copyszAbstractSandbox._copycCs(| |¡tr|jt_|jt_d|_dS)NT)r„Ú_filerÚfileÚ_openrÚ_active)r?rrrr@s

zAbstractSandbox.__enter__cCs$d|_trtt_tt_| t¡dS)NF)rˆr…rr†r‡rr„r)r?Úexc_typeÚ	exc_valueÚ	tracebackrrrrDs
zAbstractSandbox.__exit__c	Cs||ƒSQRXdS)zRun 'func' under os sandboxingNr)r?ÚfuncrrrÚrunszAbstractSandbox.runcsttˆƒ‰‡‡fdd„}|S)Ncs2|jr |jˆ||f|ž|Ž\}}ˆ||f|ž|ŽS)N)rˆÚ_remap_pair)r?ÚsrcÚdstrwÚkw)r|ÚoriginalrrÚwrap&sz3AbstractSandbox._mk_dual_path_wrapper.<locals>.wrap)r‚r)r|r“r)r|r’rÚ_mk_dual_path_wrapper#s
z%AbstractSandbox._mk_dual_path_wrapper)ÚrenameÚlinkÚsymlinkNcs ˆpttˆƒ‰‡‡fdd„}|S)Ncs*|jr|jˆ|f|ž|Ž}ˆ|f|ž|ŽS)N)rˆÚ_remap_input)r?r rwr‘)r|r’rrr“4sz5AbstractSandbox._mk_single_path_wrapper.<locals>.wrap)r‚r)r|r’r“r)r|r’rÚ_mk_single_path_wrapper1sz'AbstractSandbox._mk_single_path_wrapperr†r)ÚstatÚlistdirr,rÚchmodÚchownÚmkdirÚremoveÚunlinkÚrmdirÚutimeÚlchownÚchrootÚlstatZ	startfileÚmkfifoÚmknodÚpathconfÚaccesscsttˆƒ‰‡‡fdd„}|S)NcsB|jr2|jˆ|f|ž|Ž}| ˆˆ|f|ž|Ž¡Sˆ|f|ž|ŽS)N)rˆr˜Ú
_remap_output)r?r rwr‘)r|r’rrr“Isz4AbstractSandbox._mk_single_with_return.<locals>.wrap)r‚r)r|r“r)r|r’rÚ_mk_single_with_returnFs
z&AbstractSandbox._mk_single_with_return)ÚreadlinkÚtempnamcsttˆƒ‰‡‡fdd„}|S)Ncs ˆ||Ž}|jr| ˆ|¡S|S)N)rˆrª)r?rwr‘Úretval)r|r’rrr“Xs
z'AbstractSandbox._mk_query.<locals>.wrap)r‚r)r|r“r)r|r’rÚ	_mk_queryUs
zAbstractSandbox._mk_query)r+ÚtmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r?r rrrÚ_validate_pathdszAbstractSandbox._validate_pathcOs
| |¡S)zCalled for path inputs)r±)r?Ú	operationr rwr‘rrrr˜hszAbstractSandbox._remap_inputcCs
| |¡S)zCalled for path outputs)r±)r?r²r rrrrªlszAbstractSandbox._remap_outputcOs0|j|d|f|ž|Ž|j|d|f|ž|ŽfS)z?Called for path pairs like rename, link, and symlink operationsz-fromz-to)r˜)r?r²rrrwr‘rrrrŽpszAbstractSandbox._remap_pair)N)r9r:r;r<rˆrnr„r@rDrr”r|r{rrr™r…r‡r«r¯r±r˜rªrŽrrrrrs<












Údevnullc@s˜eZdZdZe dddddddd	d
ddd
dg
¡ZdgZefdd„Z	dd„Z
erXd'dd„Zd(dd„Zdd„Z
dd„Zdd„Zdd „Zd!d"„Zd)d$d%„Zd&S)*r	z<Restrict operations to a single subdirectory - pseudo-chrootrrœrržrŸr r¡r¢r£r¤r¦r§r­z.*lib2to3.*\.pickle$cCsFtj tj |¡¡|_tj |jd¡|_dd„|Dƒ|_t 	|¡dS)NÚcSs g|]}tj tj |¡¡‘qSr)r*r ÚnormcaseÚrealpath)rJr rrrr}sz-DirectorySandbox.__init__.<locals>.<listcomp>)
r*r rµr¶Ú_sandboxrYÚ_prefixÚ_exceptionsrrn)r?ZsandboxÚ
exceptionsrrrrnŒs

zDirectorySandbox.__init__cOsddlm}||||ƒ‚dS)Nr)r
)r3r
)r?r²rwr‘r
rrrÚ
_violation•szDirectorySandbox._violationÚrcOs:|dkr(| |¡s(|jd||f|ž|Žt||f|ž|ŽS)N)r¼ÚrtrÚrUÚUr†)Ú_okr»r…)r?r rrwr‘rrrr…›szDirectorySandbox._filecOs:|dkr(| |¡s(|jd||f|ž|Žt||f|ž|ŽS)N)r¼r½rr¾r¿r)rÀr»r‡)r?r rrwr‘rrrr‡ szDirectorySandbox._opencCs| d¡dS)Nr°)r»)r?rrrr°¥szDirectorySandbox.tmpnamcCsN|j}z:d|_tj tj |¡¡}| |¡p@||jkp@| |j¡S||_XdS)NF)	rˆr*r rµr¶Ú	_exemptedr·rIr¸)r?r Úactiver¶rrrrÀ¨s

zDirectorySandbox._okcs<‡fdd„|jDƒ}‡fdd„|jDƒ}t ||¡}t|ƒS)Nc3s|]}ˆ |¡VqdS)N)rI)rJÚ	exception)ÚfilepathrrrL·sz-DirectorySandbox._exempted.<locals>.<genexpr>c3s|]}t |ˆ¡VqdS)N)r_ra)rJrb)rÄrrrL»s)r¹Ú_exception_patternsÚ	itertoolsÚchainÚany)r?rÄZ
start_matchesZpattern_matchesÚ
candidatesr)rÄrrÁµs



zDirectorySandbox._exemptedcOs4||jkr0| |¡s0|j|tj |¡f|ž|Ž|S)zCalled for path inputs)Ú	write_opsrÀr»r*r r¶)r?r²r rwr‘rrrr˜ÁszDirectorySandbox._remap_inputcOs2| |¡r| |¡s*|j|||f|ž|Ž||fS)z?Called for path pairs like rename, link, and symlink operations)rÀr»)r?r²rrrwr‘rrrrŽÇszDirectorySandbox._remap_pairéÿcOs@|t@r*| |¡s*|jd|||f|ž|Žtj|||f|ž|ŽS)zCalled for low-level os.open()zos.open)ÚWRITE_FLAGSrÀr»rr)r?r†Úflagsrrwr‘rrrrÍszDirectorySandbox.openN)r¼)r¼)rË)r9r:r;r<ruÚfromkeysrÊrÅÚ_EXCEPTIONSrnr»r…r‡r°rÀrÁr˜rŽrrrrrr	~s 	


cCsg|]}tt|dƒ‘qS)r)r‚r)rJÚarrrr}Õsr}z4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZe d¡ ¡Zdd„ZdS)r
zEA setup script attempted to modify the filesystem outside the sandboxa
        SandboxViolation: {cmd}{args!r} {kwargs}

        The package setup script has attempted to modify files on your system
        that are not within the EasyInstall build area, and has been aborted.

        This package cannot be safely installed by EasyInstall, and may not
        support alternate installation locations even if you run its setup
        script by hand.  Please inform the package's author and the EasyInstall
        maintainers to find out if a fix or workaround is available.
        cCs|j\}}}|jjftƒŽS)N)rwÚtmplÚformatr)r?ÚcmdrwÚkwargsrrrÚ__str__észSandboxViolation.__str__N)	r9r:r;r<ÚtextwrapÚdedentÚlstriprÑrÕrrrrr
Ús

)N)N)=r*rr&ÚoperatorÚ	functoolsrÆr_Ú
contextlibr0rÖZsetuptools.externrZsetuptools.extern.six.movesrrZpkg_resources.py31compatr#ÚplatformrIZ$org.python.modules.posix.PosixModuleÚpythonrMÚposixZPosixModulerr|r†r…Ú	NameErrorrr‡Zdistutils.errorsrrÚ__all__rÚcontextmanagerrr!r)r.r2r/r>rRrPrVr^rcrZrrr{r³rÏr	ÚreduceÚor_ÚsplitrÌr
rrrrÚ<module>s^ 



	
	w
V