ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/
Upload File :
Current File : //proc/self/root/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyo

�
Bu�_c@s�dZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZmZdd	lmZdd
lmZerddlmZmZmZmZmZddlmZdd
lmZnej e!�Z"d�Z#de$fd��YZ%de%fd��YZ&de&fd��YZ'de$fd��YZ(de%fd��YZ)dS(sCache Management
i����N(tinterpreter_nametinterpreter_version(tcanonicalize_name(tInvalidWheelFilename(tLink(tWheel(t
TempDirectoryt
tempdir_kinds(tMYPY_CHECK_RUNNING(tpath_to_url(tOptionaltSettListtAnytDict(tTag(t
FormatControlcCs=tj|dtdddt�}tj|jd��j�S(s'Return a stable sha224 of a dictionary.t	sort_keyst
separatorst,t:tensure_asciitascii(RR(tjsontdumpstTruethashlibtsha224tencodet	hexdigest(tdts((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt
_hash_dicts!tCachecBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s�An abstract class - provides cache directories for data from links


        :param cache_dir: The root of the cache.
        :param format_control: An object of FormatControl class to limit
            binaries being read from the cache.
        :param allowed_formats: which formats of files the cache should store.
            ('binary' and 'source' are the only allowed values)
    cCsDtt|�j�|pd|_||_||_ddh}dS(Ntsourcetbinary(tsuperR!t__init__tNonet	cache_dirtformat_controltallowed_formats(tselfR'R(R)t_valid_formats((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%/s		cCs�|jg}|jdk	rO|jdk	rO|jdj|j|jg��ndj|�}tj|j��j	�}|d |dd!|dd!|dg}|S(s�Get parts of part that must be os.path.joined with cache_dir

        Legacy cache key (pip < 20) for compatibility with older caches.
        t=t#iiiN(
turl_without_fragmentt	hash_nameR&thashtappendtjoinRRRR(R*tlinkt	key_partstkey_urlthashedtparts((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt_get_cache_path_parts_legacy:s
%(cCs�i|jd6}|jdk	rA|jdk	rA|j||j<n|jrZ|j|d<nt�|d<t�|d<t|�}|d |dd!|dd!|dg}|S(	sEGet parts of part that must be os.path.joined with cache_dir
        turltsubdirectoryRRiiiN(R.R/R&R0tsubdirectory_fragmentRRR (R*R3R4R6R7((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt_get_cache_path_partsVs	

(c	Cs�|jp|p|}|r"gS|jj|�}|jj|�sJgSg}|j|�}tjj|�r�x-tj	|�D]}|j
||f�q�Wn|j|�}tjj|�r�x-tj	|�D]}|j
||f�q�Wn|S(N(R'R(tget_allowed_formatsR)tintersectiontget_path_for_linktostpathtisdirtlistdirR1tget_path_for_link_legacy(	R*R3tcanonical_package_namet
can_not_cachetformatst
candidatesRAt	candidatetlegacy_path((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt_get_candidatesys&
		cCs
t��dS(N(tNotImplementedError(R*R3((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRD�scCs
t��dS(s>Return a directory to store cached items in for link.
        N(RL(R*R3((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR?�scCs
t��dS(saReturns a link to a cached item if it exists, otherwise returns the
        passed link.
        N(RL(R*R3tpackage_nametsupported_tags((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pytget�s
(
t__name__t
__module__t__doc__R%R8R<RKRDR?RO(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR!$s				#			tSimpleWheelCachecBs2eZdZd�Zd�Zd�Zd�ZRS(s+A cache of wheels for future installs.
    cCs#tt|�j||dh�dS(NR#(R$RSR%(R*R'R(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%�scCs(|j|�}tjj|jd|�S(Ntwheels(R8R@RAR2R'(R*R3R7((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRD�scCs(|j|�}tjj|jd|�S(s�Return a directory to store cached wheels for link

        Because there are M wheels for any one sdist, we provide a directory
        to cache them in, and then consult that directory when looking up
        cache hits.

        We only insert things into the cache if they have plausible version
        numbers, so that we don't contaminate the cache with things that were
        not unique. E.g. ./package might have dozens of installs done for it
        and build a version of 0.0...and if we built and cached a wheel, we'd
        end up using the same wheel even if the source has been edited.

        :param link: The link of the sdist for which this will cache wheels.
        RT(R<R@RAR2R'(R*R3R7((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR?�sc
Cs	g}|s|St|�}x�|j||�D]�\}}yt|�}Wntk
raq/nXt|j�|kr�tjd|||�q/n|j|�s�q/n|j|j	|�||f�q/W|s�|St
|�\}	}}ttt
jj||���S(NsWIgnoring cached wheel %s for %s as it does not match the expected distribution name %s.(RRKRRtnametloggertdebugt	supportedR1tsupport_index_mintminRR	R@RAR2(
R*R3RMRNRHREt
wheel_namet	wheel_dirtwheelt_((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRO�s2	

(RPRQRRR%RDR?RO(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRS�s
			tEphemWheelCachecBseZdZd�ZRS(sGA SimpleWheelCache that creates it's own temporary cache directory
    cCs>tdtjdt�|_tt|�j|jj|�dS(Ntkindtglobally_managed(	RRtEPHEM_WHEEL_CACHERt	_temp_dirR$R_R%RA(R*R(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%s
	(RPRQRRR%(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR_�st
CacheEntrycBseZd�ZRS(cCs||_||_dS(N(R3t
persistent(R*R3Re((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%s	(RPRQR%(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRdst
WheelCachecBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s�Wraps EphemWheelCache and SimpleWheelCache into a single Cache

    This Cache allows for gracefully degradation, using the ephem wheel cache
    when a certain link is not found in the simple wheel cache first.
    cCsDtt|�j||dh�t||�|_t|�|_dS(NR#(R$RfR%RSt_wheel_cacheR_t_ephem_cache(R*R'R(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%scCs|jj|�S(N(RgRD(R*R3((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRD'scCs|jj|�S(N(RgR?(R*R3((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR?+scCs|jj|�S(N(RhR?(R*R3((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pytget_ephem_path_for_link/scCs,|j|||�}|dkr%|S|jS(N(tget_cache_entryR&R3(R*R3RMRNtcache_entry((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRO3scCs~|jjd|d|d|�}||k	r=t|dt�S|jjd|d|d|�}||k	rzt|dt�SdS(s�Returns a CacheEntry with a link to a cached item if it exists or
        None. The cache entry indicates if the item was found in the persistent
        or ephemeral cache.
        R3RMRNReN(RgRORdRRhtFalseR&(R*R3RMRNtretval((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRj?s		(	RPRQRRR%RDR?RiRORj(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRfs					(*RRRRtloggingR@tpip._vendor.packaging.tagsRRtpip._vendor.packaging.utilsRtpip._internal.exceptionsRtpip._internal.models.linkRtpip._internal.models.wheelRtpip._internal.utils.temp_dirRRtpip._internal.utils.typingRtpip._internal.utils.urlsR	ttypingR
RRR
RRt#pip._internal.models.format_controlRt	getLoggerRPRVR tobjectR!RSR_RdRf(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt<module>s.(	�R

Zerion Mini Shell 1.0