� ��^i�1��z�dZddlZddlmZmZmZddlmZmZm Z m Z m Z ddl m Z ddlmZmZerddlmZddlmZdd lmZGd �d e��ZGd �d e��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��Z Gd�de��Z!Gd�de��Z"Gd �d!e��Z#Gd"�d#e��Z$Gd$�d%e��Z%Gd&�d'e��Z&Gd(�d)e��Z'Gd*�d+e��Z(Gd,�d-e��Z)Gd.�d/e��Z*Gd0�d1e��Z+Gd2�d3e+��Z,Gd4�d5e+��Z-Gd6�d7e+��Z.Gd8�d9e+��Z/Gd:�d;e+��Z0Gd<�d=e��Z1Gd>�d?e��Z2dS)@z"Exceptions used throughout package�N)�chain�groupby�repeat)� TYPE_CHECKING�Dict�List�Optional�Union)� Distribution)�Request�Response)�_Hash)�BaseDistribution)�InstallRequirementc��eZdZdZdS)�PipErrorzBase pip exceptionN��__name__� __module__� __qualname__�__doc__����/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/exceptions.pyrr����������rrc��eZdZdZdS)�ConfigurationErrorz"General exception in configurationNrrrrrrs������,�,�,�,rrc��eZdZdZdS)�InstallationErrorz%General exception during installationNrrrrrrs������/�/�/�/rrc��eZdZdZdS)�UninstallationErrorz'General exception during uninstallationNrrrrr!r!s������1�1�1�1rr!c�B�eZdZdZdeedfdeddfd�Zdefd�ZdS) �NoneMetadataErrora Raised when accessing "METADATA" or "PKG-INFO" metadata for a pip._vendor.pkg_resources.Distribution object and `dist.has_metadata('METADATA')` returns True but `dist.get_metadata('METADATA')` returns None (and similarly for "PKG-INFO"). �distr� metadata_name�returnNc�"�||_||_dS)z� :param dist: A Distribution object. :param metadata_name: The name of the metadata being accessed (can be "METADATA" or "PKG-INFO"). N)r$r%)�selfr$r%s r�__init__zNoneMetadataError.__init__*s���� �*����rc�B�d�|j|j��S)Nz+None {} metadata found for distribution: {})�formatr%r$�r(s r�__str__zNoneMetadataError.__str__7s'��=�C�C� � � �I� � � r) rrrrr r �strr)r-rrrr#r#!st�������� +��L�"4�4�5� +�� +� � +� +� +� +� �� � � � � � rr#c��eZdZdZdefd�ZdS)�UserInstallationInvalidzBA --user install is requested on an environment without user site.r&c��dS)Nz$User base directory is not specifiedrr,s rr-zUserInstallationInvalid.__str__Cs��5�5rN)rrrrr.r-rrrr0r0@s5������L�L�6��6�6�6�6�6�6rr0c��eZdZdefd�ZdS)�InvalidSchemeCombinationr&c��d�d�|jdd�D����}d|�d|jd�d�S)Nz, c3�4K�|]}t|��V��dS�N)r.)�.0�as r� z3InvalidSchemeCombination.__str__..Is(����:�:�a�3�q�6�6�:�:�:�:�:�:r�����z Cannot set z and z together)�join�args)r(�befores rr-z InvalidSchemeCombination.__str__HsK�����:�:�4�9�S�b�S�>�:�:�:�:�:��B�V�B�B�$�)�B�-�B�B�B�BrN)rrrr.r-rrrr3r3Gs6������C��C�C�C�C�C�Crr3c��eZdZdZdS)�DistributionNotFoundzCRaised when a distribution cannot be found to satisfy a requirementNrrrrr?r?Ms������M�M�M�Mrr?c��eZdZdZdS)�RequirementsFileParseErrorzDRaised when a general error occurs parsing a requirements file line.NrrrrrArAQs������N�N�N�NrrAc��eZdZdZdS)�BestVersionAlreadyInstalledzNRaised when the most up-to-date version of a package is already installed.NrrrrrCrCUs���������rrCc��eZdZdZdS)� BadCommandz0Raised when virtualenv or a command is not foundNrrrrrErEZs������:�:�:�:rrEc��eZdZdZdS)� CommandErrorz7Raised when there is an error in command-line argumentsNrrrrrGrG^s������A�A�A�ArrGc��eZdZdZdS)�PreviousBuildDirErrorz:Raised when there's a previous conflicting build directoryNrrrrrIrIbs������D�D�D�DrrIc �D��eZdZdZ d dedededdf�fd� Zdefd�Z�xZ S) �NetworkConnectionErrorzHTTP connection errorN� error_msg�response�requestr&c����||_||_||_|j�(|js!t|d��r|jj|_t ���|||��dS)zc Initialize NetworkConnectionError with `request` and `response` objects. NrN)rMrNrL�hasattr�superr))r(rLrMrN� __class__s �rr)zNetworkConnectionError.__init__isn���!�� ��� �"��� �M� %��L� &���)�,�,� &� �=�0�D�L� ������H�g�6�6�6�6�6rc�*�t|j��Sr6)r.rLr,s rr-zNetworkConnectionError.__str__{s���4�>�"�"�"r)NN) rrrrr.r r r)r-� __classcell__�rRs@rrKrKfs����������MQ�7�7��7�(0�7�BI�7� �7�7�7�7�7�7�$#��#�#�#�#�#�#�#�#rrKc��eZdZdZdS)�InvalidWheelFilenamezInvalid wheel filename.NrrrrrWrWs������!�!�!�!rrWc��eZdZdZdS)�UnsupportedWheelzUnsupported wheel.NrrrrrYrY�rrrYc �:�eZdZdZdddedededdf d �Zdefd �ZdS) �MetadataInconsistentz�Built metadata contains inconsistent information. This is raised when the metadata contains values (e.g. name and version) that do not match the information previously obtained from sdist filename or user-supplied ``#egg=`` value. �ireqr�field�f_val�m_valr&Nc�>�||_||_||_||_dSr6)r\r]r^r_)r(r\r]r^r_s rr)zMetadataInconsistent.__init__�s$���� ��� ��� ��� � � rc�^�d}|�|j|j|j|j��S)NzJRequested {} has inconsistent {}: filename has {!r}, but metadata has {!r})r+r\r]r^r_)r(�templates rr-zMetadataInconsistent.__str__�s.�� 7� ����t�y�$�*�d�j�$�*�M�M�Mr)rrrrr.r)r-rrrr[r[�s|���������(��14��=@��IL�� �����N��N�N�N�N�N�Nrr[c�2�eZdZdZdededdfd�Zdefd�ZdS)�InstallationSubprocessErrorz-A subprocess call failed during installation.� returncode� descriptionr&Nc�"�||_||_dSr6)rerf)r(rerfs rr)z$InstallationSubprocessError.__init__�s��$���&����rc�B�d�|j|j��S)NzSCommand errored out with exit status {}: {} Check the logs for full command output.)r+rerfr,s rr-z#InstallationSubprocessError.__str__�s �� 6� �&���$�"2� 3� 3� 4r)rrrr�intr.r)r-rrrrdrd�s^������7�7�'�3�'�S�'�T�'�'�'�'�4��4�4�4�4�4�4rrdc�:�eZdZdZd d�Zd d�Zdefd�Zdefd �Z dS) � HashErrorsz:Multiple HashError instances rolled into one for reportingr&Nc��g|_dSr6)�errorsr,s rr)zHashErrors.__init__�s ��)+�� � � r�error� HashErrorc�:�|j�|��dSr6)rm�append)r(rns rrqzHashErrors.append�s�� � ���5�!�!�!�!�!rc��g}|j�d����t|jd���D]>\}}|�|j��|�d�|D�����?|rd�|��SdS)Nc��|jSr6)�order��es r�z$HashErrors.__str__..�s��q�w�r)�keyc��|jSr6rUrus rrwz$HashErrors.__str__..�s����rc3�>K�|]}|���V��dSr6)�body)r7rvs rr9z%HashErrors.__str__..�s*����9�9�a������9�9�9�9�9�9r� �)rm�sortrrq�head�extendr;)r(�lines�cls� errors_of_clss rr-zHashErrors.__str__�s����� � ���.�.��/�/�/�")�$�+�7L�7L�"M�"M� :� :� �C�� �L�L��� "� "� "� �L�L�9�9�=�9�9�9� 9� 9� 9� 9� � $��9�9�U�#�#� #��rrc�*�t|j��Sr6)�boolrmr,s r�__bool__zHashErrors.__bool__�s���D�K� � � r)r&N)rnror&N) rrrrr)rqr.r-r�r�rrrrkrk�sx������D�D�,�,�,�,�"�"�"�"�������!�$�!�!�!�!�!�!rrkc�d�eZdZUdZdZeded<dZdZe ed<de fd �Z de fd �Z de fd �Z dS) roa� A failure to verify a package against known-good hashes :cvar order: An int sorting hash exception classes by difficulty of recovery (lower being harder), so the user doesn't bother fretting about unpinned packages when he has deeper issues, like VCS dependencies, to deal with. Also keeps error reports in a deterministic order. :cvar head: A section heading for display above potentially many exceptions of this kind :ivar req: The InstallRequirement that triggered this error. This is pasted on after the exception is instantiated, because it's not typically available earlier. Nr�reqr}r:rtr&c�0�d|�����S)a=Return a summary of me for display under the heading. This default implementation simply prints a description of the triggering requirement. :param req: The InstallRequirement that provoked this error, with its link already populated by the resolver's _populate_link(). z )�_requirement_namer,s rr{zHashError.body�s��1�d�,�,�.�.�0�0�0rc�>�|j�d|�����S)Nr|)rr{r,s rr-zHashError.__str__�s ���)�,�,�t�y�y�{�{�,�,�,rc�<�|jrt|j��ndS)z�Return a description of the requirement that triggered me. This default implementation returns long description of the req, with line numbers �unknown package)r�r.r,s rr�zHashError._requirement_name�s��!%��?�s�4�8�}�}�}�.?�?r)rrrrr�r �__annotations__rrtrir.r{r-r�rrrroro�s���������� +/�C��&� '�.�.�.� �D��E�3�O�O�O� 1�c� 1� 1� 1� 1�-��-�-�-�-�@�3�@�@�@�@�@�@rroc��eZdZdZdZdZdS)�VcsHashUnsupported�uA hash was provided for a version-control-system-based requirement, but we don't have a method for hashing those.rzlCan't verify hashes for these requirements because we don't have a way to hash version control repositories:N�rrrrrtrrrrr�r��s)������1�1� �E� ;� �D�Drr�c��eZdZdZdZdZdS)�DirectoryUrlHashUnsupportedr��zUCan't verify hashes for these file:// requirements because they point to directories:Nr�rrrr�r��s)������1�1� �E� � �D�Drr�c�6�eZdZdZdZdZdeddfd�Zdefd�ZdS) � HashMissingz2A hash was needed for a requirement but is absent.�awHashes are required in --require-hashes mode, but they are missing from some requirements. Here is a list of those requirements along with the hashes their downloaded archives actually had. Add lines like these to your requirements files to prevent tampering. (If you did not enable --require-hashes manually, note that it turns on automatically when any package has a hash.)� gotten_hashr&Nc��||_dS)zq :param gotten_hash: The hash of the (possibly malicious) archive we just downloaded N)r�)r(r�s rr)zHashMissing.__init__s�� '����rc��ddlm}d}|jr.|jjr |jjnt |jdd��}d�|pd||j��S)Nr)� FAVORITE_HASHr�z {} --hash={}:{}r�)�pip._internal.utils.hashesr�r�� original_link�getattrr+r�)r(r��packages rr{zHashMissing.bodys~��<�<�<�<�<�<��� �8� � �8�)�4���&�&��T�X�u�d�3�3� �%�+�+� � (�(�-��9I� � � r) rrrrrtrr.r)r{rrrr�r�sf������<�<� �E� � �'�C�'�D�'�'�'�'� �c� � � � � � rr�c��eZdZdZdZdZdS)� HashUnpinnedzPA requirement had a hash specified but was not pinned to a specific version.�zaIn --require-hashes mode, all requirements must have their versions pinned with ==. These do not:Nr�rrrr�r�2s)�������� �E� 1� �D�Drr�c�r�eZdZdZdZdZdeeeefdeedfddfd �Z defd �Z defd �Z dS) � HashMismatchz� Distribution file hash values don't match. :ivar package_name: The name of the package that triggered the hash mismatch. Feel free to write to this after the exception is raise to improve its error message. �z�THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.�allowed�gotsrr&Nc�"�||_||_dS)z� :param allowed: A dict of algorithm names pointing to lists of allowed hex digests :param gots: A dict of algorithm names pointing to hashes we actually got from the files under suspicion N)r�r�)r(r�r�s rr)zHashMismatch.__init__Os���� ��� � � rc�v�d�|���|�����S)Nz {}: {})r+r��_hash_comparisonr,s rr{zHashMismatch.bodyYs0���#�#�D�$:�$:�$<�$<�d�>S�>S�>U�>U�V�V�Vrc�l��dtddfd�}g}|j���D]v\}}||���|��fd�|D����|�d�|j|��������wd�|��S)aE Return a comparison of actual and expected hash values. Example:: Expected sha256 abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde or 123451234512345123451234512345123451234512345 Got bcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdef � hash_namer&z chain[str]c�>�t|gtd����S)Nz or)rr)r�s r� hash_then_orz3HashMismatch._hash_comparison..hash_then_orhs���)��f�X�&6�&6�7�7� 7rc3�^�K�|]'}d�t���|��V��(dS)z Expected {} {}N)r+�next)r7rv�prefixs �rr9z0HashMismatch._hash_comparison..psK�������GH�)�0�0��f���q�A�A������rz Got {} r|) r.r��itemsr�rqr+r�� hexdigestr;)r(r�r�r�� expectedsr�s @rr�zHashMismatch._hash_comparison\s���� 8�C� 8�L� 8� 8� 8� 8� ��$(�L�$6�$6�$8�$8� � � �I�y�!�\�)�,�,�F� �L�L�����LU���� � � � �L�L�.�5�5�d�i� �6J�6T�6T�6V�6V�W�W� � � � ��y�y����r) rrrrrtrrr.rr)r{r�rrrr�r�=s��������� �E� /� ���S�$�s�)�^� 4��D��g��r�s���(�(�����,�,�,�,�,�,�,�,�,�,�=�=�=�=�=�=�=�=�=�=�=�=�=�=�2�2�2�2�2�2�9�9�9�9�9�9�9�9��A�������7�7�7�7�7�7�@�@�@�@�@�@������y����-�-�-�-�-��-�-�-�0�0�0�0�0��0�0�0�2�2�2�2�2�(�2�2�2� � � � � �� � � �>6�6�6�6�6�/�6�6�6�C�C�C�C�C�0�C�C�C� N�N�N�N�N�,�N�N�N�O�O�O�O�O�!2�O�O�O������(���� ;�;�;�;�;��;�;�;�B�B�B�B�B�8�B�B�B�E�E�E�E�E�H�E�E�E�#�#�#�#�#�X�#�#�#�2"�"�"�"�"�,�"�"�"������(����N�N�N�N�N�,�N�N�N�0 4� 4� 4� 4� 4�"3� 4� 4� 4�!�!�!�!�!�"�!�!�!�.+@�+@�+@�+@�+@�!�+@�+@�+@�\��������������)����' �' �' �' �' �)�' �' �' �T�����9����9 �9 �9 �9 �9 �9�9 �9 �9 �x�����0���� A�A�A�A�A�(:�A�A�A�A�Ar