L ioUddlmZddlZddlZddlmZmZmZddlm Z ddl m Z er ddl m Z mZmZmZe eZded<ej(d Zded <d Zded <dd ZGddZy)) annotationsN) TYPE_CHECKINGFinalcast)util) get_logger)CommitRemoteRemoteReferenceRepor_LOGGERz5github\.com(?::\d+)?[/:]([^/]+)/([^/]+?)(?:\.git)?/?$_GITHUB_URL_PATTERN)r_MIN_GIT_VERSIONctj|j}|y|jdd|jdS)aExtract the ``owner/repo`` from a GitHub remote URL. This supports HTTPS and SSH URL forms including optional user info, port, trailing slash, and ``.git`` suffix. Validation of the scheme is not performed; we only extract if the URL contains ``github.com`` and ends with a path of the shape ``owner/repo``. Parameters ---------- url The remote URL string. Returns ------- str | None The extracted ``owner/repo`` if found; otherwise ``None``. N/r)rsearchstripgroup)urlmatchs X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/git_util.py_extract_github_repo_from_urlr)sE$ & &syy{ 3E }kk!n Qu{{1~. //ceZdZUded<ddZddZddZeddZeddZ eddZ edd Z edd Z dd Z dd Zy )GitRepoz Repo | Nonerepocd|_d|_ ddl}|j|d|_|jjj |_|j_|jt k\rK|jjjd}tjj|||_yyy#t$r"tjd|dd|_YywxYw)NrT)search_parent_directoriesz--show-toplevelzDid not find a git repo at %s. This is expected if this isn't a git repo, but could also fail for other reasons: 1) git binary or GitPython not installed 2) No .git folder 3) Corrupted .git folder 4) Path is invalid.exc_info) git_versionmodulegitr r version_infor rev_parseospathrelpath Exceptionr debug)selfr+r'git_roots r__init__zGitRepo.__init__Ds48   FDI#yy}}99D +0@0@DT0T99==223DE ggoodH= 1U+  MM&   DI sB*B==(C('C(c,tj|SN)rrepr_r/s r__repr__zGitRepo.__repr__`szz$rch|jduxr#|jduxr|jtk\S)zETrue if there's a git repo here, and git.version >= _MIN_GIT_VERSION.N)rr%rr5s ris_validzGitRepo.is_validcs< IIT ! 5  , 5  $44 rc|j|jsy|jry|jjj Sr3)rr8is_head_detached active_branchtracking_branchr5s rr<zGitRepo.tracking_branchks< 99 DMMO  yy&&6688rch|j|jsy|jjSr3)rr8untracked_filesr5s rr>zGitRepo.untracked_filesus' 99 DMMOyy(((rc||j|jsy|jjjS)NF)rr8head is_detachedr5s rr:zGitRepo.is_head_detached|s+ 99 DMMOyy~~)))rc|j|jsy|jjjdDcgc]}t d|j c}Scc}w)Nstr)rr8indexdiffra_path)r/items runcommitted_fileszGitRepo.uncommitted_filessI 99 DMMO59YY__5I5I$5OPTUDKK(PPPsA%c|j|jsy |j}|y|\}}|jd|}t |jj |d|S#t $rgcYSwxYw)Nrz..)rr8get_tracking_branch_remotenamelist iter_commitsr-)r/tracking_branch_inforemote branch_name remote_branchs r ahead_commitszGitRepo.ahead_commitss 99 DMMO #'#B#B#D #+"6 FK%{{m1[M:M ..-;-/PQR R I sA1>A11 A?>A?c@|j|jsy|j}|y|jj d^}}dj |} |jj ||fS#t$rtjd|dYywxYw)NrzFailed to resolve remote %sTr#) rr8r<rKsplitjoinrOr-r r.)r/r< remote_namebranchrPs rrJz"GitRepo.get_tracking_branch_remotes 99 DMMO..  ".3399#> fhhv&  99##K0+= =  MM7tM T sA99!BBch|js!tjd|jy|j }|tjdy|\}}t |j }d}|D]}t|}|n|tjd|y|||jfS)Nz/No valid git information found. Git version: %sz1No tracking remote branch found for the git repo.zCUnable to determine repo name from configured remote URLs. URLs: %s) r8r r.r%rJrLurlsrr&)r/ remote_inforOrW remote_urlsrrs r get_repo_infozGitRepo.get_repo_infos}} MMA4CSCS 557   MMM N$6;;'  C05D  < MMU VT[[((rN)r+rCreturnNone)r]rC)r]bool)r]zRemoteReference | None)r]zlist[str] | None)r]zlist[Commit] | None)r]ztuple[Remote, str] | None)r]ztuple[str, str, str] | None)__name__ __module__ __qualname____annotations__r1r6r8propertyr<r>r:rHrRrJr\rrrrAs 8  99)) ** QQ  $)rr)rrCr]z str | None) __future__rr*retypingrrr streamlitrstreamlit.loggerrr'r r r r r`r rccompilerrrrrerrrlso# --'99H%%(RZZ<U$%#00G)G)r