ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyc

�
x�_c@@sddlmZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZdd
lmZ ddl!m"Z#ddl$m%Z%ddl$m&Z'ddl(m)Z)ddl*m+Z+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAddlBmCZCddlDmEZEmFZFddlGmHZHddlImJZJddlKmLZLeHr�ddlMmNZNmOZOmPZPmQZQmRZRmSZSmTZTddlmUZUdd lVmWZWdd!lXmYZYdd"lZm[Z[nej\e]�Z^d#�Z_d$e`fd%��YZad&�ZbdS('i(tabsolute_importN(t
pkg_resourcestsix(tRequirement(tcanonicalize_name(tVersion(tparse(tPep517HookCaller(tNoOpBuildEnvironment(tInstallationError(t
get_scheme(tLink(tgenerate_metadata(tinstall_editable(tLegacyInstallFailure(tinstall(t
install_wheel(tload_pyproject_tomltmake_pyproject_path(tUninstallPathSet(t
deprecated(tdirect_url_from_link(tHashes(t
indent_log(
task_path_existst
backup_dirtdisplay_pathtdist_in_install_pathtdist_in_site_packagestdist_in_usersitetget_distributiontget_installed_versionthide_urltredact_auth_from_url(tget_metadata(t
TempDirectoryt
tempdir_kinds(tMYPY_CHECK_RUNNING(trunning_under_virtualenv(tvcs(tAnytDicttIterabletListtOptionaltSequencetUnion(tBuildEnvironment(tDistribution(tSpecifierSet(tMarkercC@s�|jtj�}tjj|�\}}tj||�}|jd�rmtj}tjj	|�d}nA|jd�s�t
�tj}tjj	|�djd�d}||d|d|�S(sQReturn a pkg_resources.Distribution for the provided
    metadata directory.
    s	.egg-infois
.dist-infot-tproject_nametmetadata(trstriptostseptpathtsplitRtPathMetadatatendswithR0tsplitexttAssertionErrortDistInfoDistribution(tmetadata_directorytdist_dirtbase_dirt
dist_dir_nameR5tdist_clst	dist_name((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt	_get_distEs		#tInstallRequirementcB@s�eZdZed!d!d!ed!d!d!ed"ed�Zd�Zd�Zd�Ze	d��Z
e	d��Ze	d��Ze	d��Z
d!d	�Ze	d
��Zed�Zd�Zd
�Zd�Zd�Zd�Ze	d��Ze	d��Ze	d��Ze	d��Zd�Zd�Zd�Ze	d��Zd�Zd�Z eed�Z!ed�Z"eed�Z#d�Z$d�Z%d!d!d!d!eeed �Z&RS(#s�
    Represents something that may be installed later on, may have information
    about where to fetch the relevant requirement and also contains logic for
    installing the said requirement.
    cC@sC|dks't|t�s't|��||_||_||_||_d|_d|_	|jr�|srt�|j
r�tjj
tjj|j��|_	q�n|dkr�|r�|jr�t|j�}n||_|_t|_d|_|jr|jj
r|jj|_n|r-||_n+|rLd�|jD�|_nt�|_|dkrv|rv|j}n||_d|_t|_d|_d|_|r�|ng|_|	r�|	ng|_ |
r�|
ni|_!t|_"|
|_#t|_$||_%t&�|_'d|_(d|_)g|_*d|_+||_,dS(NcS@sh|]}tj|��qS((Rt
safe_extra(t.0textra((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pys	<setcomp>�s	(-tNonet
isinstanceRR>treqt
comes_fromt
constraintteditabletlegacy_install_reasont
source_dirtis_fileR7R9tnormpathtabspatht	file_pathturlRtlinkt
original_linktFalsetoriginal_link_is_in_wheel_cachetlocal_file_pathtextrastsettmarkertmarkerstsatisfied_bytshould_reinstallt_temp_build_dirtinstall_succeededtinstall_optionstglobal_optionsthash_optionstpreparedt
user_suppliedtsuccessfully_downloadedtisolatedRt	build_envR@tpyproject_requirestrequirements_to_checktpep517_backendt
use_pep517(tselfRMRNRPRXR`RpRkReRfRgROR]Ri((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt__init__gsX'									!																cC@s�|jrFt|j�}|jrj|djt|jj��7}qjn$|jrdt|jj�}nd}|jdk	r�|djt|jj	��7}n|j
r�t|j
tj
�r�|j
}n|j
j�}|r�|dj|�7}q�n|S(Ns from {}s<InstallRequirement>s in {}s
 (from {})(RMtstrRXtformatR!RWRaRKRtlocationRNRLRtstring_typest	from_path(RqtsRN((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt__str__�s 		%	"	cC@s"dj|jjt|�|j�S(Ns<{} object: {} editable={!r}>(Rtt	__class__t__name__RsRP(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt__repr__�sc@sYt|��t��}�fd�t|�D�}djd|jjddj|��S(s>An un-tested helper for getting state, for debugging.
        c3@s%|]}dj|�|�VqdS(s{}={!r}N(Rt(RItattr(t
attributes(sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pys	<genexpr>�ss<{name} object: {{{state}}}>tnametstates, (tvarstsortedRtRzR{tjoin(RqtnamesR�((R~sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytformat_debug�s	cC@s/|jdkrdStjtj|jj��S(N(RMRKRt
ensure_strRt	safe_nameR(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyRscC@s
|jjS(N(RMt	specifier(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR�scC@s:|j}t|�dko9tt|��jddhkS(s�Return whether I am pinned to an exact version.

        For example, some-package==1.2 is pinned; some-package>1.2 is not.
        is==s===(R�tlentnexttitertoperator(Rqt
specifiers((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt	is_pinneds	cC@s
t|j�S(N(RR(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytinstalled_versionsc@s@|sd}n�jdk	r8t�fd�|D��StSdS(Ntc3@s(|]}�jji|d6�VqdS(RJN(R`tevaluate(RIRJ(Rq(sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pys	<genexpr>(s(R�(R`RKtanytTrue(Rqtextras_requested((RqsN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt
match_markers s	cC@s
t|j�S(s�Return whether any known-good hashes are specified as options.

        These activate --require-hashes mode; hashes specified as part of a
        URL do not.

        (tboolRg(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pythas_hash_options-s	cC@sb|jj�}|r|jn|j}|rX|jrX|j|jg�j|j�nt|�S(s�Return a hash-comparer that considers my option- and URL-based
        hashes to be known-good.

        Hashes in URLs--ones embedded in the requirements file, not ones
        downloaded from an index server--are almost peers with ones from
        flags. They satisfy --require-hashes (whether it was implicitly or
        explicitly activated) but do not activate it. md5 and sha224 are not
        allowed in flags, which should nudge people toward good algos. We
        always OR all hashes together, even ones from URLs.

        :param trust_internet: Whether to trust URL-based (#md5=...) hashes
            downloaded from the internet, as by populate_link()

        (	RgtcopyRXRYthasht
setdefaultt	hash_nametappendR(Rqttrust_internettgood_hashesRX((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pythashes8s
"cC@sy|jdkrdSt|j�}|jrut|jtj�rL|j}n|jj�}|ru|d|7}qun|S(s@Format a nice indicator to show where this "comes from"
        s->N(RMRKRsRNRLRRvRw(RqRxRN((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyRwNs	c	C@s"|dk	st�|jdk	r=|jjs3t�|jjS|jdkrqtdtjdt�|_|jjSt	|j
�}|r�dj|tj
�j�}ntjj|�s�tjd|�tj|�ntjj||�}|r�dnt}td|d|dtjdt�jS(Ntkindtglobally_manageds{}_{}sCreating directory %sR9tdelete(RKR>RcR9RMR#R$t	REQ_BUILDR�RRRttuuidtuuid4thexR7texiststloggertdebugtmakedirsR�RZ(Rqt	build_dirt
autodeletetparallel_buildstdir_nametactual_build_dirt
delete_arg((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytensure_build_location^s*

	cC@s�|jdkst�|jdk	s*t�|jdk	s?t�tt|jd�t�rdd}nd}tdj	|jd||jdg��|_dS(s3Set requirement after generating metadata.
        Rs==s===R�tNameN(
RMRKR>R5RRRLt
parse_versionRRR�(Rqtop((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt_set_requirement�s	
cC@s^t|jd�}t|jj�|kr/dStjd|j||j�t|�|_dS(NR�seGenerating metadata for package %s produced metadata for project name %s. Fix your #egg=%s fragments.(RR5RMRR�twarningR(Rqt
metadata_name((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytwarn_on_mismatching_name�scC@s�|jdkrdSt|jj�}|s/dS|j}|jjj|dt�s�d|_|r�t	|�rzt|_
q�t�r�t|�r�t
dj|j|j���q�q�t|�r�t|_
q�n'|jr�t|_
d|_n	||_dS(s�Find an installed distribution that satisfies or conflicts
        with this requirement, and set self.satisfied_by or
        self.should_reinstall appropriately.
        NtprereleasessVWill not install to the user site because it will lack sys.path precedence to {} in {}(RMRKRRtparsed_versionR�tcontainsR�RaRRbR&RR	RtR4RuRRP(Rqt
use_user_sitet
existing_disttexisting_version((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytcheck_if_exists�s,					cC@s|js
tS|jjS(N(RXRZtis_wheel(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR��s	cC@s+tjj|j|jr$|jjp'd�S(NR�(R7R9R�RRRXtsubdirectory_fragment(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytunpacked_source_directory�s	cC@sm|jstdj|���tjj|jd�}tjrit	|tj
�ri|jtj
��}n|S(NsNo source dir for {}ssetup.py(RRR>RtR7R9R�R�RtPY2RLt	text_typetencodetsystgetfilesystemencoding(Rqtsetup_py((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt
setup_py_path�s
cC@s+|jstdj|���t|j�S(NsNo source dir for {}(RRR>RtRR�(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytpyproject_toml_path�scC@s�t|j|j|jt|��}|dkr=t|_dSt|_|\}}}}||_||_	t
|j|d|�|_dS(sALoad the pyproject.toml file.

        After calling this routine, all of the attributes related to PEP 517
        processing for this requirement have been set. In particular, the
        use_pep517 attribute can be used to determine whether we should
        follow the PEP 517 or legacy (setup.py) code path.
        Ntbackend_path(
RRpR�R�RsRKRZR�RnRmRR�Ro(Rqtpyproject_toml_datatrequirestbackendtcheckR�((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR�s					c
C@s�|js^|jst�td|jd|jd|jd|jd|jpZdj|j	��S|j
dk	sst�td|jd|j
�S(	sKInvokes metadata generator functions, with the required arguments.
        RlR�RRRktdetailssfrom {}R�N(
RpR�R>tgenerate_metadata_legacyRlR�RkRRtRXRoRKR(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt_generate_metadatas						cC@s\|jst�t��|j�|_WdQX|jsD|j�n
|j�|j�dS(s�Ensure that project metadata is available.

        Under PEP 517, call the backend hook to prepare the metadata.
        Under legacy processing, call setup.py egg-info.
        N(	RRR>RR�R@RR�R�tassert_source_matches_version(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytprepare_metadata"s
	

cC@s.t|d�s't|j��|_n|jS(Nt	_metadata(thasattrR"tget_distR�(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR56scC@s
t|j�S(N(RFR@(Rq((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR�>scC@ss|jst�|jd}|jjrP||jjkrPtjd||�ntjdt|j�||�dS(Ntversions'Requested %s, but installing version %ss;Source in %s has version %s, which satisfies requirement %s(	RRR>R5RMR�R�R�R�R(RqR�((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR�Bs

cC@s4|jdkr0|j|d|d|�|_ndS(sAEnsure that a source_dir is set.

        This will create a temporary build dir if the name of the requirement
        isn't known yet.

        :param parent_dir: The ideal pip parent_dir for the source_dir.
            Generally src_dir for editables and build_dir for sdists.
        :return: self.source_dir
        R�R�N(RRRKR�(Rqt
parent_dirR�R�((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytensure_has_source_dirUs
cC@s�|js tjd|j�dS|js/t�|js>t�|jjdkrTdSd|jjks~tdjt	����|jjj
dd�\}}tj|�}|r\|jj
sdj|jj�}d}|jjjd�r�d}nt||d	d
dd�nt|jj�}|rC|j|jd
|�q}|j|jd
|�n!ds}tdj|j|���dS(Ns>Cannot update repository at %s; repository location is unknowntfilet+sbad url: {self.link.url!r}is5This form of VCS requirement is being deprecated: {}.sgit+git@smgit+https://git@example.com/..., git+ssh://git@example.com/..., or the insecure git+git://git@example.com/...tgone_ins21.0tissuei�RWis+Unexpected version control type (in {}): {}(RXR�R�RRRPR>tschemeRWRttlocalsR:R'tget_backendtis_vcsRKt
startswithRR tobtaintexport(RqR�tvc_typeRWtvcs_backendtreasontreplacementt
hidden_url((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytupdate_editablems8	
		cC@sq|jst�t|jj�}|s>tjd|j�dStjd|�tj	|�}|j
||�|S(s�
        Uninstall the distribution currently satisfying this requirement.

        Prompts before removing or modifying files unless
        ``auto_confirm`` is True.

        Refuses to delete or modify files outside of ``sys.prefix`` -
        thus uninstallation within a virtual environment can only
        modify that virtual environment, even if the virtualenv is
        linked to global site-packages.

        s#Skipping %s as it is not installed.sFound existing installation: %sN(RMR>RRR�R�RKtinfoRt	from_disttremove(Rqtauto_confirmtverbosetdisttuninstalled_pathset((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt	uninstall�scC@s<d�}tjj||�}|||�}|jd|S(NcS@sa|j|tjj�s1tdjt����|t|�d}|jtjjd�}|S(Ns2name {name!r} doesn't start with prefix {prefix!r}it/(	R�R7R9R8R>RtR�R�treplace(Rtprefix((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt_clean_zip_name�sR�(R7R9R�R(RqR9t	parentdirtrootdirR�R((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt_get_archive_name�s	
cC@sb|jst�t}dj|j|jd�}tjj||�}tjj	|�r&t
djt|��d�}|dkr�t}q&|dkr�t
jdt|��tj|�q&|dkrt|�}t
jd	t|�t|��tj||�q&|dkr&tjd
�q&n|s0dStj|dtjdt�}|��tjjtjj|j��}x�tj|�D]�\}	}
}xU|
D]M}|j|d
|	d|�}
tj|
d�}d|_|j|d�q�WxN|D]F}|j|d
|	d|�}tjj|	|�}|j ||�q�Wq�WWdQXt
j!dt|��dS(s}Saves archive to provided build_dir.

        Used for saving downloaded VCS requirements as part of `pip download`.
        s	{}-{}.zipR�s8The file {} exists. (i)gnore, (w)ipe, (b)ackup, (a)bort titwtbtasDeleting %ssBacking up %s to %si����Nt
allowZip64R�R�R�i�iR�sSaved %s(R�R�R�R�i�("RRR>R�RtRR5R7R9R�R�RRRZR�R�R�RtshutiltmoveR�texittzipfiletZipFiletZIP_DEFLATEDtnormcaseRUR�twalkR�tZipInfot
external_attrtwritestrtwriteR�(RqR�tcreate_archivetarchive_nametarchive_pathtresponset	dest_filet
zip_outputtdirtdirpathtdirnamest	filenamestdirnametdir_arcnametzipdirtfilenametfile_arcname((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytarchive�sV			
	
	
c	
C@syt|jd|d|d|d|jd|�}	|dk	rB|ng}|jr�t||d|d|d|d|jd|jd|jd	|jd
|j�t	|_
dS|jr?|js�t
�d}
|jr�t|j|j|j�}
nt|j|jd|	dt|j�d
|d|d|
d|j�t	|_
dSt|�|j}t|�|j}yytd|d|d|d|d|d|d
|d|	d|jd|jd|jd	|jd
|jdt|j��}WnHtk
r}t|_
tj|j�ntk
r(t	|_
�nX||_
|ru|j dkrut!ddj"|j�dddddd�ndS(NtuserthometrootRkR�R�RR�RlR�R�treq_descriptiont	pycompiletwarn_script_locationt
direct_urlt	requestedReRftreq_namei� R�sg{} was installed using the legacy 'setup.py install' method, because a wheel could not be built for it.R�s+to fix the wheel build issue reported aboveR�s21.0R�(#R
RRkRKRPtinstall_editable_legacyR�RlR�R�RdR�R\R>RYRRRR[RRsRMRitlistRfRetinstall_legacyRRZRtreraisetparentt	ExceptionRQRRt(
RqReRfRRR�R!R�R R�R"tsuccesstexc((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyRs�								
				
								
		N(('R{t
__module__t__doc__RZRKRrRyR|R�tpropertyRR�R�R�R�R�R�R�RwR�R�R�R�R�R�R�R�RR�R�R5R�R�R�R�R�R�RR(((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyRG`sde			
		&			%					,		@c	C@shd}|jsd}n$|jr*d}n|jr<d}n|rdtddddd	dd
d�n|S(NR�s3Unnamed requirements are not allowed as constraintss$Links are not allowed as constraintssConstraints cannot have extrasR�sConstraints are only allowed to take the form of a package name and a version specifier. Other forms were originally permitted as an accident of the implementation, but were undocumented. The new implementation of the resolver no longer supports these forms.R�s,replacing the constraint with a requirement.R�R�i (RRXR]RRK(RMtproblem((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytcheck_invalid_constraint_typems						
(ct
__future__RtloggingR7RR�R�Rtpip._vendorRRt"pip._vendor.packaging.requirementsRtpip._vendor.packaging.utilsRtpip._vendor.packaging.versionRRR�tpip._vendor.pep517.wrappersRtpip._internal.build_envRtpip._internal.exceptionsR	tpip._internal.locationsR
tpip._internal.models.linkRt'pip._internal.operations.build.metadataRt.pip._internal.operations.build.metadata_legacyR�t0pip._internal.operations.install.editable_legacyR
R%t'pip._internal.operations.install.legacyRRR't&pip._internal.operations.install.wheelRtpip._internal.pyprojectRRtpip._internal.req.req_uninstallRtpip._internal.utils.deprecationRt&pip._internal.utils.direct_url_helpersRtpip._internal.utils.hashesRtpip._internal.utils.loggingRtpip._internal.utils.miscRRRRRRRRR R!tpip._internal.utils.packagingR"tpip._internal.utils.temp_dirR#R$tpip._internal.utils.typingR%tpip._internal.utils.virtualenvR&tpip._internal.vcsR'ttypingR(R)R*R+R,R-R.R/tpip._vendor.pkg_resourcesR0t pip._vendor.packaging.specifiersR1tpip._vendor.packaging.markersR2t	getLoggerR{R�RFtobjectRGR1(((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt<module>s^F4	���

Zerion Mini Shell 1.0