Viewing File: /usr/lib/python3.6/site-packages/pip/req/__pycache__/req_install.cpython-36.opt-1.pyc

3

aj@s0ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddlmZddlmZmZddlmZddlmZdd	lmZmZdd
lmZddlmZmZ ddl!m"Z"ddl#Z$dd
l%m&Z&m'Z'm(Z(ddl)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/m0Z0ddl1m2Z2m3Z3m4Z4m5Z5ddl6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGddlHmIZIddlJmKZKddlLmMZMddlNmOZOddlPmQZQddlRmSZSddlTmUZUddl#mVZVmWZWejXeYZZej[j\j]Z^ddZ_ddZ`GdddeaZbd d!Zcd$d"d#ZddS)%)absolute_importN)	sysconfig)change_root)
FeedParser)
pkg_resourcessix)
specifiers)Marker)InvalidRequirementRequirement)canonicalize_name)Versionparse)configparser)
native_str
get_stdlibWINDOWS)is_urlurl_to_pathpath_to_urlis_archive_file)InstallationErrorUninstallationError)bin_pyrunning_under_virtualenvPIP_DELETE_MARKER_FILENAMEbin_user)display_pathrmtreeask_path_exists
backup_diris_installable_dirdist_in_usersitedist_in_site_packagesdist_in_install_path
egg_link_pathcall_subprocessread_text_fileFakeFile_make_build_dir
ensure_dirget_installed_versionnormalize_path
dist_is_local)Hashes)RemovedInPip10Warning)
indent_log)SETUPTOOLS_SHIM)open_spinner)UninstallPathSet)vcs)move_wheel_filesWheelcCs6tjd|}d}|r*|jd}|jd}n|}||fS)Nz^(.+)(\[[^\]]+\])$)rematchgroup)pathmextrasZpath_no_extrasr?!/usr/lib/python3.6/req_install.py
_strip_extras9s
rAcCstdd|DS)Ncss|]}tj|VqdS)N)rZ
safe_extra).0extrar?r?r@	<genexpr>Fsz_safe_extras.<locals>.<genexpr>)set)r>r?r?r@_safe_extrasEsrFc@seZdZdQddZedRddZedSdd	Zd
dZdd
ZddZ	e
ddZe
ddZddZ
ddZddZe
ddZe
ddZe
ddZd d!Zd"d#Zd$d%Zd&d'Zejd(Ze
d)d*Zd+d,ZdTd-d.ZdUd/d0Zd1d2Zd3d4Zd5d6Z d7d8Z!dVd9d:Z"gdddfd;d<Z#d=d>Z$d?d@Z%dAdBZ&fdfdCdDZ'dEdFZ(e
dGdHZ)dWdIdJZ*dKdLZ+e
dMdNZ,dXdOdPZ-dS)YInstallRequirementNFTcsJf|_ttjrytWndtk
rtjjkr@d}n.dkrft	fddt
Drfd}ntj}t
d|fYnXtj|_|_||_|
|_||_||_||_||_|_||_|	dk	r|	|_noވj|_d|_d|_d|_d|_d|_||_d|_ d|_!d|_"d|_#d|_$|r.|ni|_%||_&d|_'|
|_(dS)Nz%It looks like a path. Does it exist ?=c3s|]}|kVqdS)Nr?)rBop)reqr?r@rDVsz.InstallRequirement.__init__.<locals>.<genexpr>z,= is not a valid operator. Did you mean == ?zInvalid requirement: '%s'
%sF))r>
isinstancerstring_typesrr
osr<sepany	operators	traceback
format_excrrFrJ
comes_from
constraint
source_direditable_wheel_cachelink
original_linkas_eggmarkersmarker_egg_info_pathsatisfied_byconflicts_with_temp_build_dir_ideal_build_dirupdateinstall_succeededuninstallednothing_to_uninstall
use_user_site
target_diroptions	pycompileZpreparedisolated)selfrJrSrUrVrXrZrbrir[rjrhwheel_cacherTadd_msgr?)rJr@__init__KsN zInstallRequirement.__init__cCspddlm}t||\}	}
}|
jdr0t|
}nd}||	||d||
|||rP|ni|d	}
|dk	rlt||
_|
S)Nr)Linkzfile:T)rUrVrXrTrjrhrl)	pip.indexroparse_editable
startswithrrFr>)clseditable_reqrSdefault_vcsrjrhrlrTronameurlZextras_overriderUresr?r?r@
from_editables 



z InstallRequirement.from_editablec
Csddlm}t|rd}nd}||krR|j|d\}}	|	j}	|	sHd}	qVt|	}	nd}	|j}d}
tjjtjj	|}d}d}
t|r||}nt
|\}}
tjj|rtjj|ks|j
drt|std||t|}n0t|rtjj|stjd	||t|}|r||jd
krPtjd|jrP|ttjjtjj	|j}|jrtt|j}d|j|jf}
n|j}
n|}
|r|ni}||
|||	||||d
}|
rtt d|
j!|_!|S)zCreates an InstallRequirement from a name, which might be a
        requirement, directory containing 'setup.py', filename, or URL.
        r)roz; ;r7N.z;Directory %r is not installable. File 'setup.py' not found.zARequirement %r looks like a filename, but the file does not existfilez\.\./z%s==%s)rXr[rjrhrlrTplaceholder)"rprorsplitstripr	rMr<normpathabspathrAisdirrNrrr!rrrisfileloggerwarningschemer9searchrwis_wheelr6filenamervversionegg_fragmentrFrr>)rsrvrSrjrhrlrTroZ
marker_sepr[rJr<rXr>pwheelrxr?r?r@	from_linesb





zInstallRequirement.from_linecCs|jr(t|j}|jr:|d|jj7}n|jr6|jjnd}|jdk	rX|dt|jj7}|jrt|jt	j
rt|j}n
|jj}|r|d|7}|S)Nz from %sz in %sz
 (from %s))rJstrrXrwr^rlocationrSrKrrL	from_path)rksrSr?r?r@__str__s


zInstallRequirement.__str__cCsd|jjt||jfS)Nz<%s object: %s editable=%r>)	__class____name__rrV)rkr?r?r@__repr__szInstallRequirement.__repr__cCs^|jdkr|j|||_|jdk	rZ|rZ|j}|jj|j|j|_||jkrZtjd|jdS)aEnsure that if a link can be found for this, that it is found.

        Note that self.link may still be None - if Upgrade is False and the
        requirement is already installed.

        If require_hashes is True, don't use the wheel cache, because cached
        wheels, always built locally, have different hashes than the files
        downloaded from the index server and thus throw false hash mismatches.
        Furthermore, cached wheels at present have undeterministic contents due
        to file modification times.
        NzUsing cached wheel link: %s)rXZfind_requirementrWZcached_wheelrvrdebug)rkfinderZupgradeZrequire_hashesZold_linkr?r?r@
populate_link	s

z InstallRequirement.populate_linkcCs|jjS)N)rJ	specifier)rkr?r?r@rszInstallRequirement.specifiercCs$|j}t|dko"tt|jdkS)zReturn whether I am pinned to an exact version.

        For example, some-package==1.2 is pinned; some-package>1.2 is not.
        r7=====)rr)rlennextiteroperator)rkrr?r?r@	is_pinned!szInstallRequirement.is_pinnedcCsR|jdkrdSt|j}|jrNt|jtjr4|j}n
|jj}|rN|d|7}|S)Nz->)rJrrSrKrrLr)rkrrSr?r?r@r+s


zInstallRequirement.from_pathcCs|jdk	r|jS|jdkr<tjjtjdd|_||_|jS|jrN|j	j
}n|j	}tjj|sttj
d|t|tjj||S)Nz-buildzpip-zCreating directory %s)r`rJrMr<realpathtempfilemkdtemprarVrvlowerexistsrrr)join)rk	build_dirrvr?r?r@build_location8s

z!InstallRequirement.build_locationcCs|jdk	rdS|j}d|_|j|j}tjj|rBtdt|t	j
d|t|t|tj||||_d|_||_d|_
dS)aMove self._temp_build_dir to self._ideal_build_dir/self.req.name

        For some requirements (e.g. a path to a directory), the name of the
        package is not available until we run egg_info, so the build_location
        will return a temporary directory and store the _ideal_build_dir.

        This is only called by self.egg_info_path to fix the temporary build
        directory.
        Nz<A package already exists in %s; please remove it to continuez,Moving package %s from %s to new location %s)rUr`rrarMr<rrrrrshutilmover])rkZold_locationZnew_locationr?r?r@_correct_build_locationSs"

z*InstallRequirement._correct_build_locationcCs |jdkrdSttj|jjS)N)rJrrZ	safe_namerv)rkr?r?r@rvss
zInstallRequirement.namecCstjj|j|jr|jjpdS)N)rMr<rrUrXZsubdirectory_fragment)rkr?r?r@setup_py_diryszInstallRequirement.setup_py_dircCs|yddl}Wn:tk
rFtddkr.d}ntj}td|YnXtjj|j	d}t
jrxt|t
j
rx|jtj}|S)Nr
setuptoolszPlease install setuptools.zWCould not import setuptools which is required to install from a source distribution.
%szsetup.py)rImportErrorr+rQrRrrMr<rrrPY2rKZ	text_typeencodesysgetfilesystemencoding)rkrrmsetup_pyr?r?r@rszInstallRequirement.setup_pyc
CsP|jrtjd|j|jntjd|j|jtxt|j}tjd|g}|j	rZ|dg7}|dg}|j
rpg}n tjj
|jd}t|ddg}t|||jdd	d
WdQRX|jstt|jdtrd}nd
}tdj
|jd||jdg|_|jnDt|jd}t|jj|krLtjd|j|j||jt||_dS)Nz2Running setup.py (path:%s) egg_info for package %sz7Running setup.py (path:%s) egg_info for package from %sz-cz
--no-user-cfgegg_infozpip-egg-infoz
--egg-baseFzpython setup.py egg_info)cwdshow_stdoutZcommand_descr
z==z===rNamezuRunning setup.py (path:%s) egg_info for package %s produced metadata for project name %s. Fix your #egg=%s fragments.)rvrrrrXr0r1r
executablerjrVrMr<rrr*r&rJrK
parse_versionpkg_infor
rrrr)rkscriptZbase_cmdZegg_info_cmdZegg_base_optionegg_info_dirrIZ
metadata_namer?r?r@run_egg_infosN




zInstallRequirement.run_egg_infocCsL|jdk	r&|jj|sdS|jj|S|j|}tjj|s@dSt|}|S)N)r^has_metadataget_metadata
egg_info_pathrMr<rr')rkrdatar?r?r@
egg_info_datas

z InstallRequirement.egg_info_datacsf|jdkrV|jr|j}ntjj|jd}tj|}|jrg}xtj|D]\}}x t	j
D]}||kr^|j|q^Wxjt|D]^}tjj
tjj|ddstjjtjj|ddr|j|q|dks|dkr|j|qW|jfdd	|DqLWd
d	|D}|s$td||ft|dkrB|jd
ddtjj||d|_tjj|j|S)Nzpip-egg-infobinpythonZScriptsz
Python.exeZtestZtestscsg|]}tjj|qSr?)rMr<r)rBdir)rootr?r@
<listcomp>sz4InstallRequirement.egg_info_path.<locals>.<listcomp>cSsg|]}|jdr|qS)z	.egg-info)endswith)rBfr?r?r@rsz$No files/directories in %s (from %s)r7cSs(|jtjjtjjr"|jtjjp$dS)Nr)countrMr<rNaltsep)xr?r?r@<lambda>
sz2InstallRequirement.egg_info_path.<locals>.<lambda>)keyr)r]rVrUrMr<rrlistdirwalkr4dirnamesremovelistlexistsrextendrrsort)rkrbase	filenamesdirsfilesrr?)rr@rs>
z InstallRequirement.egg_info_pathcCs@t}|jd}|s*tjdt|jd|j|p4d|jS)NzPKG-INFOzNo PKG-INFO file found in %sr)rrrrrrZfeedclose)rkrrr?r?r@rs
zInstallRequirement.pkg_infoz	\[(.*?)\]cCs
t|jS)N)r+rv)rkr?r?r@installed_version sz$InstallRequirement.installed_versioncCsL|jd}|jjr2||jjkr2tjd||jntjdt|j||dS)Nrz'Requested %s, but installing version %sz;Source in %s has version %s, which satisfies requirement %s)	rrJrrrrrrrU)rkrr?r?r@assert_source_matches_version$s
z0InstallRequirement.assert_source_matches_versioncCs|jstjd|jdS|jjdkr(dS|js2dS|jjjdd\}}tj	|}|r||jj}|rr|j
|jq|j|jndS)Nz>Cannot update repository at %s; repository location is unknownr|+r7)rXrrrUrrbrwr~r4get_backendobtainZexport)rkrvc_typerwbackendZvcs_backendr?r?r@update_editable5s"
z"InstallRequirement.update_editablecsT|jstd|jf|jp"|j}t|j}t|sTtj	d|j
|tjd|_
dS|tkrxtj	d|j
|d|_
dSt|}t|}djtj|j}|jotjj|j}t|jdd}|o|jjdo|jj|r|j|j|jd	r2x|jd	jD](}	tjj tjj!|j|	}
|j|
qWn|jd
r|jdrV|jdngxjfdd
|jd
jDD]J}tjj!|j|}
|j|
|j|
d|j|
d|j|
dqxWn$|rt"j#dj|jt$|j|n|jjdrF|j|jtjj%|jd}tjj!tjj&|jd}
|j'|
d|n|r~|jjdr~xt(j)j*|D]}
|j|
qhWnp|rt+|d}tjj,|j-j.}WdQRX|j|tjj!tjj&|d}
|j'|
|jntj/d||j|jdrb|j0drbxZ|j1dD]L}t2|r&t3}nt4}|jtjj!||t5r|jtjj!||dqW|jdr@t6j7r|i}ndd"i}t8j9f|}|j:t;|j<d|j=dr@x|j>dD]\}}t2|rt3}nt4}|jtjj!||t5r|jtjj!||d|jtjj!||d |jtjj!||d!qW|j?|||_@dS)#a
        Uninstall the distribution currently satisfying this requirement.

        Prompts before removing or modifying files unless
        ``auto_confirm`` is True.

        Refuses to delete or modify files outside of ``sys.prefix`` -
        thus uninstallation within a virtual environment can only
        modify that virtual environment, even if the virtualenv is
        linked to global site-packages.

        z.Cannot uninstall requirement %s, not installedz1Not uninstalling %s at %s, outside environment %sTNz<Not uninstalling %s at %s, as it is in the standard library.z{0}.egg-infor<z	.egg-infozinstalled-files.txtz
top_level.txtznamespace_packages.txtcsg|]}|r|kr|qSr?r?)rBr)
namespacesr?r@rsz0InstallRequirement.uninstall.<locals>.<listcomp>z.pyz.pycz.pyozUninstalling a distutils installed project ({0}) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.z.eggr7zeasy-install.pthz./z
.dist-inforz)Not sure how to uninstall: %s - Check: %sscriptsz.batzentry_points.txtZ
delimitersrHZconsole_scriptsz.exez
.exe.manifestz
-script.py)rH)Acheck_if_existsrrvr^r_r,rr-rinforrprefixrerr3r%formatrZto_filenameproject_namerrMr<rgetattrZ	_providerraddrr
splitlinesrrwarningswarnr/r~dirnameZadd_pthpiprZuninstallation_pathsopennormcasereadlinerrZmetadata_isdirZmetadata_listdirr"rrrrrrZSafeConfigParserZreadfpr(Zget_metadata_linesZhas_sectionitemsrrd)rkZauto_confirmZdistZ	dist_pathZpaths_to_removeZdevelop_egg_linkZdevelop_egg_link_egg_infoZegg_info_existsZdistutils_egg_infoZinstalled_filer<Z
top_level_pkgZeasy_install_eggZeasy_install_pthZfhZlink_pointerrZbin_dirrhconfigrvvaluer?)rr@	uninstallRs









zInstallRequirement.uninstallcCs$|jr|jjntjd|jdS)Nz'Can't rollback %s, nothing uninstalled.)rdZrollbackrerrorrv)rkr?r?r@rollback_uninstallsz%InstallRequirement.rollback_uninstallcCs*|jr|jjn|js&tjd|jdS)Nz%Can't commit %s, nothing uninstalled.)rdZcommitrerrrv)rkr?r?r@commit_uninstalls
z#InstallRequirement.commit_uninstallcCsd}d|j|jdf}tjj||}tjj|rtdt|d}|dkrTd	}nj|dkrxtj	d
t|tj
|nF|dkrt|}tj	dt|t|tj
||n|dkrtjd|rtj|dtjdd
}tjjtjj|j}xtj|D]\}	}
}d|
kr|
j
dxR|
D]J}tjj|	|}|j||}
tj|jd|
d}d|_|j|dqWxL|D]D}|tkrqrtjj|	|}|j||}
|j||jd|
qrWqW|jtjdt|dS)NTz	%s-%s.ziprz8The file %s exists. (i)gnore, (w)ipe, (b)ackup, (a)bort iwbaFzDeleting %szBacking up %s to %sr7)Z
allowZip64zpip-egg-info/irzSaved %s)rrrri)rvrrMr<rrrrrrrr rrrexitzipfileZZipFileZZIP_DEFLATEDrrrr_clean_zip_nameZZipInfoZ
external_attrZwritestrrwriterr)rkrZcreate_archiveZarchive_nameZarchive_pathZresponseZ	dest_fileziprdirpathrrrrvZzipdirrr?r?r@archivesV






"zInstallRequirement.archivecCs(|t|dd}|jtjjd}|S)Nr7r)rreplacerMr<rN)rkrvrr?r?r@r5sz"InstallRequirement._clean_zip_namecs0|sd}jdk	r(tfdd|DSdSdS)Nrc3s|]}jjd|iVqdS)rCN)r[Zevaluate)rBrC)rkr?r@rDDsz3InstallRequirement.match_markers.<locals>.<genexpr>T)r)r[rO)rkZextras_requestedr?)rkr@
match_markers=s


z InstallRequirement.match_markersc,s`|jr|j|||ddS|jr\tjj|j}tjj||j|j	|j||dd|_
dS||jjdg7}||jjdg7}|j
rt|dg}tjdd}tjj|d	}z|j|||}	d
|jf}
t|
.}tt|	||jd|dWdQRXWdQRXtjj|s(tjd
|dSd|_
|jr:dSfdd}t|H}
x@|
D](}tjj|}|jdrV||}PqVWtj d|dSWdQRXg}t|P}
xH|
D]@}|j!}tjj"|r|tjj#7}|j$tjj%|||qWWdQRXtjj|d}t|d}
|
j&dj|dWdQRXWdtjj|rRtj'|t(|XdS)N)r)rrstrip_file_prefixTglobal_optionsinstall_optionsz
--no-user-cfgz-recordzpip-zinstall-record.txtzRunning setup.py install for %sF)rrspinnerzRecord file %s not foundcs(dkstjj|r|St|SdS)N)rMr<isabsr)r<)rr?r@prepend_root~sz0InstallRequirement.install.<locals>.prepend_rootz	.egg-infoz;Could not find .egg-info directory in install record for %szinstalled-files.txtr
))rVinstall_editablerrrZ
wheel_versionrUZcheck_compatibilityrvr5rcrhgetrjrrrrMr<rget_install_argsr2r0r&rrrrrZrrrrrrrNappendrelpathr	rr)rkrrrrrrZ
temp_locationrecord_filenameinstall_argsmsgrrrlineZ	directoryrZ	new_linesrZinst_files_pathr?)rr@installIs~




"
zInstallRequirement.installcCs|jdkr|j||_|jS)aAEnsure that a source_dir is set.

        This will create a temporary build dir if the name of the requirement
        isn't known yet.

        :param parent_dir: The ideal pip parent_dir for the source_dir.
            Generally src_dir for editables and build_dir for sdists.
        :return: self.source_dir
        N)rUr)rkZ
parent_dirr?r?r@ensure_has_source_dirs

z(InstallRequirement.ensure_has_source_dircCstjdg}|jd|jt|j|t|dd|g7}|jsJ|dg7}|dk	r^|d|g7}|dk	rr|d|g7}|jr|dg7}n
|d	g7}trd
t	j
}|dtjj
tjdd
||jg7}|S)Nz-uz-crz--recordz#--single-version-externally-managedz--rootz--prefixz	--compilez--no-compilerz--install-headersincludeZsite)rrrr1rrrZrirrget_python_versionrMr<rrrv)rkrrrrrZ
py_ver_strr?r?r@rs(



z#InstallRequirement.get_install_argscCsd|jr6tjjtjj|jtr6tjd|jt|jd|_|j	rZtjj|j	rZt|j	d|_	dS)zVRemove the source files from this requirement, if they are marked
        for deletionzRemoving source in %sN)
rUrMr<rrrrrrr`)rkr?r?r@remove_temporary_sources

z*InstallRequirement.remove_temporary_sourcecCstjd|j|jr"t|dg}|r>dj|g}t||}t<ttj	dt
|jgt|ddgt||jddWdQRXd	|_
dS)
NzRunning setup.py develop for %sz
--no-user-cfgz--prefix={0}z-cZdevelopz	--no-depsF)rrT)rrrvrjrrr0r&rrr1rrrc)rkrrrZprefix_paramr?r?r@rs z#InstallRequirement.install_editablecCs|jdkrdSyFtt|j}d|_tjt||_|jrR|jrR|j|_d|_dSWntj	k
rjdStj
k
rtj|jj}|jrt
|r||_qtrt|rtd|j|jfnt|r||_YnXdS)zFind an installed distribution that satisfies or conflicts
        with this requirement, and set self.satisfied_by or
        self.conflicts_with appropriately.
        NFTzVWill not install to the user site because it will lack sys.path precedence to %s in %s)rJrrr\rZget_distributionr^rVr_ZDistributionNotFoundZVersionConflictrvrfr"rr#rrrr$)rkZ	no_markerZ
existing_distr?r?r@rs4

z"InstallRequirement.check_if_existscCs|jo|jjS)N)rXr)rkr?r?r@r szInstallRequirement.is_wheelcCs,t|j|j||j|j|||j|j|d
dS)N)userhomerrrirjr)r5rvrJrfrgrirj)rkZwheeldirrrrr?r?r@r5$s
z#InstallRequirement.move_wheel_filescCsX|jdjd}tjj|}tj||}tjjtjj|d}tj	tjj|||dS)zAReturn a pkg_resources.Distribution built from self.egg_info_pathrrr)rmetadata)
rrstriprMr<rrZPathMetadatasplitextbasenameZDistribution)rkrZbase_dirr&Z	dist_namer?r?r@get_dist0s
zInstallRequirement.get_distcCst|jjdiS)zReturn whether any known-good hashes are specified as options.

        These activate --require-hashes mode; hashes specified as part of a
        URL do not.

        hashes)boolrhr)rkr?r?r@has_hash_options;sz#InstallRequirement.has_hash_optionscCsJ|jjdij}|r|jn|j}|rB|jrB|j|jgj|jt	|S)aReturn a hash-comparer that considers my option- and URL-based
        hashes to be known-good.

        Hashes in URLs--ones embedded in the requirements file, not ones
        downloaded from an index server--are almost peers with ones from
        flags. They satisfy --require-hashes (whether it was implicitly or
        explicitly activated) but do not activate it. md5 and sha224 are not
        allowed in flags, which should nudge people toward good algos. We
        always OR all hashes together, even ones from URLs.

        :param trust_internet: Whether to trust URL-based (#md5=...) hashes
            downloaded from the internet, as by populate_link()

        r+)
rhrcopyrXrYhash
setdefaultZ	hash_namerr.)rkZtrust_internetZgood_hashesrXr?r?r@r+Es

zInstallRequirement.hashes)NFNFTTNFNNF)NNFNNF)NFNNF)T)F)N)NNN)T).r
__module____qualname__rnclassmethodryrrrrpropertyrrrrrrvrrrrrrr9compileZ_requirements_section_rerrrrrrrrrrr rr#rrrr5r*r-r+r?r?r?r@rGIs`
;M

 :6


$0
\
)

rGcCstjd|}|r|jd}|S)z2
        Strip req postfix ( -dev, 0.2, etc )
    z^(.*?)(?:-dev|-\d.*)$r7)r9rr;)rJr:r?r?r@_strip_postfix[s
r6cCsddlm}|}d}tjd|}|r:|jd}|jd}n|}tjj|rttjjtjj	|dslt
d|t|}|jj
d	r||j}|r||td
|jjfS||dfSx,tD]$}|jj
d|rd||f}PqWd
|kr|r
tjdt|d
|}nt
d||jd
ddj}	tj|	s`d|dj	ddtjDd}
t
|
||j}|sxt
d|st
d|t||dfS)aParses an editable requirement into:
        - a requirement name
        - an URL
        - extras
        - editable options
    Accepted requirements:
        svn+http://blahblah@rev#egg=Foobar[baz]&subdirectory=version_subdir
        .[some_extra]
    r)roNz^(.+)(\[[^\]]+\])$r7r8zsetup.pyz;Directory %r is not installable. File 'setup.py' not found.zfile:r}z%s:z%s+%srzD--default-vcs has been deprecated and will be removed in the future.zb%s should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+zFor --editable=%s only z, cSsg|]}|jdqS)z+URL)rv)rBrr?r?r@rsz"parse_editable.<locals>.<listcomp>z is currently supportedz@Could not detect requirement name, please specify one with #egg=z@--editable=%s is not the right format; it must have #egg=Package)rpror9r:r;rMr<rrrrrrrrrrr>r4rrr/r~rZbackendsr6)rtrurorwr>r=Z
url_no_extrasZpackage_nameZversion_controlrZ
error_messager?r?r@rqgs`





rq)N)eZ
__future__rZloggingrMr9rrrrQrrZ	distutilsrZdistutils.utilrZemail.parserrZpip._vendorrrZpip._vendor.packagingrZpip._vendor.packaging.markersr	Z"pip._vendor.packaging.requirementsr
rZpip._vendor.packaging.utilsrZpip._vendor.packaging.versionr
rrZpip._vendor.six.movesrZ	pip.wheelrZ
pip.compatrrrZpip.downloadrrrrZpip.exceptionsrrZ
pip.locationsrrrrZ	pip.utilsrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-Zpip.utils.hashesr.Zpip.utils.deprecationr/Zpip.utils.loggingr0Zpip.utils.setuptools_buildr1Zpip.utils.uir2Zpip.req.req_uninstallr3Zpip.vcsr4r5r6Z	getLoggerrrZ	SpecifierZ
_operatorskeysrPrArFobjectrGr6rqr?r?r?r@<module>s`L

Back to Directory File Manager