File manager - Edit - /opt/cloudlinux/venv/lib/python3.11/site-packages/pip/_internal/vcs/__pycache__/versioncontrol.cpython-311.pyc
Back
� .|oi�W � � � d Z ddlmZ ddlZddlZddlZddlZddlZddl m Z mZmZ ddl mZmZ ddlmZmZmZ ddlmZ ddlmZmZ dd lmZmZmZmZmZmZm Z m!Z! dd l"m#Z#m$Z$m%Z%m&Z& dgZ' ej( e)� � Z*e+ee, ee, f Z-d&d�Z. d'd(d�Z/d)d�Z0 G d� de1� � Z2 G d� de1� � Z3 ed�� � G d � d!� � � � Z4 G d"� d#� � Z5 e5� � Z6 G d$� d%� � Z7dS )*z)Handles all VCS (version control) support� )�annotationsN)�Iterable�Iterator�Mapping)� dataclass�field)�Any�Literal�Optional)�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�vcs�name�str�return�boolc �x � t j � | � � j }|sdS |g d�t j z v S )z3 Return true if the name looks like a URL. F)�http�https�file�ftp)�urllib�parse�urlsplit�schemer �all_schemes)r r( s �r/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/vcs/versioncontrol.py�is_urlr+ - sB � � �\� "� "�4� (� (� /�F�� ��u��5�5�5���G�G�G� �repo_url�rev�project_name�subdir� str | Nonec �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/ r0 �egg_project_name�reqs r* �make_vcs_requirement_urlr9 7 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)r: r; � orig_location� last_locations r* �(find_path_to_project_root_from_repo_rootrF I s� � � �M� ��*�*� � � ��7�?�?�8�,�,���}�$�$� �N�N�&�� � � � �4� !��*�*� � �w��� �8�,�,� ��t� �7�?�?�8�Y�/�/�/r, c � � e Zd ZdS )�RemoteNotFoundErrorN)�__name__� __module__�__qualname__� r, r* rH rH f s � � � � � ��Dr, rH c � � � e Zd Zd� fd�Z� xZS )�RemoteNotValidError�urlr c �X �� t � � � |� � || _ d S �N)�super�__init__rO )�selfrO � __class__s �r* rS zRemoteNotValidError.__init__k s&