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.pyo

�
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}n,tj
}tjj	|�djd�d}||d|d|�S(sQReturn a pkg_resources.Distribution for the provided
    metadata directory.
    s	.egg-infoit-tproject_nametmetadata(trstriptostseptpathtsplitRtPathMetadatatendswithR0tsplitexttDistInfoDistribution(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@s||_||_||_||_d|_d|_|jrr|jrrtj	j
tj	j|j��|_qrn|dkr�|r�|j
r�t|j
�}n||_|_t|_d|_|jr�|jjr�|jj|_n|r�||_n+|rd�|jD�|_nt�|_|dkrC|rC|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	(*treqt
comes_fromt
constraintteditabletNonetlegacy_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(tselfRJRKRMRVR^RnRiRcRdReRLR[Rg((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt__init__gsT									!																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 {})(RJtstrRVtformatR!RUR_RNRtlocationRKt
isinstanceRtstring_typest	from_path(RotsRK((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}>(Rrt	__class__t__name__RqRM(Ro((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(Rr(RHtattr(t
attributes(sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pys	<genexpr>�ss<{name} object: {{{state}}}>tnametstates, (tvarstsortedRrRyRztjoin(RotnamesR((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(RJRNRt
ensure_strRt	safe_nameR~(Ro((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR~scC@s
|jjS(N(RJt	specifier(Ro((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(Rot
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~(Ro((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(RIN(R^tevaluate(RHRI(Ro(sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pys	<genexpr>(s(R�(R^RNtanytTrue(Rotextras_requested((RosN/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.

        (tboolRe(Ro((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()

        (	RetcopyRVRWthasht
setdefaultt	hash_nametappendR(Rottrust_internettgood_hashesRV((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(RJRNRqRKRtRRuRv(RoRwRK((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyRvNs	c	C@s�|jdk	r|jjS|jdkrMtdtjdt�|_|jjSt|j	�}|r�dj
|tj�j
�}ntjj|�s�tjd|�tj|�ntjj||�}|r�dnt}td|d|dtjdt�jS(Ntkindtglobally_manageds{}_{}sCreating directory %sR9tdelete(RaRNR9RJR#R$t	REQ_BUILDR�RR~Rrtuuidtuuid4thexR7texiststloggertdebugtmakedirsR�RX(Rot	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^tt|jd�t�r%d}nd}tdj|jd||jdg��|_dS(s3Set requirement after generating metadata.
        Rs==s===R�tNameN(Rtt
parse_versionR5RRR�RJ(Rotop((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.(RR5RJR~R�twarningR(Rot
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 {}(RJRNRR~tparsed_versionR�tcontainsR�R_RR`R&RR	RrR4RsRRM(Rot
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(RVRXtis_wheel(Ro((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�RPRVtsubdirectory_fragment(Ro((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytunpacked_source_directory�s	cC@sOtjj|jd�}tjrKt|tj�rK|jt	j
��}n|S(Nssetup.py(R7R9R�R�RtPY2Rtt	text_typetencodetsystgetfilesystemencoding(Rotsetup_py((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt
setup_py_path�scC@s
t|j�S(N(RR�(Ro((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(
RRnR�R�RqRNRXR�RlRkRR�Rm(Rotpyproject_toml_datatrequirestbackendtcheckR�((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR�s					c
C@sh|jsOtd|jd|jd|jd|jd|jpKdj|j��St	d|jd|j
�S(sKInvokes metadata generator functions, with the required arguments.
        RjR�RPRitdetailssfrom {}R�(Rntgenerate_metadata_legacyRjR�R�RiR~RrRVRRm(Ro((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt_generate_metadatas						cC@sMt��|j�|_WdQX|js5|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(RR�R?R~R�R�tassert_source_matches_version(Ro((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�(Ro((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR56scC@s
t|j�S(N(RER?(Ro((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyR�>scC@sd|jd}|jjrA||jjkrAtjd||�ntjdt|j�||�dS(Ntversions'Requested %s, but installing version %ss;Source in %s has version %s, which satisfies requirement %s(R5RJR�R�R�R�RRP(RoR�((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(RPRNR�(Rot
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|jjdkr6dS|jjjdd�\}}tj|�}|r|jj	s�dj
|jj�}d}|jjjd�r�d}nt
||dd	d
d�nt|jj�}|r�|j|jd|�q|j|jd|�ndS(
Ns>Cannot update repository at %s; repository location is unknowntfilet+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�RU(RVR�R�RPtschemeRUR:R'tget_backendtis_vcsRrRNt
startswithRR tobtaintexport(RoR�tvc_typeRUtvcs_backendtreasontreplacementt
hidden_url((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytupdate_editablems,	
	cC@sbt|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(
RRJR~R�R�RNtinfoRt	from_disttremove(Rot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@s0|t|�d}|jtjjd�}|S(Nit/(R�treplaceR7R9R8(R~tprefix((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt_clean_zip_name�sR�(R7R9R�R~(RoR9t	parentdirtrootdirR�R~((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt_get_archive_name�s	
cC@sSt}dj|j|jd�}tjj||�}tjj|�rtdjt	|��d�}|dkr|t
}q|dkr�tjdt	|��tj
|�q|dkr�t|�}tjd	t	|�t	|��tj||�q|dkrtjd
�qn|s!dStj|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�WqwWWdQXtjdt	|��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�( R�RrR~R5R7R9R�R�RRRXR�R�R�RtshutiltmoveR�texittzipfiletZipFiletZIP_DEFLATEDtnormcaseRSR�twalkR�tZipInfot
external_attrtwritestrtwriteR�(RoR�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�sT			
	
	
c	
C@sjt|jd|d|d|d|jd|�}	|dk	rB|ng}|jr�t||d|d|d|d|jd|jd|jd	|jd
|j�t	|_
dS|jr0d}
|jr�t
|j|j|j�}
nt|j|jd|	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
rt	|_
�nX||_
|rf|jdkrft ddj!|j�dddddd�ndS(NtuserthometrootRiR�R�R~R�RjR�R�treq_descriptiont	pycompiletwarn_script_locationt
direct_urlt	requestedRcRdtreq_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
R~RiRNRMtinstall_editable_legacyR�RjR�R�RbR�RWRRPRYRRZRqRJRgtlistRdRctinstall_legacyRRXRtreraisetparentt	ExceptionRORRr(
RoRcRdRRR�RR�RR�R tsuccesstexc((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyRs�								
				
								
		N(('Rzt
__module__t__doc__RXRNRpRxR{R�tpropertyR~R�R�R�R�R�R�R�RvR�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.pyRF`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 (R~RVR[RRN(RJtproblem((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pytcheck_invalid_constraint_typems						
(ct
__future__RtloggingR7R�R�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	getLoggerRzR�REtobjectRFR/(((sN/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/req/req_install.pyt<module>s^F4	���

Zerion Mini Shell 1.0