� ��^i��� ���dZddlZddlZddlZddlZddlmZmZmZm Z m Z m Z m Z ddl mZddlmZddlmZddlmZddlmZdd lmZmZmZmZdd lmZmZdd lm Z dd l!m"Z"dd l#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ddl;mZ>gd�Z?e0e@��ZAe e de eBeCffZDe eBeBeBee eBeDfZE d5de$de eBeBeBfd eFd!eFfd"�ZGGd#�d$��ZHd%ee d&e4d'eCd!ee fd(�ZIGd)�d*��ZJGd+�d,��ZKGd-�d.��ZLGd/�d0��ZMd1eCd2eCd!eBfd3�ZNd1eCd2eCd!e eCfd4�ZOdS)6z!Routines related to PyPI, indexes�N)� FrozenSet�Iterable�List�Optional�Set�Tuple�Union)� specifiers)�Tag)�canonicalize_name)� _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)� url_to_path)r�BestCandidateResult� PackageFinder�F�link� version_info�ignore_requires_python�returnc�� t|j|���}|spd�tt|����}|s$t �d||j|��dSt �d||j|��n6#tj $r$t �d|j|��YnwxYwdS)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 ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/index/package_finder.py�_check_link_requires_pythonr93s����-� � �%� � � � �� ��h�h�s�3� �5�5�6�6�G�)� ����J���(�� ��� �u� �L�L�T���$��  � � ���% � &� � � �� � � @� � � � � � � � � ����2 �4s�B � 0B>�=B>c��eZdZdZejd��Z ddededeede de d e e d dfd �Z d e d ee e effd �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_pythonr<)�selfr<r=r>r?r@r*s r8�__init__zLinkEvaluator.__init__nsE��4 "� )�%*� "�)���-���'=��$��� �+���(�����r(c���d}|jr|js|jpd}dd|��fS|jr|j}|j}�nP|���\}}|sdS|t vrdd|��fSd|jvr)|tkrd� |j ��}d|fSd |j vr|d krd S|tkr� t|j ��}n#t$rYd SwxYwt|j��|jkrd � |j ��}d|fS|j���}|�|��s@|���}d� d�|����}d|fS|j}d|jvr|tkrd|j ��}d|fS|st1||j��}|sd|j ��}d|fS|j�|��} | rC|d| ����}| �d��} | |jjkrdSt=||jj|j ���} | sdStB�"d||��d|fS)aG Determine whether a link is a candidate for installation. :return: A tuple (is_candidate, result), where `result` is (1) a version string if `is_candidate` is True, and (2) if `is_candidate` is False, an optional string to log the reason the link fails to qualify. Nz Fzyanked for reason: )Fz not a filezunsupported archive format: �binaryzNo binaries permitted for {}�macosx10z.zip)Fz macosx10 one)Fzinvalid wheel filenamezwrong project name (not {})z^none of the wheel's tags ({}) are compatible (run pip debug --verbose to show compatible tags)�, �sourcezNo sources permitted for zMissing project version for �)FzPython version is incorrect)r)r*)FNzFound link %s, version: %sT)#� is_yankedrB� yanked_reason� egg_fragment�ext�splitextr#rEr�formatr<�pathr�filenamerr �namerCrF�get_tags� supported�get_formatted_file_tagsr/r7�_extract_version_from_fragment�_py_version_re�search�start�group� py_versionr9�py_version_inforDr2r4) rGr(r7�reason�egg_inforS�wheel�supported_tags� file_tags�matchra�supports_pythons r8� evaluate_linkzLinkEvaluator.evaluate_link�s ���� �>� ;�$�"4� ;��'�9�>�F��9��9�9�:� :� � �$ (��(�H��(�C�C� �M�M�O�O�M�H�c�� -�,�,��.�.�.��C�c�C�C�D�D��t�}�,�,���1G�1G�7�>�>�t�?P�Q�Q���v��&��T�Y�&�&�3�&�=�=�.�.��o�%�%�=�!�$�-�0�0�E�E��+�=�=�=�<�<�<�=����$�U�Z�0�0�D�4H�H�H�:�A�A�$�BS�T�T�F�!�6�?�*�!%�!4�!=�!=�!?�!?�����~�6�6� +�!&� =� =� ?� ?�I�L�LR�F� �I�I�i�0�0�M�M�� "�6�?�*��-�� �4�=� (� (�S�O�-C�-C�D��1B�D�D�F��6�?� "�� �4���$���G�� #�G�D�4E�G�G�F��6�?� "��#�*�*�7�3�3�� � >��o�� � � � �o�.�G����Q���J��T�0�;�;�;�=�=�5� ��,�<�#'�#?� � � �� � !�!�=�� � �1�4��A�A�A��g��s�2C� C�C�N)�__name__� __module__� __qualname__�__doc__�re�compiler]r1rr�boolrrHrrrjr'rIr8r;r;bs��������� �R�Z� 7�8�8�N�26�#)�#)��#)��#)��3�� #)� $� #)� � #)�!)���#)� �#)�#)�#)�#)�JU�$�U�5��x��}�1D�+E�U�U�U�U�U�UrIr;� candidates�hashesr<c ��|s8t�dt|��|��t|��Sg}g}d}|D]X}|j}|jsn2|�|���r|dz }n|�|���C|�|���Y|r|}nt|��}t|��t|��krd} 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)rtrOzdiscarding no candidateszdiscarding {} non-matches: {}z c3�>K�|]}t|j��V��dSrk)r1r()�.0� candidates r8� z*filter_unallowed_hashes..$s,����I�I� ��I�N�+�+�I�I�I�I�I�IrIzPChecked %s links for project %r against %s hashes (%s matches, %s no digest): %s) r2r4�len�listr(�has_hash�is_hash_allowed�appendrUr/� digest_count) rsrtr<�matches_or_no_digest� non_matches� match_countrxr(�filtered�discard_messages r8�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�/�� � � � �OrIc�,�eZdZdZ ddededdfd�ZdS) �CandidatePreferenceszk Encapsulates some of the preferences for filtering and sorting InstallationCandidate objects. F� prefer_binary�allow_all_prereleasesr+Nc�"�||_||_dS)zR :param allow_all_prereleases: Whether to allow all pre-releases. N)r�r�)rGr�r�s r8rHzCandidatePreferences.__init__<s��&;��"�*����rI)FF)rlrmrnrorrrHr'rIr8r�r�5s[��������$�&+� +� +�� +� $� +� � +� +� +� +� +� +rIr�c�~�eZdZdZdeedeedeeddfd�Zdeefd�Z deefd �Z dS) r%z�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. rs�applicable_candidates�best_candidater+Nc��t|��t|��ksJ�|�|rJ�n||vsJ�||_||_||_dS)a :param 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. N)�set�_applicable_candidates� _candidatesr��rGrsr�r�s r8rHzBestCandidateResult.__init__Osi���(�)�)�S��_�_�<�<�<�<� � !�,� ,� ,�,� ,�!�%:�:�:�:�:�&;��#�%���,����rIc�*�t|j��S)zIterate through all candidates.)�iterr��rGs r8�iter_allzBestCandidateResult.iter_allgs���D�$�%�%�%rIc�*�t|j��S)z*Iterate through the applicable candidates.)r�r�r�s r8�iter_applicablez#BestCandidateResult.iter_applicableks���D�/�0�0�0rI) rlrmrnrorrrrHrr�r�r'rIr8r%r%Hs��������� -��.�/�-� $�$9�:�-�!�!6�7� -� � -�-�-�-�0&�(�#8�9�&�&�&�&�1��*?�!@�1�1�1�1�1�1rIr%c�J�eZdZdZe ddedeedededee j d ee d dfd ���Z dded e ede j deded ee d dfd �Zde ed e efd�Zded efd�Zde ed eefd�Zde ed efd�ZdS)�CandidateEvaluatorzm Responsible for filtering and sorting candidates for installation based on what tags are valid. NFr<r?r�r�� specifierrtr+c��|�t��}|�tj��}|���}|||||||���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)r<rfr�r�r�rt)rr � SpecifierSetrY)�clsr<r?r�r�r�rtrfs r8�createzCandidateEvaluator.createwsc��( � �(�N�N�M� � �"�/�1�1�I�&�/�/�1�1���s�%�)��'�"7��  � � � rIrfc��||_||_||_||_||_||_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|]\}}||�� Sr'r')rw�idx�tags r8� z/CandidateEvaluator.__init__..�s+��' �' �' �!��c�C��' �' �' rIN)�_allow_all_prereleases�_hashes�_prefer_binary� _project_name� _specifier�_supported_tags� enumerate�_wheel_tag_preferences)rGr<rfr�r�r�rts r8rHzCandidateEvaluator.__init__�sa��'<��#��� �+���)���#���-���' �' �%.�~�%>�%>�' �' �' ��#�#�#rIrsc����|jpd}|j}d�|�d�|D��|���D����fd�|D��}t||j|j���}t ||j���S)zM Return the applicable candidates from a list of candidates. Nc�,�h|]}t|����Sr')r1)rw�vs r8� z?CandidateEvaluator.get_applicable_candidates..�s.��  �  �  �� ��F�F�  �  �  rIc3�>K�|]}t|j��V��dSrk�r1r7�rw�cs r8ryz?CandidateEvaluator.get_applicable_candidates..�s*����4�4�A��Q�Y���4�4�4�4�4�4rI)� prereleasesc�@��g|]}t|j���v�|��Sr'r�)rwr��versionss �r8� [email protected]_applicable_candidates..�s+��� U� U� U�q�#�a�i�.�.�H�:T�:T��:T�:T�:TrI)rsrtr<��key)r�r��filterr�r�r��sorted� _sort_key)rGrs�allow_prereleasesr�r��filtered_applicable_candidatesr�s @r8�get_applicable_candidatesz,CandidateEvaluator.get_applicable_candidates�s����!�7�?�4���O� �  �  ��%�%�5�4��4�4�4�-�&� � �  �  �  �� !V� U� U� U�J� U� U� U��)@�,��<��+�* �* �* �&� �4�$�.�I�I�I�IrIrxc�t�|j}t|��}d}d}|j}|jr�t |j��} |�||j�� }n5#t$r(td� |j�����wxYw|j rd}|j �Ktjd|j ��} | ���} t!| d��| df}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'rzB{} is not a supported wheel for this platform. It can't be sorted.rONz ^(\d+)(.*)$�����)r�rzr(�is_wheelrrW�find_most_preferred_tagr�� ValueErrorrrUr�� build_tagrprh�groups�intr}r�rPr7) rGrx� valid_tags� support_numr��binary_preferencer(re�prirh�build_tag_groups�has_allowed_hash� yank_values r8r�zCandidateEvaluator._sort_key�sa��<�)� ��*�o�o� � � ����~�� �=� !��$�-�(�(�E� ��1�1�"�D�$?������� � � � �&�'�'-�v�e�n�'=�'=���� ���� �"� &�$%�!���*������A�A��#(�<�<�>�>� � �!1�!�!4�5�5�7G��7J�K� ���.�C��t�3�3�D�L�A�A�B�B���#�d�n�-�-�-� � � � � � � � �  � s �A�2B c�:�|sdSt||j���}|S)zy Return the best candidate per the instance's sort order, or None if no candidate is acceptable. Nr�)�maxr�)rGrsr�s r8�sort_best_candidatez&CandidateEvaluator.sort_best_candidates+��� ��4��Z�T�^�<�<�<���rIc�z�|�|��}|�|��}t|||���S)zF Compute and return a `BestCandidateResult` instance. )r�r�)r�r�r%r�s r8�compute_best_candidatez)CandidateEvaluator.compute_best_candidate*sL��!%� >� >�z� J� J���1�1�2G�H�H��"� �"7�)� � � � rI)NFFNN)FFN)rlrmrnro� classmethodr1rrrrr � BaseSpecifierrr�rr rHrr��CandidateSortingKeyr�r�r%r�r'rIr8r�r�ps��������� �15�#�&+�8<�#'�! �! ��! � � �-�! �� ! � $� ! � �J�4�5� ! ��� �! � �! �! �! ��[�! �P$�&+�#'� � �� ��S� � ��+�  � �  � $�  ��� � � � � � � �4"J��.�/�"J� �#� $�"J�"J�"J�"J�HB �#8�B �=P�B �B �B �B �H ��.�/� � �'� (� � � � � ��.�/� � � � � � � � rIr�c��eZdZdZ d-dedededeedee deed dfd �Z e d.ded e deed dfd ���Z ed efd ���Zed efd���Zejded dfd���Zed eefd���Zed eefd���Zed eefd���Zed efd���Zd/d�Zed efd���Zd/d�Zded efd�Zdeed eefd�Z deded dfd�Z!deded ee"fd �Z#dedeed ee"fd!�Z$d"eded ee"fd#�Z%e&j'd�$��ded ee"fd%���Z( d0ded&ee)j*d'ee+d e,fd(�Z-e&j'd�$�� d0ded&ee)j*d'ee+d e.fd)���Z/d*e0d+ed ee"fd,�Z1dS)1r&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_collectorr?r@�format_control�candidate_prefsr*r+c���|�t��}|p'tt��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�rr�rB�_candidate_prefsrD�_link_collectorrFr�� _logged_links)rGr�r?r@r�r�r*s r8rHzPackageFinder.__init__Csu��& � "�2�4�4�O�'�F�=�������+F�+F��)��� /���'=��$�-���+���,���),������rI�selection_prefsc��|�t��}t|j|j���}|||||j|j|j���S)afCreate 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�r?r@r�r*)rr�r�r�r@r�r*)r�r�r�r?r�s r8r�zPackageFinder.createjsi�� � �(�N�N�M�.�)�7�"1�"G� � � �� �s�+�)�'�(�5�*�9�#2�#I�  � � � rIc��|jSrk)rFr�s r8r?zPackageFinder.target_python�s ���"�"rIc��|jjSrk�r�� search_scoper�s r8r�zPackageFinder.search_scope�s���#�0�0rIr�c��||j_dSrkr�)rGr�s r8r�zPackageFinder.search_scope�s��,8���)�)�)rIc��|jjSrk)r�� find_linksr�s r8r�zPackageFinder.find_links�s���#�.�.rIc��|jjSrk)r�� index_urlsr�s r8r�zPackageFinder.index_urls�s��� �+�+rIc#�HK�|jjjD] }t|�V��dSrk)r��session�pip_trusted_originsr!)rG� host_ports r8� trusted_hostszPackageFinder.trusted_hosts�s<�����-�5�I� +� +�I�� �*� *� *� *� *� +� +rIc��|jjSrk�r�r�r�s r8r�z#PackageFinder.allow_all_prereleases�s���$�:�:rIc��d|j_dS�NTr�r�s r8�set_allow_all_prereleasesz'PackageFinder.set_allow_all_prereleases�s��6:���3�3�3rIc��|jjSrk�r�r�r�s r8r�zPackageFinder.prefer_binary�s���$�2�2rIc��d|j_dSr�r�r�s r8�set_prefer_binaryzPackageFinder.set_prefer_binary�s��.2���+�+�+rIr<c��t|��}|j�|��}t||||j|j|j���S)N)r<r=r>r?r@r*)r r��get_allowed_formatsr;rFrBrD)rGr<r=r>s r8�make_link_evaluatorz!PackageFinder.make_link_evaluator�sW��*�<�8�8���%�9�9�.�I�I���%�)���-��+�#'�#?�  � � � rI�linksc���gg}}t��}|D]M}||vrG|�|��|jr|�|���8|�|���N||zS)z� Returns elements of links in order, non-egg links first, egg links second, while eliminating duplicates )r��addrRr~)rGr��eggs�no_eggs�seenr(s r8� _sort_linkszPackageFinder._sort_links�s|�� �B�g���%�%��� )� )�D��4�����������$�)��K�K��%�%�%�%��N�N�4�(�(�(����~�rIr(rcc��||jvr8t�d||��|j�|��dSdS)NzSkipping link: %s: %s)r�r2r4r�)rGr(rcs r8�_log_skipped_linkzPackageFinder._log_skipped_link�sN�� �t�)� )� )� �L�L�0�&�$� ?� ?� ?� � � "� "�4� (� (� (� (� (� *� )rI�link_evaluatorc��|�|��\}}|s|r|�||���dSt|j||���S)z� If the link is a candidate for install, convert it to an InstallationCandidate and return it. Otherwise, return None. )rcN)rXr(r7)rjrrr<)rGrr(� is_candidate�results r8�get_install_candidatez#PackageFinder.get_install_candidate�sm�� .�;�;�D�A�A�� �f�� �� <��&�&�t�F�&�;�;�;��4�$��,��� � � � rIc��g}|�|��D]/}|�||��}|�|�|���0|S)zU Convert links that are candidates to InstallationCandidate objects. )rr r~)rGrr�rsr(rxs r8�evaluate_linkszPackageFinder.evaluate_links�s\�� � ��$�$�U�+�+� -� -�D��2�2�>�4�H�H�I��$��!�!�)�,�,�,���rI� project_urlc�*�t�d|��|j�|��}|�gSt t |����}t ��5|�||���}ddd��n #1swxYwY|S)Nz-Fetching project page and analyzing links: %s)r�)r2r4r�� fetch_pager{rr r )rGr r� html_page� page_links� package_linkss r8�process_project_urlz!PackageFinder.process_project_url�s��� � � � ;� � � � ��(�3�3�K�@�@� � � ��I��+�i�0�0�1�1� � �\�\� � � �/�/�� �0���M� � � � � � � � � � � ���� � � � � �s�$B�B �B )�maxsizec�l�|�|��}|j�|tj|j|������}t j�d�|D����}t|��}t j�d�|D����}|� |t|d�����}t� tj��r<|r:d�|D��}t�dd �|����||zS) aFind 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)r<�candidates_from_pagec3�LK�|]}|D]}|�|���V��� dSrk)�page_candidates�rw�sourcesrNs r8ryz4PackageFinder.find_all_candidates..sW����; �; ��!�; �; ���!� � "� "� $� $�"�!�!�!�!� ; �; rIc3�LK�|]}|D]}|�|���V��� dSrk)� file_linksrs r8ryz4PackageFinder.find_all_candidates..'sW����6 �6 ��!�6 �6 ���!� � � � � �"�!�!�!�!� 6 �6 rIT)�reversec�@�g|]}t|jj����Sr')r$r(�urlr�s r8r�z5PackageFinder.find_all_candidates..3s$��F�F�F��[����,�,�F�F�FrIzLocal files found: %srM)r�r��collect_sources� functools�partialr� itertools�chain� from_iterabler{r r�r2� isEnabledFor�logging�DEBUGr4r/) rGr<r�collected_sources�page_candidates_itr� file_links_it�file_candidates�pathss r8�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�F�F�o�F�F�F�E� �L�L�0�$�)�)�E�2B�2B� C� C� C���0�0rIr�rtc�n�|j}t�||j|j|j||���S)z*Create a CandidateEvaluator object to use.)r<r?r�r�r�rt)r�r�r�rFr�r�)rGr<r�rtr�s r8�make_candidate_evaluatorz&PackageFinder.make_candidate_evaluator9sD���/��!�(�(�%��-�)�7�"1�"G��� )� � � rIc��|�|��}|�|||���}|�|��S)aFind 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. )r<r�rt)r-r/r�)rGr<r�rtrs�candidate_evaluators r8�find_best_candidatez!PackageFinder.find_best_candidateJsQ���-�-�l�;�;� �"�;�;�%���<� � �� #�9�9�*�E�E�ErI�req�upgradec�d�|�d���}|�|j|j|���}|j}d}|j�t |jj��}dttdtfd�}|�[|�Yt� d|||� ������td �|�����d}|r|� |j|krd }|sC|�A|rt�d |��n!t�d ||j��dS|r>t�d |||�������t$�t�d|j||�������|S)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�rtN� cand_iterr+c�l�d�td�|D��t�����pdS)NrMc�6�h|]}t|j����Sr'r�r�s r8r�zKPackageFinder.find_requirement.._format_versions..~s ��;�;�;�A��Q�Y���;�;�;rIr��none)r/r�� parse_version)r7s r8�_format_versionsz8PackageFinder.find_requirement.._format_versionsvsJ�� � � ��;�;��;�;�;�)������� � rIzNCould not find a version that satisfies the requirement %s (from versions: %s)z%No matching distribution found for {}TzLExisting installed version (%s) is most up-to-date and satisfies requirementzUExisting installed version (%s) satisfies requirement (most up-to-date version is %s)z=Installed version (%s) is most up-to-date (past versions: %s)z)Using version %s (newest of versions: %s))rtr2rXr�r�� satisfied_byr;r7rrr1r2�criticalr�rrUr4r�r) rGr3r4rt�best_candidate_resultr��installed_versionr<�best_installeds r8�find_requirementzPackageFinder.find_requirementas�����5��1�1�� $� 8� 8� �H��m��!9�! �! �� /�=��48�� � � '� -�c�.>�.F� G� G� � ��1F�(G� �C� � � � � � $��)?� �O�O�&�� � �!6�!?�!?�!A�!A�B�B�  � � �'�7�>�>�s�C�C��� ��� � "� � "�n�&<�@Q�&Q�&Q�!�N�� �,�8�� �� � �,�%����� � � �6�%�"�*� ��� �4� � .� �L�L�O�!� � �!6�!F�!F�!H�!H�I�I� � � � .� -�� � � 7� � "� � �2�B�B�D�D� E� E� � � � �rI)NNNrk)r+N)NN)2rlrmrnrorrrrrrr�rHr�rr��propertyr?rr��setterrr1r�r�rr�r�r�r�r�r;r�rrrrr r rr � lru_cacher-r r�rr�r/r%r2rrBr'rIr8r&r&<s���������37�:>�15�!.�!.�%�!.�$�!.�� !.� !��/� !.� "�"6�7� !.�!)���!.� �!.�!.�!.�!.�N� 15�  � �%� �.� � � �-�  � �  � � ��[� �>�#�|�#�#�#��X�#��1�k�1�1�1��X�1���9��9��9�9�9���9��/�D��I�/�/�/��X�/��,�D��I�,�,�,��X�,��+�x��}�+�+�+��X�+��;�t�;�;�;��X�;�;�;�;�;��3�t�3�3�3��X�3�3�3�3�3�  ��  � �  �  �  �  ���$���D��J����� )�d�)�C�)�D�)�)�)�)� �+� �37� � �'� (� � � � �& �+� �4<�T�N� � �#� $� � � � ����1>�� �#� $�����*�Y���&�&�&�+1��+1��=R�8S�+1�+1�+1�'�&�+1�`9=�#'�  � �� ��J�4�5� ��� �  � �  � � � �"�Y���&�&�&�9=�#'� F�F��F��J�4�5�F��� � F� � F�F�F�'�&�F�,T�%�T�04�T� �'� (�T�T�T�T�T�TrIr&�fragmentr=c��t|��D]+\}}|dkr� t|d|���|kr|cS�,t|�d|�����)a�Find the separator's index based on the package's canonical name. :param fragment: A + 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�)rFr=�ir�s r8�_find_name_version_seprJ�sp��$�(�#�#�����1� ��8�8� � �X�b�q�b�\� *� *�n� <� <��H�H�H� =� ��B�B�.�B�B� C� C�CrIc�n� t||��dz}n#t$rYdSwxYw||d�}|sdS|S)z�Parse the version string from a + 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. rON)rJr�)rFr=� version_startr7s r8r\r\�s_���.�x��H�H�1�L� � �� �����t�t������}�~�~�&�G� ���t� �Ns �� $�$)F)Pror r"r&rp�typingrrrrrrr �pip._vendor.packagingr �pip._vendor.packaging.tagsr �pip._vendor.packaging.utilsr �pip._vendor.packaging.versionr rr;�pip._internal.exceptionsrrrr�pip._internal.index.collectorrr�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._internal.utils.urlsr$�__all__rlr2r�r1�BuildTagr�rrr9r;r�r�r%r�r&rJr\r'rIr8�rfsx��'�'� ������������ � � � �I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�,�,�,�,�,�,�*�*�*�*�*�*�9�9�9�9�9�9�6�6�6�6�6�6�@�@�@�@�@�@������������� 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�?�?�?�?�?�?�>�>�>�>�>�>�0�0�0�0�0�0� C� C� C�� ��8� � �� ��r��E�#�s�(�O�+� ,���C��c�<��#���P�Q�� $)�,�,� �,���S�#� �&�,�!�,� � ,�,�,�,�^F�F�F�F�F�F�F�F�RG��*�+�G� �G��G� � � � G�G�G�G�T+�+�+�+�+�+�+�+�&%1�%1�%1�%1�%1�%1�%1�%1�PI �I �I �I �I �I �I �I �Xy�y�y�y�y�y�y�y�x D�S�D�#�D�#�D�D�D�D�4�S��#��(�SV�-������rI