fc " d Z ddlZddlZddlZddlZddlZddlmZm Z m Z mZmZm Z mZmZmZmZmZ ddlmZ ddlmZmZ ddlmZmZmZmZmZmZmZm Z ddl!m"Z"m#Z#m$Z$ ddl%m&Z& erdd lm'Z' d gZ( ej) e* Z+eee, ee, f Z-de,de.fd Z/ d de,de,de,dee, de,f dZ0de,de,dee, fdZ1 G d de2 Z3 G d de2 Z4 G d d Z5 G d d Z6 e6 Z7 G d d Z8dS )!z)Handles all VCS (version control) support N) TYPE_CHECKINGAnyDictIterableIteratorListMappingOptionalTupleTypeUnion)SpinnerInterface) BadCommandInstallationError) HiddenTextask_path_exists backup_dirdisplay_pathhide_url hide_valueis_installable_dirrmtree)CommandArgscall_subprocessmake_command)get_url_scheme)Literalvcsnamereturnc N t | }|dS |g dt j z v S )z3 Return true if the name looks like a URL. NF)httphttpsfileftp)r r all_schemes)r schemes /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/vcs/versioncontrol.pyis_urlr) 4 s4 D ! !F ~u555GGG repo_urlrevproject_namesubdirc 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_namereqs r( make_vcs_requirement_urlr6 > 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)r7 r8 orig_location last_locations r( (find_path_to_project_root_from_repo_rootrC P s M ** 7??8,,}$$ NN& 4 !** w 8,, t 7??8Y///r* c e Zd ZdS )RemoteNotFoundErrorN)__name__ __module____qualname__ r* r( rE rE m s Dr* rE c $ e Zd Zdef fdZ xZS )RemoteNotValidErrorurlc X t | || _ d S N)super__init__rL )selfrL __class__s r( rP zRemoteNotValidError.__init__r s&