ó •abc@@s2dZddlmZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddlZddlmZddlmZddlmZdd lmZdd lmZd gZejd ejƒZejd ƒZejejejej ej!ej"ej#ej$ej%ej&ej'ej(ej)ej*ej+ej,ej-ej.ej/ej0ej1gZ2ej3ej4ej5gZ6ge6D]Z7e7ƒj8^qªZ9dddde;dd„Z<d„Z=ddddde;d„Z>d„Z?d„Z@d„ZAd„ZBd„ZCdS(s Requirements file parsing i(tabsolute_importN(tparse(t filterfalse(tget_file_content(tInstallRequirement(tRequirementsFileParseError(tRemovedInPip10Warning(t cmdoptionstparse_requirementss^(http|https|file):s (^|\s)+#.*$c c@s |dkrtdƒ‚nt|d|d|ƒ\}}t||ƒ} xQ| D]I\} } t| || |||||d|ƒ} x| D] } | Vq‰WqOWdS(s÷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 sCparse_requirements() missing 1 required keyword argument: 'session't comes_fromtsessiont constraintN(tNonet TypeErrorRt preprocesst process_line(tfilenametfinderR toptionsR R t wheel_cachet_tcontentt lines_enumt line_numbertlinetreq_itertreq((s4/usr/lib/python2.7/site-packages/pip/req/req_file.pyR@s    cC@sCt|jƒddƒ}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_regex(RRR((s4/usr/lib/python2.7/site-packages/pip/req/req_file.pyRas   c  c@sTtƒ} | jƒ} d| _|r3|j| _nt|ƒ\} } tjdkrf| jdƒ} n| j t j | ƒ| ƒ\} }d|r–dnd||f}| rM|r»|j nt }|rÚtj|| ƒni}x>tD]6}|| jkrç| j|rç| j|||úsN(iii(;t build_parsertget_default_valuesR t index_urltformat_controltbreak_args_optionstsyst version_infotencodet parse_argstshlextsplitt isolated_modetFalseRtcheck_install_build_globaltSUPPORTED_OPTIONS_REQ_DESTt__dict__Rt from_linet editablesR#t from_editablet requirementst constraintstTruet SCHEME_REtsearcht urllib_parseturljointostpathtjointdirnameRtrequire_hashestallow_externaltwarningstwarnRtallow_all_externaltallow_unverifiedt index_urlst use_wheeltpiptindextfmt_ctl_no_use_wheeltno_indextextra_index_urlstextendt find_linkstabspathtexiststappendtpretallow_all_prereleasestprocess_dependency_linkst trusted_hoststsecure_origins(RRRRR RR RR tparsertdefaultstargs_strt options_strtoptsRtline_comes_fromR"t req_optionstdestR#treq_pathtnested_constraintRtvaluetreq_dirtrelative_to_reqs_file((s4/usr/lib/python2.7/site-packages/pip/req/req_file.pyRns¤   !       $                      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(R1t startswithRVtpopRC(RttokenstargsRttoken((s4/usr/lib/python2.7/site-packages/pip/req/req_file.pyR+ýs  cC@sYtjdtƒ}tt}x$|D]}|ƒ}|j|ƒq#Wd„}||_|S(s7 Return a parser for parsing requirement lines tadd_help_optioncS@st|ƒ‚dS(N(R(tselftmsg((s4/usr/lib/python2.7/site-packages/pip/req/req_file.pyt parser_exits(toptparset OptionParserR3tSUPPORTED_OPTIONStSUPPORTED_OPTIONS_REQt add_optiontexit(R\toption_factoriestoption_factorytoptionRs((s4/usr/lib/python2.7/site-packages/pip/req/req_file.pyR'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\RitN(R tendswitht COMMENT_REtmatchRVRCtstrip(Rtprimary_line_numbertnew_lineRR((s4/usr/lib/python2.7/site-packages/pip/req/req_file.pyR"s     cc@sMxF|D]>\}}tjd|ƒ}|jƒ}|r||fVqqWdS(s1 Strips comments and filter empty lines. R}N(RtsubR(RRR((s4/usr/lib/python2.7/site-packages/pip/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(R>(te(tpattern(s4/usr/lib/python2.7/site-packages/pip/req/req_file.pytTR}N(tskip_requirements_regexR tretcompileR(RRR ((R†s4/usr/lib/python2.7/site-packages/pip/req/req_file.pyR Js  (Dt__doc__t __future__RRAR‰R0R,RtRGtpip._vendor.six.moves.urllibRR?tpip._vendor.six.movesRRMt pip.downloadRtpip.req.req_installRtpip.exceptionsRtpip.utils.deprecationRRt__all__RŠtIR=RR;teditableR:RPR)RStextra_index_urlRFRItno_allow_externalt allow_unsafetno_allow_unsafeRLt no_use_wheelt always_unzipt no_binaryt only_binaryRWRYt trusted_hostRERvtinstall_optionstglobal_optionsthashRwtoRcR5R R3RRRR+R'RRR (((s4/usr/lib/python2.7/site-packages/pip/req/req_file.pytsl