????

Your IP : 216.73.216.152


Current Path : /usr/lib/python2.7/site-packages/pip/_internal/req/
Upload File :
Current File : //usr/lib/python2.7/site-packages/pip/_internal/req/req_file.pyc

�
}�\]c
@@s�dZddlmZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddl
mZddlmZddlmZdd	lmZdd
lmZmZddlmZeroddlmZmZmZmZmZm Z m!Z!m"Z"dd
l#m$Z$ddl%m&Z&ddl'm(Z(ddlm)Z)ee"e*e!fZ+ndgZ,ej-dej.�Z/ej-d�Z0ej-d�Z1ej2ej3ej4ej5ej6ej7ej8ej9ej:ej;ej<ej=ej>g
Z?ej@ejAejBgZCgeCD]ZDeEeD�jF�^qZGddddeIddd�ZJd�ZKddddddeId�ZLd�ZMd�ZNd�ZOd�ZPd�ZQd�ZRdS(s
Requirements file parsing
i(tabsolute_importN(tfilterfalse(tparse(t
cmdoptions(tget_file_content(tRequirementsFileParseError(tSearchScope(tinstall_req_from_editabletinstall_req_from_line(tMYPY_CHECK_RUNNING(tAnytCallabletIteratortListtNoReturntOptionaltTexttTuple(tInstallRequirement(t
WheelCache(t
PackageFinder(t
PipSessiontparse_requirementss^(http|https|file):s(^|\s+)#.*$s#(?P<var>\$\{(?P<name>[A-Z0-9_]+)\})cc@s�|dkrtd��nt|d|d|�\}}	t|	|�}
xW|
D]O\}}t||||||||d|d|�}
x|
D]}|Vq�WqOWdS(s1Parse 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.
    sCparse_requirements() missing 1 required keyword argument: 'session't
comes_fromtsessiont
use_pep517t
constraintN(tNonet	TypeErrorRt
preprocesstprocess_line(tfilenametfinderRtoptionsRRtwheel_cacheRt_tcontentt
lines_enumtline_numbertlinetreq_itertreq((s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyRJs
cC@sOt|j�dd�}t|�}t|�}t||�}t|�}|S(s�Split, filter, and join lines, and return a line iterator

    :param content: the content of the requirements file
    :param options: cli options
    tstarti(t	enumeratet
splitlinest
join_linestignore_commentst
skip_regextexpand_env_variables(R$R!R%((s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyRusc
!c@st|�}
|
j�}d|_|r6|j|_nt|�\}}
tjdkri|
jd�}
n|
j	t
j|
�|�\}}d|	r�dnd||f}|rn|r�|jnt
}|r�tj||�ni}x>tD]6}||jkr�|j|r�|j|||<q�q�Wdj||�}t|d	|d
|d|d|d
|d|	d|�Vn�|jr�|r�|jnt
}t|jdd	|d
|d|	d|d
|�Vn>|js�|jr�|jr�|jd}t
}n|jd}t}tj|�r'tj||�}n3tj|�sZtjjtjj |�|�}nt!|||||d|d
|�}x||D]}|Vq�Wnf|j"r�|j"|_"nN|r�|j#}|j$}|jr�|jg}n|j%tkr�g}n|j&r|j'|j&�n|j#r�|j#d}tjj tjj(|��}tjj||�}tjj)|�rw|}n|j*|�nt+d|d|�}||_,|j-r�|j.�nx?|j/p�gD]+}dj||�} |j0|d| �q�WndS(s#Process a single requirements line; This can result in creating/yielding
    requirements, or updating the finder.

    For lines that contain requirements, the only options that have an effect
    are from SUPPORTED_OPTIONS_REQ, and they are scoped to the
    requirement. Other options from SUPPORTED_OPTIONS may be present, but are
    ignored.

    For lines that do not contain requirements, the only options that have an
    effect are from SUPPORTED_OPTIONS. Options from SUPPORTED_OPTIONS_REQ may
    be present, but are ignored. These lines may contain multiple options
    (although our docs imply only one is supported), and all our parsed and
    affect the finder.

    :param constraint: If True, parsing a constraints file.
    :param options: OptionParser options that we may update
    iiitutf8s%s %s (line %s)s-cs-rs
line {} of {}RRtisolatedR!R"Rtline_sourceit
find_linkst
index_urlstsourceN(iii(1tbuild_parsertget_default_valuesRt	index_urltformat_controltbreak_args_optionstsystversion_infotencodet
parse_argstshlextsplitt
isolated_modetFalseRtcheck_install_build_globaltSUPPORTED_OPTIONS_REQ_DESTt__dict__tformatRt	editablesRtrequirementstconstraintstTruet	SCHEME_REtsearchturllib_parseturljointostpathtjointdirnameRtrequire_hashesR4R5tno_indextextra_index_urlstextendtabspathtexiststappendRtsearch_scopetpretset_allow_all_prereleasest
trusted_hoststadd_trusted_host(!R'RR&R RR!RR"RRtparsertdefaultstargs_strtoptions_strtoptsR#tline_comes_fromR2treq_optionstdestR3treq_pathtnested_constrainttparsed_reqsR)R4R5tvaluetreq_dirtrelative_to_reqs_fileR[thostR6((s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyR�s�	
		
	
$
							
				
cC@s�|jd�}g}|}xJ|D]B}|jd�sG|jd�rKPq#|j|�|jd�q#Wdj|�dj|�fS(s�Break up the line into an args and options string.  We only want to shlex
    (and then optparse) the options, not the args.  args can contain markers
    which are corrupted by shlex.
    t t-s--i(RAt
startswithRZtpopRR(R'ttokenstargsR!ttoken((s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyR;s

c@s_tjdt�}tt}x$|D]}|�}|j|�q#W�fd�}||_|S(s7
    Return a parser for parsing requirement lines
    tadd_help_optionc@s d�|f}t|��dS(NsInvalid requirement: %s
%s(R(tselftmsg(R'(s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pytparser_exit2s(toptparsetOptionParserRCtSUPPORTED_OPTIONStSUPPORTED_OPTIONS_REQt
add_optiontexit(R'R`toption_factoriestoption_factorytoptionRy((R's9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyR7$s

		cc@s�d}g}x�|D]�\}}|jd�s>tj|�r�tj|�rZd|}n|r�|j|�|dj|�fVg}q�||fVq|s�|}n|j|jd��qW|r�|dj|�fVndS(s�Joins a line ending in '' with the previous line (except when following
    comments).  The joined line takes on the index of the first line.
    s\RotN(Rtendswitht
COMMENT_REtmatchRZRRtstrip(R%tprimary_line_numbertnew_lineR&R'((s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyR->s 

		cc@sMxF|D]>\}}tjd|�}|j�}|r||fVqqWdS(s1
    Strips comments and filter empty lines.
    R�N(R�tsubR�(R%R&R'((s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyR.\s
c@sI|r|jnd}|rEtj|��t�fd�|�}n|S(ss
    Skip lines that match '--skip-requirements-regex' pattern

    Note: the regex pattern is only built once
    c@s�j|d�S(Ni(RM(te(tpattern(s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyt<lambda>rsN(tskip_requirements_regexRtretcompileR(R%R!R/((R�s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyR/hs
cc@ssxl|D]d\}}xJtj|�D]9\}}tj|�}|sJq#n|j||�}q#W||fVqWdS(s�Replace all environment variables that can be retrieved via `os.getenv`.

    The only allowed format for environment variables defined in the
    requirement file is `${MY_VARIABLE_1}` to ensure two things:

    1. Strings that contain a `$` aren't accidentally (partially) expanded.
    2. Ensure consistency across platforms for requirement files.

    These points are the result of a discussion on the `github pull
    request #3514 <https://github.com/pypa/pip/pull/3514>`_.

    Valid characters in variable names follow the `POSIX standard
    <http://pubs.opengroup.org/onlinepubs/9699919799/>`_ and are limited
    to uppercase letter, digits and the `_` (underscore).
    N(t
ENV_VAR_REtfindallRPtgetenvtreplace(R%R&R'tenv_vartvar_nameRk((s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyR0vs(St__doc__t
__future__RRzRPR�R@R<tpip._vendor.six.movesRtpip._vendor.six.moves.urllibRRNtpip._internal.cliRtpip._internal.downloadRtpip._internal.exceptionsRt!pip._internal.models.search_scopeRtpip._internal.req.constructorsRRtpip._internal.utils.typingR	ttypingR
RRR
RRRRtpip._internal.reqRtpip._internal.cacheRtpip._internal.indexRRtinttReqFileLinest__all__R�tIRLR�R�RJteditableRIRUR9R4textra_index_urltalways_unzipt	no_binarytonly_binaryR\ttrusted_hostRTR|tinstall_optionstglobal_optionsthashR}totstrRgRERRCRRRR;R7R-R.R/R0(((s9/tmp/pip-install-ewDPok/pip/pip/_internal/req/req_file.pyt<module>s~:	%#	�