R`iY 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) ejT e+ Z,eee- ee- f Z.de-de/fd
Z0 d de-de-de-dee- de-f
dZ1de-de-dee- fdZ2 G d de3 Z4 G d de3 Z5 G d d Z6 G d d Z7 e7 Z8 G d d Z9y)!z)Handles all VCS (version control) support N)
TYPE_CHECKINGAnyDictIterableIteratorListMappingOptionalTupleTypeUnion)SpinnerInterface)
BadCommandInstallationError)
HiddenTextask_path_exists
backup_dirdisplay_pathhide_url
hide_valueis_installable_dirrmtree)CommandArgscall_subprocessformat_command_argsmake_command)get_url_scheme)Literalvcsnamereturnc L t | }|y|g dt j z v S )z3
Return true if the name looks like a URL.
F)httphttpsfileftp)r r all_schemes)r schemes /builddir/build/BUILDROOT/alt-python312-pip-23.3.1-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_internal/vcs/versioncontrol.pyis_urlr* 9 s+ D
!F
~5GGG repo_urlrevproject_namesubdirc R |j 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_urlr7 C sH $++C5
JauE"2!3
4C
x((Jr+ location repo_rootc 0 | }t | sI| }t j j | } | |k( rt j d| yt | sIt j j
|| ryt j 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)r8 r9
orig_location
last_locations r) (find_path_to_project_root_from_repo_rootrD U s M *
77??8,}$
NN&
!*
ww 8,
77??8Y//r+ c e Zd Zy)RemoteNotFoundErrorN)__name__
__module____qualname__ r+ r) rF rF r s r+ rF c $ e Zd Zdef fdZ xZS )RemoteNotValidErrorurlc 2 t | | || _ y N)super__init__rM )selfrM __class__s r) rQ zRemoteNotValidError.__init__w s
r+ )rG rH rI strrQ
__classcell__rS s @r) rL rL v s C r+ rL c e Zd ZdZ dded dee dee ddfdZdefd Z e
dee fd
ZdefdZdefdZ
dedd fd
Zy)
RevOptionsz
Encapsulates a VCS-specific revision to install, along with any VCS
install options.
Instances of this class should be treated as if immutable.
Nvc_classVersionControlr-
extra_argsr! c D |g }|| _ || _ || _ d| _ y)z
Args:
vc_class: a VersionControl subclass.
rev: the name of the revision to install.
extra_args: a list of extra options.
N)r[ r- rY branch_name)rR rY r- r[ s r) rQ zRevOptions.__init__ s, J$
*.r+ c P d| j j d| j dS )Nz