Q[ 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&dZ. d'd(dZ/d)dZ0 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)IterableIteratorMapping) dataclassfield)AnyLiteralOptional)SpinnerInterface) BadCommandInstallationError) HiddenTextask_path_exists backup_dirdisplay_pathhide_url hide_valueis_installable_dirrmtree)CommandArgscall_subprocessformat_command_argsmake_commandvcsnamestrreturnboolc x t j | j }|sdS |g dt j z v S )z3 Return true if the name looks like a URL. F)httphttpsfileftp)urllibparseurlsplitschemer all_schemes)r r( s r/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/vcs/versioncontrol.pyis_urlr+ - sB \ " "4 ( ( /F u555GGG repo_urlrevproject_namesubdir 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_namereqs r* make_vcs_requirement_urlr9 7 sV $++C55 4 4 4 4"2 4 4C )((((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 ospathdirnameloggerwarningsamefilerelpath)r: r; orig_location last_locations r* (find_path_to_project_root_from_repo_rootrF I s M ** 7??8,,}$$ NN& 4 !** w 8,, t 7??8Y///r, c e Zd ZdS )RemoteNotFoundErrorN)__name__ __module____qualname__ r, r* rH rH f s Dr, rH c e Zd Zd fdZ xZS )RemoteNotValidErrorurlr c X t | || _ d S N)super__init__rO )selfrO __class__s r* rS zRemoteNotValidError.__init__k s&