Edit File: versioncontrol.cpython-311.pyc
� Q�dY � �& � d Z ddlZddlZddlZddlZddlZddlmZm Z m Z mZmZm Z mZmZmZmZmZ ddlmZ ddlmZmZ ddlmZmZmZmZmZmZmZm Z ddl!m"Z"m#Z#m$Z$m%Z% ddl&m'Z' erdd lm(Z( d gZ) ej* e+� � Z,eee- ee- f Z.de-de/fd �Z0 d de-de-de-dee- de-f d�Z1de-de-dee- fd�Z2 G d� de3� � Z4 G d� de3� � Z5 G d� d� � Z6 G d� d� � Z7 e7� � Z8 G d� d� � Z9dS )!z)Handles all VCS (version control) support� N)� TYPE_CHECKING�Any�Dict�Iterable�Iterator�List�Mapping�Optional�Tuple�Type�Union)�SpinnerInterface)� BadCommand�InstallationError)� HiddenText�ask_path_exists� backup_dir�display_path�hide_url� hide_value�is_installable_dir�rmtree)�CommandArgs�call_subprocess�format_command_args�make_command)�get_url_scheme)�Literal�vcs�name�returnc �N � t | � � }|�dS |g d�t j z v S )z3 Return true if the name looks like a URL. NF)�http�https�file�ftp)r r �all_schemes)r �schemes �q/builddir/build/BUILD/cloudlinux-venv-1.0.2/venv/lib/python3.11/site-packages/pip/_internal/vcs/versioncontrol.py�is_urlr* 9 s4 � � �D� !� !�F� �~��u��5�5�5���G�G�G� �repo_url�rev�project_name�subdirc �Z � |� dd� � }| � d|� d|� �}|r|d|� �z }|S )z� Return the URL for a VCS requirement. Args: repo_url: the remote VCS url, with any needed VCS prefix (e.g. "git+"). project_name: the (unescaped) project name. �-�_�@z#egg=z&subdirectory=)�replace)r, r- r. r/ �egg_project_name�reqs r) �make_vcs_requirement_urlr7 C sV � � $�+�+�C��5�5�� � 4� 4�� 4� 4�"2� 4� 4�C� � )��(��(�(�(���Jr+ �location� repo_rootc �N � | }t | � � sS| }t j � | � � } | |k rt � d|� � dS t | � � �St j � || � � rdS t j � | |� � S )z� Find the the Python project's root by searching up the filesystem from `location`. Return the path to project root relative to `repo_root`. Return None if the project root is `repo_root`, or cannot be found. zOCould not find a Python project for directory %s (tried all parent directories)N)r �os�path�dirname�logger�warning�samefile�relpath)r8 r9 � orig_location� last_locations r) �(find_path_to_project_root_from_repo_rootrD U s� � � �M� ��*�*� � � ��7�?�?�8�,�,���}�$�$� �N�N�&�� � � � �4� !��*�*� � �w��� �8�,�,� ��t� �7�?�?�8�Y�/�/�/r+ c � � e Zd ZdS )�RemoteNotFoundErrorN)�__name__� __module__�__qualname__� r+ r) rF rF r s � � � � � ��Dr+ rF c �$ � � e Zd Zdef� fd�Z� xZS )�RemoteNotValidError�urlc �X �� t � � � |� � || _ d S �N)�super�__init__rM )�selfrM � __class__s �r) rQ zRemoteNotValidError.__init__w s&