o
ai @ s d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlm Z d dl
mZ d dlm
Z
d dlmZmZ eeZG dd dZdS ) N)List)canonicalize_name)PyPI)has_tls)normalize_pathredact_auth_from_urlc @ s| e Zd ZdZddgZedee dee dd fddZdee dee ddfdd Z defd
dZ
dedee fd
dZdS )SearchScopezF
Encapsulates the locations that pip is configured to search.
find_links
index_urlsreturnc C s g }|D ]}| drt|}tj|r|}|| qt s;t||D ]}t j
|}|jdkr:t
d nq&| ||dS )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 ospathexistsappendr itertoolschainurllibparseurlparseschemeloggerwarning)clsr r
built_find_linkslinknew_linkparsed r! /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/models/search_scope.pycreate s(
zSearchScope.createNc C s || _ || _d S Nr )selfr r
r! r! r" __init__A s
zSearchScope.__init__c C s g }g }| j r:| j tjgkr:| j D ]}t|}tj|}|js)|js)t
d| || q|dd
| | jrN|dd
dd | jD d
|S )Nz:The index url "%s" seems invalid, please provide a scheme.zLooking in indexes: {}z, zLooking in links: {}c s s | ]}t |V qd S r$ )r .0urlr! r! r"