ó ïRec@sdZddlZddlZddlZddlZddlmZmZddlm Z ddl m Z ddl m Z ddlmZddlmZmZdd lmZdd lmZerdd lmZmZmZmZmZdd 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(t path_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((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/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) cCstt|ƒjƒ| s2tjj|ƒs2t‚|p;d|_||_ ||_ ddh}|j j |ƒ|ks}t‚dS(Ntsourcetbinary( tsuperR!t__init__tostpathtisabstAssertionErrortNonet cache_dirtformat_controltallowed_formatstunion(tselfR+R,R-t_valid_formats((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/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(sGet 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((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyt_get_cache_path_parts_legacy:s %(cCs¬i|jd6}|jdk rA|jdk rA|j||jReturn a directory to store cached items in for link. N(RO(R/R8((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRD™scCs tƒ‚dS(saReturns a link to a cached item if it exists, otherwise returns the passed link. N(RO(R/R8t package_nametsupported_tags((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pytgetŸs ( t__name__t __module__t__doc__R%R=RARNRGRDRR(((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/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$RVR%(R/R+R,((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyR%°scCs7|j|ƒ}|jst‚tjj|jd|ŒS(Ntwheels(R=R+R)R&R'R7(R/R8R<((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRG¶scCs7|j|ƒ}|jst‚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. RW(RAR+R)R&R'R7(R/R8R<((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRD¼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 |ƒ\} }}t t t jj||ƒƒƒS(NsWIgnoring cached wheel %s for %s as it does not match the expected distribution name %s.(RRNRRtnametloggertdebugt supportedR6tsupport_index_mintminRR R&R'R7( R/R8RPRQRKRHt wheel_namet wheel_dirtwheelt_((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRRÑs2     (RSRTRUR%RGRDRR(((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRV¬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$RbR%R'(R/R,((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyR%s   (RSRTRUR%(((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRbþst CacheEntrycBseZd„ZRS(cCs||_||_dS(N(R8t persistent(R/R8Rh((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyR%s (RSRTR%(((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRgst 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$RiR%RVt _wheel_cacheRbt _ephem_cache(R/R+R,((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyR%scCs|jj|ƒS(N(RjRG(R/R8((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRG'scCs|jj|ƒS(N(RjRD(R/R8((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRD+scCs|jj|ƒS(N(RkRD(R/R8((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pytget_ephem_path_for_link/scCs,|j|||ƒ}|dkr%|S|jS(N(tget_cache_entryR*R8(R/R8RPRQt cache_entry((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRR3s 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. R8RPRQRhN(RjRRRgRRktFalseR*(R/R8RPRQtretval((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRm?s      ( RSRTRUR%RGRDRlRRRm(((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyRis     (*RURRtloggingR&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 R R R RRt#pip._internal.models.format_controlRt getLoggerRSRYR tobjectR!RVRbRgRi(((s‚/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cache.pyts.    ( ˆR