PK! __init__.pynu[PK!kv __init__.pycnu[ abc@sdS(N((((s;/usr/lib/python2.7/site-packages/pip/operations/__init__.pyttPK!kv __init__.pyonu[ abc@sdS(N((((s;/usr/lib/python2.7/site-packages/pip/operations/__init__.pyttPK!eb66check.pynu[ def check_requirements(installed_dists): missing_reqs_dict = {} incompatible_reqs_dict = {} for dist in installed_dists: key = '%s==%s' % (dist.project_name, dist.version) missing_reqs = list(get_missing_reqs(dist, installed_dists)) if missing_reqs: missing_reqs_dict[key] = missing_reqs incompatible_reqs = list(get_incompatible_reqs( dist, installed_dists)) if incompatible_reqs: incompatible_reqs_dict[key] = incompatible_reqs return (missing_reqs_dict, incompatible_reqs_dict) def get_missing_reqs(dist, installed_dists): """Return all of the requirements of `dist` that aren't present in `installed_dists`. """ installed_names = set(d.project_name.lower() for d in installed_dists) missing_requirements = set() for requirement in dist.requires(): if requirement.project_name.lower() not in installed_names: missing_requirements.add(requirement) yield requirement def get_incompatible_reqs(dist, installed_dists): """Return all of the requirements of `dist` that are present in `installed_dists`, but have incompatible versions. """ installed_dists_by_name = {} for installed_dist in installed_dists: installed_dists_by_name[installed_dist.project_name] = installed_dist for requirement in dist.requires(): present_dist = installed_dists_by_name.get(requirement.project_name) if present_dist and present_dist not in requirement: yield (requirement, present_dist) PK!% check.pycnu[ abc@sdZdZdZdS(cCsi}i}xt|D]l}d|j|jf}tt||}|rW||||jD]0}|jj|kr,|j||Vq,q,WdS(s\Return all of the requirements of `dist` that aren't present in `installed_dists`. css|]}|jjVqdS(N(Rtlower(t.0td((s8/usr/lib/python2.7/site-packages/pip/operations/check.pys sN(tsettrequiresRR tadd(RRtinstalled_namestmissing_requirementst requirement((s8/usr/lib/python2.7/site-packages/pip/operations/check.pyRs   ccsqi}x|D]}|||js  PK!% check.pyonu[ abc@sdZdZdZdS(cCsi}i}xt|D]l}d|j|jf}tt||}|rW||||jD]0}|jj|kr,|j||Vq,q,WdS(s\Return all of the requirements of `dist` that aren't present in `installed_dists`. css|]}|jjVqdS(N(Rtlower(t.0td((s8/usr/lib/python2.7/site-packages/pip/operations/check.pys sN(tsettrequiresRR tadd(RRtinstalled_namestmissing_requirementst requirement((s8/usr/lib/python2.7/site-packages/pip/operations/check.pyRs   ccsqi}x|D]}|||js  PK!"33JJ freeze.pynu[from __future__ import absolute_import import logging import re import pip from pip.req import InstallRequirement from pip.req.req_file import COMMENT_RE from pip.utils import get_installed_distributions from pip._vendor import pkg_resources from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.pkg_resources import RequirementParseError logger = logging.getLogger(__name__) def freeze( requirement=None, find_links=None, local_only=None, user_only=None, skip_regex=None, default_vcs=None, isolated=False, wheel_cache=None, skip=()): find_links = find_links or [] skip_match = None if skip_regex: skip_match = re.compile(skip_regex).search dependency_links = [] for dist in pkg_resources.working_set: if dist.has_metadata('dependency_links.txt'): dependency_links.extend( dist.get_metadata_lines('dependency_links.txt') ) for link in find_links: if '#egg=' in link: dependency_links.append(link) for link in find_links: yield '-f %s' % link installations = {} for dist in get_installed_distributions(local_only=local_only, skip=(), user_only=user_only): try: req = pip.FrozenRequirement.from_dist( dist, dependency_links ) except RequirementParseError: logger.warning( "Could not parse requirement: %s", dist.project_name ) continue installations[req.name] = req if requirement: # the options that don't get turned into an InstallRequirement # should only be emitted once, even if the same option is in multiple # requirements files, so we need to keep track of what has been emitted # so that we don't emit it again if it's seen again emitted_options = set() for req_file_path in requirement: with open(req_file_path) as req_file: for line in req_file: if (not line.strip() or line.strip().startswith('#') or (skip_match and skip_match(line)) or line.startswith(( '-r', '--requirement', '-Z', '--always-unzip', '-f', '--find-links', '-i', '--index-url', '--pre', '--trusted-host', '--process-dependency-links', '--extra-index-url'))): line = line.rstrip() if line not in emitted_options: emitted_options.add(line) yield line continue if line.startswith('-e') or line.startswith('--editable'): if line.startswith('-e'): line = line[2:].strip() else: line = line[len('--editable'):].strip().lstrip('=') line_req = InstallRequirement.from_editable( line, default_vcs=default_vcs, isolated=isolated, wheel_cache=wheel_cache, ) else: line_req = InstallRequirement.from_line( COMMENT_RE.sub('', line).strip(), isolated=isolated, wheel_cache=wheel_cache, ) if not line_req.name: logger.info( "Skipping line in requirement file [%s] because " "it's not clear what it would install: %s", req_file_path, line.strip(), ) logger.info( " (add #egg=PackageName to the URL to avoid" " this warning)" ) elif line_req.name not in installations: logger.warning( "Requirement file [%s] contains %s, but that " "package is not installed", req_file_path, COMMENT_RE.sub('', line).strip(), ) else: yield str(installations[line_req.name]).rstrip() del installations[line_req.name] yield( '## The following requirements were added by ' 'pip freeze:' ) for installation in sorted( installations.values(), key=lambda x: x.name.lower()): if canonicalize_name(installation.name) not in skip: yield str(installation).rstrip() PK!Ԟ+8ss freeze.pycnu[ abc @@sddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZddlmZejeZddddddedd d ZdS( i(tabsolute_importN(tInstallRequirement(t COMMENT_RE(tget_installed_distributions(t pkg_resources(tcanonicalize_name(tRequirementParseErrorc c@s|p g}d} |r-tj|j} ng} x9tjD].} | jdr=| j| jdq=q=Wx*|D]"} d| krv| j | qvqvWx|D]} d| VqWi} xst d|dd#d|D]V} yt j j | | }Wn'tk r tjd| jqnX|| |jR(( s-rs --requirements-Zs--always-unzips-fs --find-linkss-is --index-urls--pres--trusted-hosts--process-dependency-linkss--extra-index-url(%tNonetretcompiletsearchRt working_sett has_metadatatextendtget_metadata_linestappendRtpiptFrozenRequirementt from_distRtloggertwarningt project_nameRtsettopentstript startswithtrstriptaddtlentlstripRt from_editablet from_lineRtsubtinfotstrtsortedtvaluesR(t requirementt find_linksRR t skip_regexR R RRt skip_matchtdependency_linkstdisttlinkt installationstreqtemitted_optionst req_file_pathtreq_filetlinetline_reqt installation((s9/usr/lib/python2.7/site-packages/pip/operations/freeze.pytfreezes                      ((t __future__RtloggingRRtpip.reqRtpip.req.req_fileRt pip.utilsRt pip._vendorRtpip._vendor.packaging.utilsRtpip._vendor.pkg_resourcesRt getLoggert__name__R!RtFalseRB(((s9/usr/lib/python2.7/site-packages/pip/operations/freeze.pyts     PK!Ԟ+8ss freeze.pyonu[ abc @@sddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZddlmZejeZddddddedd d ZdS( i(tabsolute_importN(tInstallRequirement(t COMMENT_RE(tget_installed_distributions(t pkg_resources(tcanonicalize_name(tRequirementParseErrorc c@s|p g}d} |r-tj|j} ng} x9tjD].} | jdr=| j| jdq=q=Wx*|D]"} d| krv| j | qvqvWx|D]} d| VqWi} xst d|dd#d|D]V} yt j j | | }Wn'tk r tjd| jqnX|| |jR(( s-rs --requirements-Zs--always-unzips-fs --find-linkss-is --index-urls--pres--trusted-hosts--process-dependency-linkss--extra-index-url(%tNonetretcompiletsearchRt working_sett has_metadatatextendtget_metadata_linestappendRtpiptFrozenRequirementt from_distRtloggertwarningt project_nameRtsettopentstript startswithtrstriptaddtlentlstripRt from_editablet from_lineRtsubtinfotstrtsortedtvaluesR(t requirementt find_linksRR t skip_regexR R RRt skip_matchtdependency_linkstdisttlinkt installationstreqtemitted_optionst req_file_pathtreq_filetlinetline_reqt installation((s9/usr/lib/python2.7/site-packages/pip/operations/freeze.pytfreezes                      ((t __future__RtloggingRRtpip.reqRtpip.req.req_fileRt pip.utilsRt pip._vendorRtpip._vendor.packaging.utilsRtpip._vendor.pkg_resourcesRt getLoggert__name__R!RtFalseRB(((s9/usr/lib/python2.7/site-packages/pip/operations/freeze.pyts     PK! __init__.pynu[PK!kv ;__init__.pycnu[PK!kv  __init__.pyonu[PK!eb66check.pynu[PK!% Echeck.pycnu[PK!% check.pyonu[PK!"33JJ freeze.pynu[PK!Ԟ+8ss x+freeze.pycnu[PK!Ԟ+8ss %:freeze.pyonu[PK H