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&