zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
U
H=®dã@sšddlZddlZddlZddlZddlmZddlmZddl    m
Z
ddl m Z ddl mZmZddlmZer|ddlmZe e¡ZGd    d
„d
eƒZdS) éN)Úcanonicalize_name)Úparse)ÚPyPI)Úhas_tls)Únormalize_pathÚredact_auth_from_url)ÚMYPY_CHECK_RUNNING)ÚListc@s<eZdZdZddgZedd„ƒZdd„Zdd    „Zd
d „Z    d S) Ú SearchScopezF
    Encapsulates the locations that pip is configured to search.
    Ú
find_linksÚ
index_urlscCs€g}|D]0}| d¡r.t|ƒ}tj |¡r.|}| |¡qtƒstt ||¡D]&}t     
|¡}|j dkrLt   d¡qtqL|||dS)zQ
        Create a SearchScope object after normalizing the `find_links`.
        ú~Úhttpszipip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.©r r )Ú
startswithrÚosÚpathÚexistsÚappendrÚ    itertoolsÚchainÚ urllib_parseÚurlparseÚschemeÚloggerÚwarning)Úclsr r Úbuilt_find_linksÚlinkÚnew_linkÚparsed©r!úXD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/models/search_scope.pyÚcreates&
 
 
ÿþzSearchScope.createcCs||_||_dS©Nr)Úselfr r r!r!r"Ú__init__FszSearchScope.__init__cCs¤g}g}|jrr|jtjgkrr|jD]8}t|ƒ}t |¡}|jsP|jsPt     d|¡| 
|¡q"| 
d  d  |¡¡¡|j rš| 
d  d  dd„|j Dƒ¡¡¡d  |¡S)Nz:The index url "%s" seems invalid, please provide a scheme.zLooking in indexes: {}z, zLooking in links: {}css|]}t|ƒVqdSr$)r©Ú.0Úurlr!r!r"Ú    <genexpr>lsz6SearchScope.get_formatted_locations.<locals>.<genexpr>Ú
)r rÚ
simple_urlrrÚurlsplitrÚnetlocrrrÚformatÚjoinr )r%ÚlinesÚredacted_index_urlsr)Úredacted_index_urlÚpurlr!r!r"Úget_formatted_locationsOs,
 
 þ ÿÿÿz#SearchScope.get_formatted_locationscs ‡fdd„‰‡fdd„|jDƒS)z²Returns the locations found via self.index_urls
 
        Checks the url_name on the main (first in the list) index and
        use this url_name to produce all locations
        cs,t |t tˆƒ¡¡}| d¡s(|d}|S)Nú/)Ú    posixpathr0rÚquoterÚendswith)r)Úloc)Ú project_namer!r"Úmkurl_pypi_urlys þ
z<SearchScope.get_index_urls_locations.<locals>.mkurl_pypi_urlcsg|] }ˆ|ƒ‘qSr!r!r')r<r!r"Ú
<listcomp>‡sz8SearchScope.get_index_urls_locations.<locals>.<listcomp>)r )r%r;r!)r<r;r"Úget_index_urls_locationsqs z$SearchScope.get_index_urls_locationsN)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú    __slots__Ú classmethodr#r&r5r>r!r!r!r"r
s
(    "r
)rÚloggingrr7Zpip._vendor.packaging.utilsrZpip._vendor.six.moves.urllibrrÚpip._internal.models.indexrÚpip._internal.utils.compatrÚpip._internal.utils.miscrrÚpip._internal.utils.typingrÚtypingr    Ú    getLoggerr?rÚobjectr
r!r!r!r"Ú<module>s