PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/alt/python313/lib/python3.13/site-packages/pip/_internal/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib/python3.13/site-packages/pip/_internal/__pycache__/cache.cpython-313.pyc

�

�ZLg�(��f�SrSSKrSSKrSSKrSSKrSSKJr SSKJrJ	r	J
r
Jr SSKJ
r
JrJr SSKJr SSKJr SSKJr SS	KJr SS
KJr SSKJrJr SSKJr \R>"\ 5r!S
r"S\	\#\#4S\#4Sjr$"SS5r%"SS\%5r&"SS\&5r'"SS5r("SS\%5r)g)zCache Management
�N)�Path)�Any�Dict�List�Optional)�Tag�interpreter_name�interpreter_version)�canonicalize_name)�InvalidWheelFilename)�	DirectUrl)�Link)�Wheel)�
TempDirectory�
tempdir_kinds)�path_to_urlzorigin.json�d�returnc��[R"USSSS9n[R"UR	S55R5$)z'Return a stable sha224 of a dictionary.T)�,�:)�	sort_keys�
separators�ensure_ascii�ascii)�json�dumps�hashlib�sha224�encode�	hexdigest)r�ss  څ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-1.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_internal/cache.py�
_hash_dictr$s7���
�
�1���$�O�A��>�>�!�(�(�7�+�,�6�6�8�8�c�^�\rSrSrSrS\SS4U4SjjrS\S\\4Sjr	S\S	\S\\
4S
jrS\S\4SjrS\S\
\S
\\S\4SjrSrU=r$)�Cache� zmAn abstract class - provides cache directories for data from links

:param cache_dir: The root of the cache.
�	cache_dirrNc�>�[TU]5 U(a&[RR	U5(deU=(d SUlg�N)�super�__init__�os�path�isabsr)��selfr)�	__class__s  �r#r-�Cache.__init__&s5���
��������
�
�i� 8� 8�8�8�"�*�d��r%�linkc�4�SUR0nURb%URbURX!R'UR(aURUS'[	5US'[5US'[
U5nUSSUSSUSSUSS/nU$)	z<Get parts of part that must be os.path.joined with cache_dir�urlN�subdirectoryr	r
���)�url_without_fragment�	hash_name�hash�subdirectory_fragmentr	r
r$)r2r5�	key_parts�hashed�partss     r#�_get_cache_path_parts�Cache._get_cache_path_parts+s����D�5�5�6�	��>�>�%�$�)�)�*?�(,�	�	�I�n�n�%��%�%�(,�(B�(B�I�n�%�)9�(:�	�$�%�+>�+@�	�'�(��I�&��
����V�A�a�[�&��1�+�v�a�b�z�B���r%�canonical_package_namec�4�UR(+=(d U(+=(d U(+nU(a/$URU5n[RR	U5(a'[R
"U5Vs/sHoUU4PM sn$/$s snfr+)r)�get_path_for_linkr.r/�isdir�listdir)r2r5rE�
can_not_cacher/�	candidates      r#�_get_candidates�Cache._get_candidatesLsx�� �N�N�*�T�2H�.H�T�PT�H�
���I��%�%�d�+��
�7�7�=�=����79�z�z�$�7G�H�7G�)��%�7G�H�H��	��Is�Bc��[5e)z5Return a directory to store cached items in for link.��NotImplementedError�r2r5s  r#rG�Cache.get_path_for_linkVs��!�#�#r%�package_name�supported_tagsc��[5e)zQReturns a link to a cached item if it exists, otherwise returns the
passed link.
rO)r2r5rSrTs    r#�get�	Cache.getZs
��"�#�#r%)r))�__name__�
__module__�__qualname__�__firstlineno__�__doc__�strr-rrrCrrLrGrrrV�__static_attributes__�
__classcell__�r3s@r#r'r' s�����
+�#�+�$�+�
�$��4��9��B�D��#��$�s�)��$�d�$�s�$�	$��	$��s�m�	$��S�	�		$�

�	$�	$r%r'c�p^�\rSrSrSrS\SS4U4SjjrS\S\4SjrS\S	\	\S
\
\S\4SjrSr
U=r$)
�SimpleWheelCache�fz&A cache of wheels for future installs.r)rNc�$>�[TU]U5 gr+)r,r-r1s  �r#r-�SimpleWheelCache.__init__is���
����#r%r5c��URU5nUR(de[RR"URS/UQ76$)acReturn 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.
�wheels)rCr)r.r/�join)r2r5rBs   r#rG�"SimpleWheelCache.get_path_for_linkls>���*�*�4�0���~�~��~��w�w�|�|�D�N�N�H�=�u�=�=r%rSrTc��/nU(dU$[U5nURX5Hupg[U5n[UR5U:wa[
R
SUUU5 MDURU5(dM\URURU5UU45 M� U(dU$[U5up�n[[[RRXv555$![a M�f=f)NzWIgnoring cached wheel %s for %s as it does not match the expected distribution name %s.)rrLrr�name�logger�debug�	supported�append�support_index_min�minrrr.r/rh)
r2r5rSrT�
candidatesrE�
wheel_name�	wheel_dir�wheel�_s
          r#rV�SimpleWheelCache.get�s����
���K�!2�<�!@��%)�%9�%9�$�%W�!�J�
��j�)��!����,�0F�F����H��� ����?�?�>�2�2������+�+�N�;����
�#&X�2��K�#&�z�?� ��y��K������Y� C�D�E�E��5(�
��
�s�C3�3
D�D�)rXrYrZr[r\r]r-rrGrrrrVr^r_r`s@r#rbrbfsj���0�$�#�$�$�$�>�d�>�s�>�()F��)F��s�m�)F��S�	�	)F�

�)F�)Fr%rbc�0^�\rSrSrSrSU4SjjrSrU=r$)�EphemWheelCache�zBA SimpleWheelCache that creates it's own temporary cache directoryc�>�[[RSS9Ul[TU]URR5 g)NT)�kind�globally_managed)rr�EPHEM_WHEEL_CACHE�	_temp_dirr,r-r/)r2r3s �r#r-�EphemWheelCache.__init__�s4���&��0�0�!�
���
	������,�,�-r%)r�)rN)rXrYrZr[r\r-r^r_r`s@r#rzrz�s���L�.�.r%rzc�&�\rSrSrS\S\4SjrSrg)�
CacheEntry�r5�
persistentc�z�XlX lSUl[URR5R
[-nUR5(a*[R"URSS95Ulgg![a,n[RSUURU5 SnAgSnAff=f)N�utf-8��encodingz7Ignoring invalid cache entry origin file %s for %s (%s))r5r��originr�	file_path�parent�ORIGIN_JSON_NAME�existsr
�	from_json�	read_text�	Exceptionrl�warning�filename)r2r5r��origin_direct_url_path�es     r#r-�CacheEntry.__init__�s���
�	�$��+/���!%�d�i�i�&9�&9�!:�!A�!A�DT�!T��!�(�(�*�*�

�'�1�1�*�4�4�g�4�F����+��
�
����M�*��M�M��	���
�s�(B�
B:�"B5�5B:)r5r�r�N)rXrYrZr[r�boolr-r^rxr%r#r�r��s������r%r�c	��^�\rSrSrSrS\SS4U4SjjrS\S\4SjrS\S\4S	jr	S\S
\
\S\\S\4Sjr
S\S
\
\S\\S\
\4S
jr\S\S\SS4Sj5rSrU=r$)�
WheelCache��z�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.
r)rNc�b>�[TU]U5 [U5Ul[	5Ulgr+)r,r-rb�_wheel_cacherz�_ephem_cacher1s  �r#r-�WheelCache.__init__�s(���
����#�,�Y�7���+�-��r%r5c�8�URRU5$r+)r�rGrQs  r#rG�WheelCache.get_path_for_link����� � �2�2�4�8�8r%c�8�URRU5$r+)r�rGrQs  r#�get_ephem_path_for_link�"WheelCache.get_ephem_path_for_link�r�r%rSrTc�H�URXU5nUcU$UR$r+)�get_cache_entryr5)r2r5rSrT�cache_entrys     r#rV�WheelCache.get�s-���*�*�4�~�N�����K����r%c��URRUUUS9nXALa
[USS9$URRUUUS9nXALa
[USS9$g)z�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.
)r5rSrTT)r�FN)r�rVr�r�)r2r5rSrT�retvals     r#r��WheelCache.get_cache_entry�sy���"�"�&�&��%�)�'�
��
���f��6�6��"�"�&�&��%�)�'�
��
���f��7�7�r%�
download_infoc��[U5[-nUR5(aj[R"URSS95nURUR:wa,[RSURUUR5 URUR5SS9 g![a!n[RSUU5 SnANESnAff=f)Nr�r�z�Origin URL %s in cache entry %s does not match download URL %s. This is likely a pip bug or a cache corruption issue. Will overwrite it with the new value.zPCould not read origin file %s in cache entry (%s). Will attempt to overwrite it.)rr�r�r
r�r�r7rlr�r��
write_text�to_json)r)r��origin_pathr�r�s     r#�record_download_origin�!WheelCache.record_download_origin	s����9�o�(8�8�������
�"�,�,�[�-B�-B�G�-B�-T�U���:�:��!2�!2�2��N�N�@��
�
�!�%�)�)�
�	���}�4�4�6���I��'�
����4���	���
�s�#B1�1
C�;C�C)r�r�)rXrYrZr[r\r]r-rrGr�rrrrVr�r��staticmethodr
r�r^r_r`s@r#r�r��s�����.�#�.�$�.�
9�d�9�s�9�9�D�9�S�9�	 ��	 ��s�m�	 ��S�	�		 �

�	 �����s�m���S�	�	�

�*�	��8�J�#�J�i�J�D�J��Jr%r�)*r\rr�loggingr.�pathlibr�typingrrrr�pip._vendor.packaging.tagsrr	r
�pip._vendor.packaging.utilsr�pip._internal.exceptionsr�pip._internal.models.direct_urlr
�pip._internal.models.linkr�pip._internal.models.wheelr�pip._internal.utils.temp_dirrr�pip._internal.utils.urlsr�	getLoggerrXrlr�r]r$r'rbrzr�r�rxr%r#�<module>r�s�������	��,�,�Q�Q�9�9�5�*�,�E�0�	�	�	�8�	$�� ��9�$�s�C�x�.�9�S�9�C$�C$�LCF�u�CF�L	.�&�	.���0RJ��RJr%

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic