� ��^i�B���dZddlZddlZddlZddlmZddlmZddlm Z m Z m Z m Z ddl mZddlmZddlmZdd lmZdd lmZmZdd lmZdd lmZdd lmZddlmZddl m!Z!ddl"m#Z#ddl$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6m7Z7m8Z8ddl9m:Z:ej;e<��Z=Gd�de��Z>Gd�dee>��Z?e8j@e8jAe8jBgZCd$d�ZDd e de fd!�ZEGd"�d#e?��ZFdS)%aContains the Command base classes that depend on PipSession. The classes in this module are in a separate module so the commands not needing download / PackageFinder capability don't unnecessarily import the PackageFinder machinery and all its vendored dependencies, etc. �N)�partial)�Values)�Any�List�Optional�Tuple)� WheelCache)� cmdoptions)�Command)�CommandContextMixIn)� CommandError�PreviousBuildDirError)� LinkCollector)� PackageFinder)�SelectionPreferences)� TargetPython)� PipSession)�RequirementPreparer)�install_req_from_editable�install_req_from_line�#install_req_from_parsed_requirement�install_req_from_req_string)�parse_requirements)�InstallRequirement)�RequirementTracker)� BaseResolver)�pip_self_version_check)� deprecated)� TempDirectory�TempDirectoryTypeRegistry� tempdir_kinds)�running_under_virtualenvc ���eZdZdZd �fd� Zededeee fd���Z dede fd�Z d dedee d ee de fd �Z�xZS) �SessionCommandMixinzE A class mixin for command classes needing _build_session(). �returnNc�V��t�����d|_dS�N)�super�__init__�_session)�self� __class__s ���/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/cli/req_command.pyr)zSessionCommandMixin.__init__6s$��� ��������.2�� � � ��optionsc���g}t|dd��s(t|dd��}|r|�|��t|dd��}|r|�|��|pdS)z7Return a list of index urls from user-provided options.�no_indexF� index_urlN�extra_index_urls)�getattr�append�extend)�clsr/� index_urls�url�urlss r-�_get_index_urlsz#SessionCommandMixin._get_index_urls:s���� ��w� �E�2�2� '��'�;��5�5�C�� '��!�!�#�&�&�&��w� 2�D�9�9�� � $� � � �d� #� #� #��!�T�!r.c��|j�6|�|�|����|_|j�J�|jS)zGet a default-managed session.)r*� enter_context�_build_session)r+r/s r-�get_default_sessionz'SessionCommandMixin.get_default_sessionHsE�� �=� � �.�.�t�/B�/B�7�/K�/K�L�L�D�M��=�,�,�,��}�r.�retries�timeoutc���|jr&tj�|j��sJ�t |jr%tj�|jd��nd|�|n|j|j|�|�����}|j r |j |_ |j r |j |_ |j s|r|�|n|j |_ |j r|j |j d�|_|j |j_|S)N�http)�cacher@� trusted_hostsr8)rC�https)� cache_dir�os�path�isabsr�joinr@rEr;�cert�verify� client_certrA�proxy�proxies�no_input�auth� prompting)r+r/r@rA�sessions r-r>z"SessionCommandMixin._build_sessionRs�� �$�H��� � �g�6G�(H�(H�H�H�H��;B�;L�V��� � �W�.��7�7�7�RV�&�2�G�G���!�/��+�+�G�4�4�  � � �� �<� *�$�\�G�N� � � /�"�.�G�L� �?� R�g� R�)0�)<�g�g�'�/�G�O� �=� �� � ����G�O� &-�%5�!5�� ���r.�r%N�NN)�__name__� __module__� __qualname__�__doc__r)� classmethodrrr�strr;rr?�intr>� __classcell__�r,s@r-r$r$0s����������3�3�3�3�3�3�� "�f� "��$�s�)�1D� "� "� "��[� "��6��j�����"&�!%� &�&��&��#��&��#�� &� � &�&�&�&�&�&�&�&r.r$c�"�eZdZdZdeddfd�ZdS)�IndexGroupCommandz� Abstract base class for commands with the index_group options. This also corresponds to the commands that permit the pip version check. r/r%Nc���t|d��sJ�|js|jrdS|�|dt d|j�����}|5t ||��ddd��dS#1swxYwYdS)z� Do the pip version check if not disabled. This overrides the default behavior of not doing the check. r1Nr�)r@rA)�hasattr�disable_pip_version_checkr1r>�minrAr)r+r/rTs r-�handle_pip_version_checkz*IndexGroupCommand.handle_pip_version_check�s����w� �+�+�+�+�+� � ,� ��0@� � �F��%�%� �Q��A�w��(?�(?�&� � ��� 5� 5� "�7�G� 4� 4� 4� 5� 5� 5� 5� 5� 5� 5� 5� 5� 5� 5� 5���� 5� 5� 5� 5� 5� 5s�A.�.A2�5A2)rWrXrYrZrrg�r.r-rara{s@�������� 5��5�4�5�5�5�5�5�5r.rar%c���t��rdSttd��sdStjdkstjdkrdStj��dkrdSt �d��dS)z�Output a warning for sudo users on Unix. In a virtual environment, sudo pip still writes to virtualenv. On Windows, users may run pip as Administrator without issues. This warning only applies to Unix root users outside of virtualenv. N�getuid�win32�cygwinrz�Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv)r"rdrH�sys�platformrj�logger�warningrhr.r-�warn_if_run_as_rootrq�s��� �!�!���� �2�x� � ����  �|�w���#�,�(�":�":��� �y�{�{�a����� �N�N� ,�����r.�funcc ����dtddfd��dtdtdttdt t f��fd� }|S) zNDecorator for common logic related to managing temporary directories. �registryr%Nc�F�tD]}|�|d���dS)NF)�KEEPABLE_TEMPDIR_TYPES� set_delete)rt�ts r-�configure_tempdir_registryz0with_cleanup..configure_tempdir_registry�s4��'� *� *�A� � � ��5� )� )� )� )� *� *r.r+r/�argsc���|j�J�|jr�|j�� �|||��S#t$r�|j���wxYwr')�tempdir_registry�no_cleanr)r+r/rzryrrs ��r-�wrapperzwith_cleanup..wrapper�s�����$�0�0�0� � � >� &� &�t�'<� =� =� =� ��4��g�t�,�,� ,��$� � � � '� &�t�'<� =� =� =� �  ���s � 0�A )r �RequirementCommandrrrrr])rrr~rys` @r-� with_cleanupr��sy���� *�-F�*�4�*�*�*�*�� ��+1��9=�c��� �#��������� �Nr.c���eZdZdededdf�fd� Zededefd���Ze d de ded e d e d e d ed eedefd���Ze d!ded e dedeed edededededeedeeedfdefd���Zdeeded e d e deef d�Zed e ddfd���Z d"ded e deedeede f d�Z�xZS)#rrz�kwr%Nc���t��j|i|��|j�t j����dSr')r(r)�cmd_opts� add_optionr r})r+rzr�r,s �r-r)zRequirementCommand.__init__�sD��������$�%�"�%�%�%� � � � ��!4�!6�!6�7�7�7�7�7r.r/c��d|jvrdSdS)zEDetermines which resolver should be used, based on the given options.zlegacy-resolver�legacy� 2020-resolver)�deprecated_features_enabled�r/s r-�determine_resolver_variantz-RequirementCommand.determine_resolver_variant�s�� �� C� C� C��8��r.�temp_build_dir� req_trackerrT�finder� use_user_site� download_dirc���|j}|�J�|�|��} | dkr&d|jv} | rt�d��n%d} d|jvrt�d��d|jv} d|jvrt d d d � ��d|jvrt d dd � ��t||j||j |||j ||j || | �� � S)zQ Create a RequirementPreparer instance for the given parameters. Nr�z fast-depsz�pip is using lazily downloaded wheels using HTTP range requests to obtain dependency information. This experimental feature is enabled through --use-feature=fast-deps and it is not ready for production.Fz;fast-deps has no effect when used with the legacy resolver.zout-of-tree-buildz in-tree-buildz#In-tree builds are now the default.z.to remove the --use-feature=in-tree-build flagz22.1)�reason� replacement�gone_inz"Out-of-tree builds are deprecated.) � build_dir�src_dirr��build_isolationr�rT� progress_barr��require_hashesr�� lazy_wheel� in_tree_build) rIr��features_enabledrorpr�rrr�r�r�r�) r7r�r/r�rTr�r�r��temp_build_dir_path�resolver_variantr�r�s r-�make_requirement_preparerz,RequirementCommand.make_requirement_preparer�sL��-�1��"�.�.�.��9�9�'�B�B�� �� .� .�$��(@�@�J�� ����"������J��g�6�6�6����Q����,�7�3V�V� � �g�6� 6� 6� �<�L�� � � � � �'�"E� E� E� �;� �� � � � � #�)��O�%�#�3�#�� �-��"�1�'�!�'�  �  �  � r.FT�to-satisfy-only�preparer� wheel_cache�ignore_installed�ignore_requires_python�force_reinstall�upgrade_strategy� use_pep517�py_version_info.c �d�tt|j| ���} |�|��} | dkr=ddl}|jjjj� |||| ||j |||| | �� � Sddl }|jjj j� |||| ||j |||| | �� � S)zF Create a Resolver instance for the given parameters. )�isolatedr�r�rN) r�r�r��make_install_reqr��ignore_dependenciesr�r�r�r�r�) rr� isolated_moder��,pip._internal.resolution.resolvelib.resolver� _internal� resolution� resolvelib�resolver�Resolverr��(pip._internal.resolution.legacy.resolverr�)r7r�r�r/r�r�r�r�r�r�r�r�r�r��pips r-� make_resolverz RequirementCommand.make_resolver&s���$#� '��*�!� � � �� �9�9�'�B�B�� �� .� .� ?� ?� ?� ?��=�+�6�?�H�H�!��'�!1�+�$+�$?�!1�'=� /�!1� /�I� � � � 8�7�7�7��}�'�.�7�@�@���#�-�'� '� ;�-�#9�+�-�+�A�  �  � r.c �f�g}|jD]E}t|d|||���D].}t||jd���}|�|���/�F|D]5} t | d|j|jd���}|�|���6|jD]4} t| d|j|j���}|�|���5|j D]J}t||||���D]4}t||j|jd���}|�|���5�Ktd �|D����rd|_ |sy|jsr|j skd |j i} |j rAtd jdit!| d �|j ��� �������tdjdi| �����|S)zS Parse command-line arguments into the corresponding requirements. T)� constraintr�r/rTF)r�� user_suppliedN)r�r�r�)r�r�r�)r�r/rTc3�$K�|] }|jV�� dSr')�has_hash_options)�.0�reqs r-� z6RequirementCommand.get_requirements..�s%����<�<��s�#�<�<�<�<�<��>D����t�3�8�8�G�4F�+G�+G�H�H�H������#�5�.�.4�=�=�7;�=�=���� �r.c�x�|j}|���}|rt�|��dSdS)zE Trace basic information about the provided objects. N)� search_scope�get_formatted_locationsro�info)r�r�� locationss r-�trace_basic_infoz#RequirementCommand.trace_basic_info�sG�� �*� � �8�8�:�:� � � #� �K�K� � "� "� "� "� "� #� #r.� target_pythonc��tj||���}td|j|j|j|���}t j|||���S)z� Create a package finder appropriate to this requirement command. :param ignore_requires_python: Whether to ignore incompatible "Requires-Python" values in links. Defaults to False. r�T)� allow_yanked�format_control�allow_all_prereleases� prefer_binaryr�)�link_collector�selection_prefsr�)r�createrr��prer�r)r+r/rTr�r�r�r�s r-�_build_package_finderz(RequirementCommand._build_package_finder�si��'�-�g�w�G�G�G��.��"�1�")�+�!�/�#9�  � � ���#�)�+�'� � � � r.r')NFTFFr�NNrV)rWrXrYrr)� staticmethodrr\r�r[rrrr�boolrrr�r rr]rr�rrr�r�rr�r^r_s@r-rr�s��������8�c�8��8��8�8�8�8�8�8� ��F��s�����\���'+�= �= �%�= ��= �(� = � � = � � = ��= ��s�m�= � �= �= �= ��[�= �~� -1�#�!%�',� %� 1�%)�59�8 �8 �%�8 ��8 �� 8 � �j�)� 8 � � 8 ��8 �!%�8 ��8 ��8 ��T�N�8 �"�%��S��/�2�8 � �8 �8 �8 ��[�8 �tM��3�i�M��M�� M� � M� � � !� M�M�M�M�^�#��#�4�#�#�#��\�#�15�15�  � �� �� � � �-�  � !)���  � �  � � � � � � � r.rrU)GrZ�loggingrHrm� functoolsr�optparser�typingrrrr�pip._internal.cacher �pip._internal.clir �pip._internal.cli.base_commandr �!pip._internal.cli.command_contextr �pip._internal.exceptionsr r�pip._internal.index.collectorr�"pip._internal.index.package_finderr�$pip._internal.models.selection_prefsr�"pip._internal.models.target_pythonr�pip._internal.network.sessionr� pip._internal.operations.preparer�pip._internal.req.constructorsrrrr�pip._internal.req.req_filer�pip._internal.req.req_installr�pip._internal.req.req_trackerr�pip._internal.resolution.baser�!pip._internal.self_outdated_checkr�pip._internal.utils.deprecationr�pip._internal.utils.temp_dirrr r!�pip._internal.utils.virtualenvr"� getLoggerrWror$ra� BUILD_ENV�EPHEM_WHEEL_CACHE� REQ_BUILDrvrqr�rrhr.r-�r�s5�������� � � � � � � � �������������-�-�-�-�-�-�-�-�-�-�-�-�*�*�*�*�*�*�(�(�(�(�(�(�2�2�2�2�2�2�A�A�A�A�A�A�H�H�H�H�H�H�H�H�7�7�7�7�7�7�<�<�<�<�<�<�E�E�E�E�E�E�;�;�;�;�;�;�4�4�4�4�4�4�@�@�@�@�@�@������������� :�9�9�9�9�9�<�<�<�<�<�<�<�<�<�<�<�<�6�6�6�6�6�6�D�D�D�D�D�D�6�6�6�6�6�6����������� D�C�C�C�C�C� �� �8� $� $��H�H�H�H�H�-�H�H�H�V5�5�5�5�5��!4�5�5�5�:���#���������<�s��s�����8} �} �} �} �} �*�} �} �} �} �} r.