3 ig$@sdZddlZddlZddlZddlZddlmZmZmZm Z m Z ddl m Z m Z mZddlmZddlmZddlmZddlmZdd lmZdd lmZmZdd lmZejeZ ee!e!fe!d d dZ"GdddZ#Gddde#Z$Gddde$Z%GdddZ&Gddde#Z'dS)zCache Management N)AnyDictListOptionalSet)Taginterpreter_nameinterpreter_version)canonicalize_name)InvalidWheelFilename) FormatControl)Link)Wheel) TempDirectory tempdir_kinds) path_to_url)dreturncCs&tj|dddd}tj|jdjS)z'Return a stable sha224 of a dictionary.T,:) sort_keys separators ensure_asciiascii)rr)jsondumpshashlibsha224encode hexdigest)rsr!2/tmp/pip-build-88gy_88q/pip/pip/_internal/cache.py _hash_dictsr#cseZdZdZeeeeddfdd Zee edddZ eee e d d d Z eedd d Z eeee eedddZZS)CacheanAn 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) N) cache_dirformat_controlallowed_formatsrcsVtj| s tjj|s t|p&d|_||_||_ddh}|jj ||ksRtdS)Nsourcebinary) super__init__ospathisabsAssertionErrorr%r&r'union)selfr%r&r'Z_valid_formats) __class__r!r"r+(s  zCache.__init__)linkrcCsd|ji}|jdk r*|jdk r*|j||j<|jr:|j|d<t|d<t|d<t|}|dd|dd|dd|ddg}|S) zs(       XF