U
ÀÒ.eÖ7 ã
@ sØ d Z ddlmZ ddlZddlZddlZddlZddlZddlm Z ddl
mZ ddl
mZ ddlmZ ddlmZ dd lmZ dd
lmZmZ ddlmZ e�r
ddlmZmZmZmZmZm Z m!Z!m"Z" dd
l#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z* ee"e+e!f Z,dgZ-e .dej/¡Z0e .d¡Z1e .d¡Z2ej3ej4ej5ej6ej7ej8ej9ej:ej;ejej?g
Z@ejAejBejCgZDdd„ eDD ƒZEd)dd„ZFdd„ ZGd*dd„ZHdd„ ZIdd „ ZJd!d"„ ZKd#d$„ ZLd%d&„ ZMd'd(„ ZNdS )+z
Requirements file parsing
é )Úabsolute_importN)Úfilterfalse)Úparse)Ú
cmdoptions)Úget_file_content©ÚRequirementsFileParseError)ÚSearchScope)Úinstall_req_from_editableÚinstall_req_from_line)ÚMYPY_CHECK_RUNNING)ÚAnyÚCallableÚIteratorÚListÚNoReturnÚOptionalÚTextÚTuple)ÚInstallRequirement)Ú
WheelCache)Ú
PackageFinder)Ú
PipSessionÚparse_requirementsz^(http|https|file):z(^|\s+)#.*$z#(?P\$\{(?P[A-Z0-9_]+)\})c C s g | ]}t |ƒ jƒ‘qS © )ÚstrÚdest)Ú.0Úor r ú>/usr/lib/python3.8/site-packages/pip/_internal/req/req_file.pyÚ
K s r Fc
c sj |dkrt dƒ‚t| ||d�\}} t| |ƒ}
|
D ]4\}}t|| ||||||||d�
}
|
D ]
}|V qXq0dS )a1 Parse a requirements file and yield InstallRequirement instances.
:param filename: Path or url of requirements file.
:param finder: Instance of pip.index.PackageFinder.
:param comes_from: Origin description of requirements.
:param options: cli options.
:param session: Instance of pip.download.PipSession.
:param constraint: If true, parsing a constraint file rather than
requirements file.
:param wheel_cache: Instance of pip.wheel.WheelCache
:param use_pep517: Value of the --use-pep517 option.
NzCparse_requirements() missing 1 required keyword argument: 'session')Ú
comes_fromÚsession)Ú
use_pep517Ú
constraint)Ú TypeErrorr Ú
preprocessÚprocess_line)ÚfilenameÚfinderr! Úoptionsr" r$ Úwheel_cacher# Ú_ÚcontentÚ
lines_enumÚline_numberÚlineZreq_iterÚreqr r r r N s* ÿ ÿ
þc C s6 t | ¡ dd�}t|ƒ}t|ƒ}t||ƒ}t|ƒ}|S )z˜Split, filter, and join lines, and return a line iterator
:param content: the content of the requirements file
:param options: cli options
é )Ústart)Ú enumerateÚ
splitlinesÚ
join_linesÚignore_commentsÚ
skip_regexÚexpand_env_variables)r- r* r. r r r r&