OwlCyberSecurity - MANAGER
Edit File: package_finder.cpython-311.pyc
� �������h����������������� ������������d�Z�ddlZddlZddlZddlZddlZddlmZ�ddlm Z m Z mZmZm Z mZmZmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZmZ�dd lmZ�dd lmZmZmZm Z �ddl!m"Z"m#Z#�ddl$m%Z%�dd l&m'Z'�ddl(m)Z)�ddl*m+Z+�ddl,m-Z-�ddl.m/Z/�ddl0m1Z1�ddl2m3Z3�ddl4m5Z5�ddl6m7Z7�ddl8m9Z9�ddl:m;Z;�ddl<m=Z=�ddl>m?Z?�ddl@mAZA�e rddlBmCZC�g�d�ZD�e5eE������������ZFeed���������eeGeHf���������f���������ZIeeGeGeGee eG���������eIf���������ZJ �d:de)d eeGeGeGf���������d!eKd"eKfd#�ZL�G�d$��d%ejM��������������������ZN�G�d&��d'������������ZOd(ee%���������d)e e9���������d*eHd"ee%���������fd+�ZPe�G�d,��d-��������������������������ZQ�ed.�/�������������G�d0��d1��������������������������ZR�G�d2��d3������������ZS�G�d4��d5������������ZTd6eHd7eHd"eGfd8�ZUd6eHd7eHd"e eH���������fd9�ZVdS�);z!Routines related to PyPI, indexes�����N)� dataclass)� TYPE_CHECKING� FrozenSet�Iterable�List�Optional�Set�Tuple�Union)� specifiers)�Tag)�canonicalize_name)�InvalidVersion�_BaseVersion)�parse)�BestVersionAlreadyInstalled�DistributionNotFound�InvalidWheelFilename�UnsupportedWheel)� LinkCollector�parse_links)�InstallationCandidate)� FormatControl)�Link)�SearchScope)�SelectionPreferences)�TargetPython)�Wheel)�InstallRequirement)� getLogger)�WHEEL_EXTENSION)�Hashes)� indent_log)�build_netloc)�check_requires_python)�SUPPORTED_EXTENSIONS)� TypeGuard)r����BestCandidateResult� PackageFinder��F�link�version_info�ignore_requires_python�returnc���������������������� �t����������|�j��������|�������������}|spd���������������������t����������t����������|������������������������}|s$t �������������������������������d||�j��������|��������������dS�t �������������������������������d||�j��������|��������������n6#�t����������j ��������$�r$�t �������������������������������d|�j��������|��������������Y�nw�xY�wdS�)aa�� Return whether the given Python version is compatible with a link's "Requires-Python" value. :param version_info: A 3-tuple of ints representing the Python major-minor-micro version to check. :param ignore_requires_python: Whether to ignore the "Requires-Python" value if the given Python version isn't compatible. )r,����.z4Link requires a different Python (%s not in: %r): %sFzBIgnoring failed Requires-Python check (%s not in: %r) for link: %sz2Ignoring invalid Requires-Python (%r) for link: %sT) r%����requires_python�join�map�str�logger�verbose�debugr����InvalidSpecifier)r+���r,���r-���� is_compatible�versions��� �s/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/pip/_internal/index/package_finder.py�_check_link_requires_pythonr<���4���s��������-�� �%� �� �� � ���� ��h�h�s�3��5�5�6�6�G�)�� ����J���(�� �������u��L�L�T���$�� �� �� ���%��&�� �� �� ����@�� �� �� �� �� �� � ����2��4s����B��0B>�=B>c��������������������������e�Zd�Z�ej����������������������Z�ej����������������������Z�ej����������������������Z�ej����������������������Z�ej����������������������Z �ej����������������������Z �ej����������������������ZdS�)�LinkTypeN)�__name__� __module__�__qualname__�enum�auto� candidate�different_project�yanked�format_unsupported�format_invalid�platform_mismatch�requires_python_mismatchr*��������r;���r>���r>���c���so���������������� ���I�!�� ���� �T�Y�[�[�F�"�������T�Y�[�[�N�!�� ����(�t�y�{�{���rK���r>���c�������������������������e�Zd�ZdZ�ej��������d������������Z �ddededee���������de de d ee ���������d dfd�Zde d eeef���������fd �ZdS�)� LinkEvaluatorzD Responsible for evaluating links for a particular project. z-py([123]\.?[0-9]?)$N�project_name�canonical_name�formats� target_python�allow_yankedr-���r.���c������������������b�����|�d}||�_���������||�_��������||�_��������||�_��������||�_��������||�_��������dS�)a��� :param project_name: The user supplied package name. :param canonical_name: The canonical package name. :param formats: The formats allowed for this package. Should be a set with 'binary' or 'source' or both in it. :param target_python: The target Python interpreter to use when evaluating link compatibility. This is used, for example, to check wheel compatibility, as well as when checking the Python version, e.g. the Python version embedded in a link filename (or egg fragment) and against an HTML link's optional PEP 503 "data-requires-python" attribute. :param allow_yanked: Whether files marked as yanked (in the sense of PEP 592) are permitted to be candidates for install. :param ignore_requires_python: Whether to ignore incompatible PEP 503 "data-requires-python" values in HTML links. Defaults to False. NF)� _allow_yanked�_canonical_name�_ignore_requires_python�_formats�_target_pythonrN���)�selfrN���rO���rP���rQ���rR���r-���s��� r;����__init__zLinkEvaluator.__init__x���sE������4�"�)�%*�"�)���-���'=��$��� �+���(����rK���r+���c����������������������d}|j���������r!|�j��������s|j��������pd}t����������j��������d|���fS�|j��������r|j��������}|j��������}�no|�����������������������������������\��}}|st����������j��������dfS�|t����������vrt����������j��������d|���fS�d|�j ��������vr#|t����������k����rd|�j�����������}t����������j��������|fS�d|j ��������v�r|d k����rt����������j��������d fS�|t����������k����r� �t����������|j��������������������}n#�t ����������$�r�t����������j��������dfcY�S�w�xY�wt%����������|j��������������������|�j��������k����rd|�j����������d �}t����������j��������|fS�|�j�������������������������������������������}|���������������������|������������s;d���������������������|�����������������������������������������������}d|��d�}t����������j��������|fS�|j��������}d|�j ��������vr#|t����������k����rd|�j�����������}t����������j��������|fS�|st;����������||�j��������������������}|sd|�j�����������}t����������j��������|fS�|�j�����������������������������|������������} | rO|d| � ��������������������������������������������}| �!��������������������d������������} | |�j��������j"��������k����rt����������j��������dfS�tG����������||�j��������j$��������|�j%���������������������}|s|��d|j&�����������}t����������j'��������|fS�tP�����������)��������������������d||�������������t����������j*��������|fS�)a��� Determine whether a link is a candidate for installation. :return: A tuple (result, detail), where *result* is an enum representing whether the evaluation found a candidate, or the reason why one is not found. If a candidate is found, *detail* will be the candidate's version string; if one is not found, it contains the reason the link fails to qualify. Nz<none given>zyanked for reason: z not a filezunsupported archive format: �binaryzNo binaries permitted for �macosx10z.zipzmacosx10 onezinvalid wheel filenamezwrong project name (not �)�, znone of the wheel's tags (zB) are compatible (run pip debug --verbose to show compatible tags)�sourcezNo sources permitted for zMissing project version for ����zPython version is incorrect)r,���r-���z Requires-Python zFound link %s, version: %s)+� is_yankedrT���� yanked_reasonr>���rF����egg_fragment�ext�splitextrG���r&���rW���r!���rN����pathr����filenamer���rH���r����namerU���rE���rX����get_unsorted_tags� supportedr2����get_formatted_file_tagsrI���r:����_extract_version_from_fragment�_py_version_re�search�start�group� py_versionr<����py_version_inforV���r1���rJ���r5���r7���rD���)rY���r+���r:����reason�egg_infore����wheel�supported_tags� file_tags�matchrr����supports_pythons��� r;���� evaluate_linkzLinkEvaluator.evaluate_link����sz���������>�� E�$�"4�� E��'�9�>�F��O�%C�6�%C�%C�D�D����( (��(�H��(�C�C� �M�M�O�O�M�H�c��� C� �3�\�B�B��.�.�.��/�8�3�8�8������t�}�,�,���1G�1G�I�d�6G�I�I�� �3�V�<�<��T�Y�&�&�3�&�=�=� �3�^�D�D��o�%�%��!�$�-�0�0�E�E��+������� �/�0������������ �%�U�Z�0�0�D�4H�H�H�L��8I�L�L�L�F�$�6��?�?�!%�!4�!F�!F�!H�!H�����~�6�6��@��!%� � �%�*G�*G�*I�*I� J� J�I�M�Y��M��M��M����%�6��?�?��-����4�=�(�(�S�O�-C�-C�D��1B�D�D�F��/��8�8��� �4���$����G���� 5�G�D�4E�G�G�F��+�V�4�4��#�*�*�7�3�3���� ��o���� � �o�.�G����Q���J��T�0�;�;�;��.�1���� �6���,�<�#'�#?� �� �� �� ��� ?��H�H�$�2F�H�H�F��5�v�>�>����1�4��A�A�A��"�G�,�,s����C-��-D�D�N)r?���r@���rA����__doc__�re�compilern���r4���r���r����boolr���rZ���r���r ���r>���r{���r*���rK���r;���rM���rM���m���s������������������� �R�Z� 7�8�8�N��26�#)��#)��#)���#)���3�� #)� �$�#)��� #)��!)���#)�� �#)��#)��#)��#)�J\-�$��\-�5��3��+?��\-��\-��\-��\-��\-��\-rK���rM���� candidates�hashesrN���c����������� �����������|s8t��������������������������������dt����������|�������������|�������������t����������|�������������S�g�}g�}d}|�D�]X}|j��������}|j��������sn2|���������������������|�������������r|dz ��}n|���������������������|��������������C|���������������������|��������������Y|r|}nt����������|�������������}t����������|������������t����������|�������������k����rd} n@d���������������������t����������|������������d� ��������������������d��|D���������������������������������������} t��������������������������������d t����������|�������������||j ��������|t����������|������������|z ��| �������������|S�) a��� Filter out candidates whose hashes aren't allowed, and return a new list of candidates. If at least one candidate has an allowed hash, then all candidates with either an allowed hash or no hash specified are returned. Otherwise, the given candidates are returned. Including the candidates with no hash specified when there is a match allows a warning to be logged if there is a more preferred candidate with no hash specified. Returning all candidates in the case of no matches lets pip report the hash of the candidate that would otherwise have been installed (e.g. permitting the user to more easily update their requirements file with the desired hash). zJGiven no hashes to check %s links for project %r: discarding no candidatesr���)r����ra���zdiscarding no candidateszdiscarding {} non-matches: {}z c��������������3����>���K����|�]}t����������|j��������������������V����d�S�r|���)r4���r+���)�.0rD���s��� r;���� <genexpr>z*filter_unallowed_hashes.<locals>.<genexpr>5��s,����������I�I� ��I�N�+�+�I�I�I�I�I�IrK���zPChecked %s links for project %r against %s hashes (%s matches, %s no digest): %s)r5���r7����len�listr+����has_hash�is_hash_allowed�append�formatr2����digest_count) r����r����rN����matches_or_no_digest�non_matches�match_countrD���r+����filtered�discard_messages ��� r;����filter_unallowed_hashesr��������s������(��� ���� '�� �O�O�� �� �� ���J�������K��K��� /�� /� ��~���}�� �� � !� !�� !� 0� 0�� ��1��K�K����y�)�)�)���#�#�I�.�.�.�.���$�'����� �#�#�� �8�}�}��J���'�'�4���<�C�C������K�K�I�I�[�I�I�I�I�I� �� �� ��L�L� )��J�������� �!�!�K�/�� �� �� ���OrK���c��������������������0�����e�Zd�ZU�dZdZeed<���dZeed<���dS�)�CandidatePreferenceszk Encapsulates some of the preferences for filtering and sorting InstallationCandidate objects. F� prefer_binary�allow_all_prereleasesN)r?���r@���rA���r}���r����r�����__annotations__r����r*���rK���r;���r����r����F��s?������������������� � �M�4����"'��4�'�'�'�'�'rK���r����T)�frozenc��������������������^�����e�Zd�ZU�dZee���������ed<���ee���������ed<���ee���������ed<���dd�ZdS�) r(���a���A collection of candidates, returned by `PackageFinder.find_best_candidate`. This class is only intended to be instantiated by CandidateEvaluator's `compute_best_candidate()` method. :param all_candidates: A sequence of all available candidates found. :param applicable_candidates: The applicable candidates. :param best_candidate: The most preferred candidate found, or None if no applicable candidates were found. �all_candidates�applicable_candidates�best_candidater.���Nc�����������������������t����������|�j��������������������t����������|�j��������������������k����sJ��|�j���������|�j��������rJ��d�S�|�j��������|�j��������v�sJ��d�S�r|���)�setr����r����r�����rY���s��� r;���� __post_init__z!BestCandidateResult.__post_init__b��sd�������4�-�.�.�#�d�6I�2J�2J�J�J�J�J���&��1�1�1�1�1�1��&�$�*D�D�D�D�D�D�DrK����r.���N) r?���r@���rA���r}���r���r���r����r���r����r*���rK���r;���r(���r(���Q��sr���������������� �� ���.�/�/�/�/�� 5�6�6�6�6��2�3�3�3�3�E��E��E��E��E��ErK���r(���c��������������������J����e�Zd�ZdZe � � � � �ddedee���������dededee j �����������������d ee���������d d�fd���������������Z � � �ddede e���������de j ��������deded ee���������d dfd �Zde e���������d e e���������fd�Zded efd�Zde e���������d ee���������fd�Zde e���������d efd�ZdS�)�CandidateEvaluatorzm Responsible for filtering and sorting candidates for installation based on what tags are valid. NFrN���rQ���r����r����� specifierr����r.���c�����������������������|�t������������������������}|�t����������j����������������������}|�����������������������������������}�|�||||||�������������S�)a���Create a CandidateEvaluator object. :param target_python: The target Python interpreter to use when checking compatibility. If None (the default), a TargetPython object will be constructed from the running Python. :param specifier: An optional object implementing `filter` (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable versions. :param hashes: An optional collection of allowed hashes. N)rN���rw���r����r����r����r����)r���r����SpecifierSet�get_sorted_tags)�clsrN���rQ���r����r����r����r����rw���s��� r;����createzCandidateEvaluator.createq��sc������(�� �(�N�N�M���"�/�1�1�I�&�6�6�8�8���s�%�)��'�"7�� �� �� �� rK���rw���c�����������������������||�_���������||�_��������||�_��������||�_��������||�_��������||�_��������d��t ����������|������������D���������������|�_��������dS�)z� :param supported_tags: The PEP 425 tags supported by the target Python in order of preference (most preferred first). c�����������������������i�|�]\��}}||�� S�r*���r*���)r�����idx�tags��� r;���� <dictcomp>z/CandidateEvaluator.__init__.<locals>.<dictcomp>���s+�������' ��' ��' �!��c�C��' ��' ��' rK���N)�_allow_all_prereleases�_hashes�_prefer_binary� _project_name� _specifier�_supported_tags� enumerate�_wheel_tag_preferences)rY���rN���rw���r����r����r����r����s��� r;���rZ���zCandidateEvaluator.__init__���sa�������'<��#����+���)���#���-���' ��' �%.�~�%>�%>�' ��' ��' ��#�#�#rK���r����c�����������������������|�j���������pd}|�j��������}d��|D���������������}t����������|���������������������d��|D���������������|���������������������������fd�|D���������������}t ����������||�j��������|�j���������������������}t����������||�j���������������������S�)zM Return the applicable candidates from a list of candidates. Nc������������������:�����g�|�]}|t����������|j��������������������f��S�r*����r4���r:����r�����cs��� r;���� <listcomp>z@CandidateEvaluator.get_applicable_candidates.<locals>.<listcomp>���s%������"K�"K�"K�1�A�s�1�9�~�~�#6�"K�"K�"KrK���c��������������3���� ���K����|�] \��}}|V���� d�S�r|���r*���)r�����_�vs��� r;���r����z?CandidateEvaluator.get_applicable_candidates.<locals>.<genexpr>���s&����������7�7�t�q�!��7�7�7�7�7�7rK���)�prereleasesc������������������"������g�|�]\��}}|�v�� |��S�r*���r*���)r����r����r�����versionss��� �r;���r����z@CandidateEvaluator.get_applicable_candidates.<locals>.<listcomp>���s"������� X� X� X�t�q�!�!�x�-�-��-�-�-rK���)r����r����rN�����key) r����r����r�����filterr����r����r�����sorted� _sort_key)rY���r�����allow_prereleasesr�����candidates_and_versionsr�����filtered_applicable_candidatesr����s��� @r;����get_applicable_candidatesz,CandidateEvaluator.get_applicable_candidates���s���������!�7�?�4���O� ��#L�"K� �"K�"K�"K������7�7�6�7�7�7�-�� �� �� � �� ���!Y� X� X� X�/F� X� X� X��)@�,��<��+�* ��* ��* �&���4�$�.�I�I�I�IrK���rD���c������������������l����|�j���������}t����������|������������}d}d}|j��������}|j��������r�t ����������|j��������������������} �|���������������������||�j���������������������}n%#�t����������$�r�t����������|j����������d��������������w�xY�w|�j ��������rd}|j���������Wt����������j ��������d|j��������������������} | � J�d���������������| �����������������������������������} t����������| d���������������������| d���������f}n|�}t����������|���������������������|�j��������������������������������}dt����������|j��������������������z��}||||j��������||fS�) a)�� Function to pass as the `key` argument to a call to sorted() to sort InstallationCandidates by preference. Returns a tuple such that tuples sorting as greater using Python's default comparison operator are more preferred. The preference is as follows: First and foremost, candidates with allowed (matching) hashes are always preferred over candidates without matching hashes. This is because e.g. if the only candidate with an allowed hash is yanked, we still want to use that candidate. Second, excepting hash considerations, candidates that have been yanked (in the sense of PEP 592) are always less preferred than candidates that haven't been yanked. Then: If not finding wheels, they are sorted by version only. If finding wheels, then the sort order is by version, then: 1. existing installs 2. wheels ordered via Wheel.support_index_min(self._supported_tags) 3. source archives If prefer_binary was set, then all wheels are sorted above sources. Note: it was considered to embed this logic into the Link comparison operators, but then different sdist links with the same version, would have to be considered equal r*���r���z@ is not a supported wheel for this platform. It can't be sorted.ra���Nz^(\d+)(.*)$z!guaranteed by filename validation���)r����r����r+����is_wheelr���rh����find_most_preferred_tagr����� ValueErrorr���r����� build_tagr~���ry����groups�intr����r����rb���r:���) rY���rD���� valid_tags�support_numr�����binary_preferencer+���rv����priry����build_tag_groups�has_allowed_hash� yank_values ��� r;���r����zCandidateEvaluator._sort_key���sv�����<��)� ��*�o�o�� � ����~���=�� !��$�-�(�(�E� ��1�1�"�D�$?�������� ��� �� �� �&��~��'��'��'������ ���� ��"�� &�$%�!���*������A�A���(�(�*M�(�(�(�#(�<�<�>�>� � �!1�!�!4�5�5�7G��7J�K� ���.�C��t�3�3�D�L�A�A�B�B���#�d�n�-�-�-� �������� �� s����A��"A=c������������������:�����|sdS�t����������||�j���������������������}|S�)zy Return the best candidate per the instance's sort order, or None if no candidate is acceptable. Nr����)�maxr����)rY���r����r����s��� r;����sort_best_candidatez&CandidateEvaluator.sort_best_candidate��s+��������� ��4��Z�T�^�<�<�<���rK���c������������������z�����|�����������������������|������������}|����������������������|������������}t����������|||�������������S�)zF Compute and return a `BestCandidateResult` instance. )r����r����)r����r����r(���)rY���r����r����r����s��� r;����compute_best_candidatez)CandidateEvaluator.compute_best_candidate$��sL�������!%� >� >�z� J� J���1�1�2G�H�H��"��"7�)� �� �� �� rK���)NFFNN)FFN)r?���r@���rA���r}����classmethodr4���r���r���r����r���� BaseSpecifierr"���r����r���r ���rZ���r���r�����CandidateSortingKeyr����r����r(���r����r*���rK���r;���r����r����k��s����������������� ���15�#�&+�8<�#'�! ��! ��! �� ��-�! ��� ! � � $�! ���J�4�5� ! ���� �! �� �! ��! ��! ���[�! �P�$�&+�#'� �� �� ���S� � ���+� � �� �� $� ���� � �� � �� �� �� �4!J��.�/�!J�� �#� $�!J��!J��!J��!J�FC �#8��C �=P��C ��C ��C ��C �J��.�/��� �'� (�������� ��.�/� �� � �� �� �� �� �� rK���r����c�������������������� ����e�Zd�ZdZ � � �d2dedededee���������dee ���������dee���������d dfd �Z e �d3dededee���������d d�fd���������������Z ed efd ���������������Zed efd���������������Zej��������ded dfd���������������Zed ee���������fd���������������Zed ee���������fd���������������Zed ee���������fd���������������Zed ee���������fd���������������Zed ee���������fd���������������Zed ee���������fd���������������Zed efd���������������Zd4d�Zed efd���������������Zd4d�Zd ee���������fd�Z ded e!fd�Z"dee#���������d ee#���������fd�Z$d e#d!e%d"ed dfd#�Z&d$e!d e#d ee'���������fd%�Z(d$e!dee#���������d ee'���������fd&�Z)d'e#d$e!d ee'���������fd(�Z*�e+j,��������d�)������������ded ee'���������fd*���������������Z- � �d5ded+ee.j/�����������������d,ee0���������d e1fd-�Z2�e+j,��������d�)������������ � �d5ded+ee.j/�����������������d,ee0���������d e3fd.���������������Z4d/e5d0ed ee'���������fd1�Z6dS�)6r)���z�This finds packages. This is meant to match easy_install's technique for looking for packages, by reading pages and looking for appropriate links. N�link_collectorrQ���rR����format_control�candidate_prefsr-���r.���c������������������������|�t������������������������}|p't����������t������������������������t������������������������������������}||�_��������||�_��������||�_��������||�_��������||�_��������||�_��������t������������������������|�_ ��������dS�)a��� This constructor is primarily meant to be used by the create() class method and from tests. :param format_control: A FormatControl object, used to control the selection of source packages / binary packages when consulting the index and links. :param candidate_prefs: Options to use when creating a CandidateEvaluator object. N) r����r���r����rT����_candidate_prefsrV����_link_collectorrX���r����� _logged_links)rY���r����rQ���rR���r����r����r-���s��� r;���rZ���zPackageFinder.__init__=��sv������&��"�2�4�4�O�'�F�=�������+F�+F��)��� /���'=��$�-���+���,����?B�e�e����rK����selection_prefsc�����������������������|�t������������������������}t����������|j��������|j���������������������}�|�||||j��������|j��������|j���������������������S�)af��Create a PackageFinder. :param selection_prefs: The candidate selection preferences, as a SelectionPreferences object. :param target_python: The target Python interpreter to use when checking compatibility. If None (the default), a TargetPython object will be constructed from the running Python. N)r����r����)r����r����rQ���rR���r����r-���)r���r����r����r����rR���r����r-���)r����r����r����rQ���r����s��� r;���r����zPackageFinder.created��si�������� �(�N�N�M�.�)�7�"1�"G� �� �� �� ��s�+�)�'�(�5�*�9�#2�#I� �� �� �� rK���c�����������������������|�j���������S�r|���)rX���r����s��� r;���rQ���zPackageFinder.target_python���s�������"�"rK���c�����������������������|�j���������j��������S�r|����r�����search_scoper����s��� r;���r����zPackageFinder.search_scope���s�������#�0�0rK���r����c�����������������������||�j���������_��������d�S�r|���r����)rY���r����s��� r;���r����zPackageFinder.search_scope���s������,8���)�)�)rK���c�����������������������|�j���������j��������S�r|���)r����� find_linksr����s��� r;���r����zPackageFinder.find_links���s�������#�.�.rK���c�����������������������|�j���������j��������S�r|���)r����� index_urlsr����s��� r;���r����zPackageFinder.index_urls���s������� �+�+rK���c������������������$�����|�j���������j��������j��������S�r|���)r�����session� pip_proxyr����s��� r;����proxyzPackageFinder.proxy���s�������#�+�5�5rK���c��������������#����H���K����|�j���������j��������j��������D�] }t����������|��V����d�S�r|���)r����r�����pip_trusted_originsr$���)rY���� host_ports��� r;���� trusted_hostszPackageFinder.trusted_hosts���s<�����������-�5�I�� +�� +�I�� �*�*�*�*�*� +�� +rK���c������������������V�����|�j���������j��������j��������}t����������|t����������������������r|nd�S�r|���)r����r�����verify� isinstancer4���)rY���r���s��� r;����custom_certzPackageFinder.custom_cert���s+������ ��%�-�4��#�F�C�0�0�:�v�v�d�:rK���c������������������f�����|�j���������j��������j��������}t����������|t����������������������r J�d���������������|S�)Nz"pip only supports PEM client certs)r����r�����certr���tuple)rY���r��s��� r;����client_certzPackageFinder.client_cert���s4�������#�+�0���d�E�*�*�P�P�,P�P�P�*��rK���c�����������������������|�j���������j��������S�r|����r����r����r����s��� r;���r����z#PackageFinder.allow_all_prereleases���s�������$�:�:rK���c�����������������������d|�j���������_��������d�S��NTr��r����s��� r;����set_allow_all_prereleasesz'PackageFinder.set_allow_all_prereleases���s������6:���3�3�3rK���c�����������������������|�j���������j��������S�r|����r����r����r����s��� r;���r����zPackageFinder.prefer_binary���s�������$�2�2rK���c�����������������������d|�j���������_��������d�S�r ��r ��r����s��� r;����set_prefer_binaryzPackageFinder.set_prefer_binary���s������.2���+�+�+rK���c������������������B�����d��|�j���������D���������������}t����������|������������S�)Nc������������������:�����h�|�]\��}}}|t�����������j��������k�����|��S�r*���)r>���rJ���)r����r�����result�details��� r;���� <setcomp>z@PackageFinder.requires_python_skipped_reasons.<locals>.<setcomp>���s6������� �� �� �!��6�6���:�:�:�� �:�:�:rK���)r����r����)rY����reasonss��� r;����requires_python_skipped_reasonsz-PackageFinder.requires_python_skipped_reasons���s1������ �� �%)�%7� �� �� �� ��g���rK���rN���c�����������������������t����������|������������}|�j�����������������������������|������������}t����������||||�j��������|�j��������|�j���������������������S�)N)rN���rO���rP���rQ���rR���r-���)r���r�����get_allowed_formatsrM���rX���rT���rV���)rY���rN���rO���rP���s��� r;����make_link_evaluatorz!PackageFinder.make_link_evaluator���sW������*�<�8�8���%�9�9�.�I�I���%�)���-��+�#'�#?� �� �� �� rK����linksc������������������������g�g�}}t������������������������}|D�]M}||vrG|���������������������|�������������|j��������r|���������������������|��������������8|���������������������|��������������N||z���S�)z� Returns elements of links in order, non-egg links first, egg links second, while eliminating duplicates )r�����addrd���r����)rY���r���eggs�no_eggs�seenr+���s��� r;����_sort_linkszPackageFinder._sort_links���s|������ ��B�g���%�%���� )�� )�D��4�����������$��)��K�K��%�%�%�%��N�N�4�(�(�(����~�rK���r+���r��r��c������������������������t��������������������������������t����������j��������������������sd�S�|||f}||�j��������vr8t��������������������������������d||�������������|�j�����������������������������|�������������d�S�d�S�)NzSkipping link: %s: %s)r5����isEnabledFor�logging�DEBUGr����r7���r��)rY���r+���r��r���entrys��� r;����_log_skipped_linkzPackageFinder._log_skipped_link���sy��������"�"�7�=�1�1�� ��F��v�v�&����*�*�*�� �L�L�0�&�$�?�?�?���"�"�5�)�)�)�)�)� �+�*rK����link_evaluatorc������������������������|����������������������|������������\��}}|t����������j��������k����r|����������������������|||�������������dS� �t ����������|j��������||�������������S�#�t����������$�r�Y�dS�w�xY�w)z� If the link is a candidate for install, convert it to an InstallationCandidate and return it. Otherwise, return None. N)ri���r+���r:���)r{���r>���rD���r&��r���rN���r���)rY���r'��r+���r��r��s��� r;����get_install_candidatez#PackageFinder.get_install_candidate���s��������(�5�5�d�;�;�����X�'�'�'��"�"�4���8�8�8��4� �(�#�0��������� �� ��� �� �� ��4�4� ���s����A�� A(�'A(c�����������������������g�}|�����������������������|������������D�]/}|����������������������||������������}|�|���������������������|��������������0|S�)zU Convert links that are candidates to InstallationCandidate objects. )r ��r)��r����)rY���r'��r��r����r+���rD���s��� r;����evaluate_linkszPackageFinder.evaluate_links��s\�������� ��$�$�U�+�+�� -�� -�D��2�2�>�4�H�H�I��$��!�!�)�,�,�,���rK����project_urlc������������������*����t��������������������������������d|�������������|�j�����������������������������|������������}|�g�S�t ����������t����������|������������������������}t ������������������������5��|����������������������||�������������}d�d�d��������������n#�1�swxY�w�Y���|S�)Nz-Fetching project page and analyzing links: %s)r��)r5���r7���r�����fetch_responser����r���r#���r+��)rY���r,��r'���index_response� page_links� package_linkss��� r;����process_project_urlz!PackageFinder.process_project_url��s�������� ���;�� �� �� ���-�<�<�[�I�I���!��I��+�n�5�5�6�6� � �\�\�� �� � �/�/�� ��0�����M� �� �� �� �� �� �� �� �� �� �� ����� �� �� �� ���s����$B�B�B)�maxsizec����������������������|�����������������������|������������}|�j�����������������������������|t����������j��������|�j��������|��������������������������}t����������j�����������������������������d��|D���������������������������}t����������|������������}t����������j�����������������������������d��|D���������������������������}|�� ��������������������|t����������|d�������������������������}t����������� ��������������������t����������j��������������������r�|r�g�}|D�]_} | j��������j��������sJ�� �|���������������������| j��������j����������������������1#�t(����������$�r"�|���������������������| j��������j���������������������Y��\w�xY�wt�������������������������������dd���������������������|�������������������������||z���S�) a��Find all available InstallationCandidate for project_name This checks index_urls and find_links. All versions found are returned as an InstallationCandidate list. See LinkEvaluator.evaluate_link() for details on which files are accepted. )r'��)rN����candidates_from_pagec��������������3����L���K����|�]}|D�]}|�|������������������������������������V����� d�S�r|���)�page_candidates�r�����sourcesr`���s��� r;���r����z4PackageFinder.find_all_candidates.<locals>.<genexpr>;��sW�����������; ��; ��!�; ��; ����!�� �"�"�$�$��"�!�!�!�!� ; ��; rK���c��������������3����L���K����|�]}|D�]}|�|������������������������������������V����� d�S�r|���)� file_linksr8��s��� r;���r����z4PackageFinder.find_all_candidates.<locals>.<genexpr>C��sW�����������6 ��6 ��!�6 ��6 ����!�� ������"�!�!�!�!� 6 ��6 rK���T)�reversezLocal files found: %sr_���)r��r�����collect_sources� functools�partialr2��� itertools�chain� from_iterabler����r+��r����r5���r"��r#��r$��r+����urlr����� file_path� Exceptionr7���r2���) rY���rN���r'���collected_sources�page_candidates_itr7��� file_links_it�file_candidates�pathsrD���s ��� r;����find_all_candidatesz!PackageFinder.find_all_candidates'��s��������1�1�,�?�?�� �0�@�@�%�!*�!2��(�-�"��"��"��A�� �� ���'�_�:�:��; ��; �,�; ��; ��; �� �� ����1�2�2��!��5�5��6 ��6 �,�6 ��6 ��6 �� �� � ���-�-���=�$�/�/�/� �� �� ����w�}�-�-�� D�/�� D��E�,�� 5�� 5� � �~�)�)�)�)�5��L�L���!9�:�:�:�:�� ��5��5��5��L�L���!3�4�4�4�4�4�5����� �L�L�0�$�)�)�E�2B�2B�C�C�C����0�0s����D,�,)E�Er����r����c������������������n�����|�j���������}t�������������������������������||�j��������|j��������|j��������||�������������S�)z*Create a CandidateEvaluator object to use.)rN���rQ���r����r����r����r����)r����r����r����rX���r����r����)rY���rN���r����r����r����s��� r;����make_candidate_evaluatorz&PackageFinder.make_candidate_evaluator\��sD��������/��!�(�(�%��-�)�7�"1�"G��� �)�� �� �� rK���c�����������������������|�����������������������|������������}|����������������������|||�������������}|���������������������|������������S�)a��Find matches for the given project and specifier. :param specifier: An optional object implementing `filter` (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable versions. :return: A `BestCandidateResult` instance. )rN���r����r����)rK��rM��r����)rY���rN���r����r����r�����candidate_evaluators��� r;����find_best_candidatez!PackageFinder.find_best_candidatem��sQ��������-�-�l�;�;� �"�;�;�%����<�� �� �� �#�9�9�*�E�E�ErK����req�upgradec������������������������|����������������������d�������������}|����������������������|j��������|j��������|�������������}|j���������d�|j���������|j��������j���������dt����������t�������������������dt����������fd�}��>��<t�������������������������������d|�||j���������������������������������t����������d |����������������d t����������t�������������������ddf��fd�}|sL��J�|�������������r"t�������������������������������d ��j���������������������nt�������������������������������d��������������dS��|�������������r1t�������������������������������d�j���������||j����������������������������������S�t�������������������������������d��||j���������������������������������t"�����������)z�Try to find a Link matching req Expects req, an InstallRequirement and upgrade, a boolean Returns a InstallationCandidate if found, Raises DistributionNotFound or BestVersionAlreadyInstalled otherwise F)�trust_internet)r����r����N� cand_iterr.���c������������������l�����d����������������������t����������d��|�D���������������t�����������������������������������pdS�)Nr_���c������������������6�����h�|�]}t����������|j����������������������S�r*���r����r����s��� r;���r��zKPackageFinder.find_requirement.<locals>._format_versions.<locals>.<setcomp>���s ������;�;�;�A��Q�Y���;�;�;rK���r�����none)r2���r����� parse_version)rU��s��� r;����_format_versionsz8PackageFinder.find_requirement.<locals>._format_versions���sJ�������� � ��;�;��;�;�;�)������������� rK���zNCould not find a version that satisfies the requirement %s (from versions: %s)z#No matching distribution found for rD���z TypeGuard[InstallationCandidate]c������������������*��������dS���dS��j����������k����S�)NTF)r:���)rD���r�����installed_versions��� ��r;����_should_install_candidatezAPackageFinder.find_requirement.<locals>._should_install_candidate���s*��������!�(��t��%��u�!�)�,=�=�=rK���zUExisting installed version (%s) satisfies requirement (most up-to-date version is %s)zLExisting installed version (%s) is most up-to-date and satisfies requirementz)Using version %s (newest of versions: %s)z=Installed version (%s) is most up-to-date (past versions: %s))r����rP��ri���r����r�����satisfied_byr:���r���r���r4���r5����criticalr����r���r���r7���r����r���) rY���rQ��rR��r�����best_candidate_resultrZ��r]��r����r\��s ��� @@r;����find_requirementzPackageFinder.find_requirement���s�����������5��1�1�� $� 8� 8��H��m���!9��! ��! �� �/�=��48����'� #� 0� 8�� ��1F�(G�� �C�� �� �� �� ���$��)?��O�O�&�� � �!6�!E�F�F� �� �� ��'�'R�S�'R�'R�S�S�S� >�� 5�6� >� /� >�� >�� >�� >�� >�� >�� >���� �,�8�(�(��8�8�� ����6�%�"�*� �����������,�%������ ��4�$�$�^�4�4�� "��L�L�;��&� � �!6�!L�M�M� �� �� � �"�!�� ���K����2�H�I�I� �� �� � �*�)rK���)NNNr|���r����)NN)7r?���r@���rA���r}���r���r���r����r���r���r����rZ���r����r���r�����propertyrQ���r���r�����setterr���r4���r����r����r����r���r����r��r��r����r��r����r��r��rM���r��r���r ��r>���r&��r���r)��r+��r2��r>��� lru_cacherK��r���r����r"���r����rM��r(���rP��r���ra��r*���rK���r;���r)���r)���6��ss�����������������37�:>�15�!D��!D�%�!D��$�!D��� !D� �!��/�!D��"�"6�7� !D��!)���!D�� �!D��!D��!D��!D�N�� �15� �� �%� ��.� �� ��-� � � � �� �� ���[� �>��#�|��#��#��#���X�#���1�k��1��1��1���X�1����9���9���9��9��9����9���/�D��I��/��/��/���X�/���,�D��I��,��,��,���X�,���6�x��}��6��6��6���X�6���+�x��}��+��+��+���X�+���;�X�c�]��;��;��;���X�;����X�c�]���������X�� ��;�t��;��;��;���X�;�;��;��;��;���3�t��3��3��3���X�3�3��3��3��3���c���������� ��� � �� �� �� �� ���$����D��J��������� *�d��*�H��*�c��*�d��*��*��*��*��+��37�� �'� (��������*�+��4<�T�N�� �#� $�����������1>�� �#� $��������*��Y���&�&�&�21���21��=R�8S��21��21��21��'�&�21�n�9=�#'� �� �� ���J�4�5� ���� � � � � �� �� �� �"��Y���&�&�&��9=�#'� F��F��F���J�4�5�F���� � F� � �F��F��F��'�&�F�,U*�%�U*�04�U*� �'� (�U*��U*��U*��U*��U*��U*rK���r)����fragmentrO���c�����������������������t����������|�������������D�]+\��}}|dk����r�t����������|�d|����������������������|k����r|c�S��,t����������|���d|����������������)a���Find the separator's index based on the package's canonical name. :param fragment: A <package>+<version> filename "fragment" (stem) or egg fragment. :param canonical_name: The package's canonical name. This function is needed since the canonicalized name does not necessarily have the same length as the egg info's name part. An example:: >>> fragment = 'foo__bar-1.0' >>> canonical_name = 'foo-bar' >>> _find_name_version_sep(fragment, canonical_name) 8 �-Nz does not match )r����r���r����)re��rO����ir����s��� r;����_find_name_version_sepri�����sp������$��(�#�#�������1���8�8���X�b�q�b�\�*�*�n�<�<��H�H�H��=� ��B�B�.�B�B� C� C�CrK���c������������������n����� �t����������|�|������������dz���}n#�t����������$�r�Y�dS�w�xY�w|�|d����������}|sdS�|S�)z�Parse the version string from a <package>+<version> filename "fragment" (stem) or egg fragment. :param fragment: The string to parse. E.g. foo-2.1 :param canonical_name: The canonicalized name of the package this belongs to. ra���N)ri��r����)re��rO���� version_startr:���s��� r;���rm���rm������s_�������.�x��H�H�1�L� � ����������t�t������}�~�~�&�G�����t��Ns������ $�$)F)Wr}���rB���r>��r@��r#��r~����dataclassesr����typingr���r���r���r���r���r ���r ���r����pip._vendor.packagingr����pip._vendor.packaging.tagsr ����pip._vendor.packaging.utilsr����pip._vendor.packaging.versionr���r���r���rY���pip._internal.exceptionsr���r���r���r����pip._internal.index.collectorr���r����pip._internal.models.candidater����#pip._internal.models.format_controlr����pip._internal.models.linkr����!pip._internal.models.search_scoper����$pip._internal.models.selection_prefsr����"pip._internal.models.target_pythonr����pip._internal.models.wheelr����pip._internal.reqr����pip._internal.utils._logr ����pip._internal.utils.filetypesr!����pip._internal.utils.hashesr"����pip._internal.utils.loggingr#����pip._internal.utils.miscr$����pip._internal.utils.packagingr%����pip._internal.utils.unpackingr&����pip._vendor.typing_extensionsr'����__all__r?���r5���r����r4����BuildTagr����r����r<����Enumr>���rM���r����r����r(���r����r)���ri��rm���r*���rK���r;����<module>r������s�����'��'���������������������������� � � � ��!��!��!��!��!��!��X��X��X��X��X��X��X��X��X��X��X��X��X��X��X��X��X��X��X��X��,��,��,��,��,��,��*��*��*��*��*��*��9��9��9��9��9��9��F��F��F��F��F��F��F��F��@��@��@��@��@��@�������������������������E��D��D��D��D��D��D��D��@��@��@��@��@��@��=��=��=��=��=��=��*��*��*��*��*��*��9��9��9��9��9��9��E��E��E��E��E��E��;��;��;��;��;��;��,��,��,��,��,��,��0��0��0��0��0��0��.��.��.��.��.��.��9��9��9��9��9��9��-��-��-��-��-��-��2��2��2��2��2��2��1��1��1��1��1��1��?��?��?��?��?��?��>��>��>��>��>��>���8�7�7�7�7�7�7� C� C� C��� ��8� � ����r��E�#�s�(�O�+�,���C��c�<��#���P�Q����$)�,��,� �,���S�#� �&�,��!�,�� � ,��,��,��,�^+��+��+��+��+�t�y��+��+��+�L-��L-��L-��L-��L-��L-��L-��L-�^G��*�+�G��V��G���G�� � � � G��G��G��G�T��(��(��(��(��(��(��(����(����$����E��E��E��E��E��E��E����E�2H ��H ��H ��H ��H ��H ��H ��H �Vc*��c*��c*��c*��c*��c*��c*��c*�L D�S��D�#��D�#��D��D��D��D�4�S���#���(�SV�-������������rK���