Viewing File: /opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__pycache__/__init__.cpython-38.pyc

U

+aG@sRdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZzddlZWnek
rddlZYnXzeWne k
r&e!ZYnXddlm"Z"zddlm#Z#m$Z$m%Z%dZ&Wnek
rjdZ&YnXddlm'Z(dd	l)m*Z*m+Z+zddl,m-Z.e.j/Wnek
rdZ.YnXdd
l0m1Z1ddl0m2Z2e3de3d
e3de3dej4dkre5ddZ6dZ7dZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCdZDdZEdZFGdddeGZHddZIiZJddZKddZLddZMddZNddZOd d!ZPd"d#ZQd$d%ZRZSd&d'ZTd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGddHddIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdlgGZUGdmdCdCeVZWGdndDdDeWZXGdodpdpeXZYGdqdEdEeWZZGdrdFdFeWZ[iZ\dsj]ej4Z^dtZ_duZ`dvZadZbdwZcdxdgZddyd*Zegfdzd{Zfd|d}Zgd~dZheidZjeidZkehZlddLZmdd)ZnenZodd+Zpdd,Zqddd-Zrdd.ZsGddZdZZtGdd[d[etZuGdd>d>ZvGdddewZxGdd=d=ZyeyZzGddGdGe5Z{Gdd?d?Z|dd<Z}ddIZ~ddJZddOZddPZddQZdddRZGddadaZedeeddZGddbdbeZGddcdceZeGdd_d_eZeZGdddewZGdddeZGdddddeZedejeGdd\d\eZGdd]d]eZGdd^d^eZeKdidddeZddd9ZdddZeejedddZeeeddZdddZddZGdddZddZddZddZddZeejeee.dr\ee.jeeKdideKdidddfZdd„ZddĄZdd6ZdddhZddȄZeejeeejeee.dree.jeddʄZeeeddTZdd̈́ZifddτZddфZddӄZddՄZddׄZddMZeid١jZeidejejBjZGddBdBZdd݄ZGdd@d@ZGdddeZGdddeZeeedZddZddHZGddde2jjZGddAdAe2jjZddZddZddSZddZddNZddZe	jdeHddddZeeʃfddZeddZGddjdje̓ZdS(aZ
Package resource API
--------------------

A resource is a logical file contained within a package, or a logical
subdirectory thereof.  The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is.  Do not use os.path operations to manipulate resource
names being passed into the API.

The package resource API is designed to work with normal filesystem packages,
.egg files, and unpacked .egg files.  It can also work in a limited way with
.zip files and with custom PEP 302 loaders that support the ``get_data()``
method.
N)get_importer)utime)mkdirrenameunlinkTF)open)isdirsplit)appdirs)	packagingz&pkg_resources.extern.packaging.versionz)pkg_resources.extern.packaging.specifiersz+pkg_resources.extern.packaging.requirementsz&pkg_resources.extern.packaging.markers)zPython 3.5 or later is requiredc@seZdZdZdS)
PEP440Warningza
    Used when there is an issue with a version or specifier not complying with
    PEP 440.
    N__name__
__module____qualname____doc__rr>/tmp/pip-install-1bd_1mtk/setuptools/pkg_resources/__init__.pyrisrcCs8ztj|WStjjk
r2tj|YSXdSN)rversionVersionInvalidVersion
LegacyVersion)vrrr
parse_versionpsrcKs"t|tt||dSr)globalsupdate_state_varsdictfromkeys)vartypekwrrr_declare_statezsr$cCs8i}t}tD] \}}|d|||||<q|S)N_sget_)rritemsstategkrrrr__getstate__s
r+cCs8t}|D]$\}}|dt|||||q|S)N_sset_)rr&rr'rrr__setstate__sr-cCs|Sr)copyvalrrr
_sget_dictsr1cCs|||dSr)clearrkeyobr(rrr
_sset_dictsr6cCs|Sr)r+r/rrr_sget_objectsr7cCs||dSr)r-r3rrr_sset_objectsr8cGsdSrrargsrrr<lambda>r;cCsbt}t|}|dk	r^tjdkr^z&ddtdd|df}Wntk
r\YnX|S)aQReturn this platform's maximum compatible version.

    distutils.util.get_platform() normally reports the minimum version
    of macOS that would be required to *use* extensions produced by
    distutils.  But what we want when checking compatibility is to know the
    version of macOS that we are *running*.  To allow usage of packages that
    explicitly require a newer version of macOS, we must also know the
    current version of the OS.

    If this condition occurs for any other platform with a version in its
    platform strings, this function should be extended accordingly.
    Ndarwinzmacosx-%s-%s.r)	get_build_platformmacosVersionStringmatchsysplatformjoin_macos_versgroup
ValueError)platmrrrget_supported_platforms

&rKrequire
run_scriptget_providerget_distributionload_entry_point
get_entry_mapget_entry_infoiter_entry_pointsresource_stringresource_streamresource_filenameresource_listdirresource_existsresource_isdirdeclare_namespaceworking_setadd_activation_listenerfind_distributionsset_extraction_pathcleanup_resourcesget_default_cacheEnvironment
WorkingSetResourceManagerDistributionRequirement
EntryPointResolutionErrorVersionConflictDistributionNotFoundUnknownExtraExtractionErrorparse_requirements	safe_namesafe_versionget_platformcompatible_platformsyield_linessplit_sections
safe_extrato_filenameinvalid_markerevaluate_markerensure_directorynormalize_pathEGG_DISTBINARY_DISTSOURCE_DIST
CHECKOUT_DISTDEVELOP_DISTIMetadataProviderIResourceProviderFileMetadataPathMetadataEggMetadata
EmptyProviderempty_providerNullProviderEggProviderDefaultProviderZipProviderregister_finderregister_namespace_handlerregister_loader_typefixup_namespace_packagesrPkgResourcesDeprecationWarningrun_mainAvailableDistributionsc@seZdZdZddZdS)rgz.Abstract base for dependency resolution errorscCs|jjt|jSr)	__class__rreprr:selfrrr__repr__szResolutionError.__repr__N)rrrrrrrrrrgsc@s<eZdZdZdZeddZeddZddZd	d
Z	dS)rhz
    An already-installed version conflicts with the requested version.

    Should be initialized with the installed Distribution and the requested
    Requirement.
    z3{self.dist} is installed but {self.req} is requiredcCs
|jdSNrr9rrrrdistszVersionConflict.distcCs
|jdSNr9rrrrreqszVersionConflict.reqcCs|jjftSr	_templateformatlocalsrrrrreportszVersionConflict.reportcCs|s|S|j|f}t|S)zt
        If required_by is non-empty, return a version of self that is a
        ContextualVersionConflict.
        )r:ContextualVersionConflict)rrequired_byr:rrrwith_contextszVersionConflict.with_contextN)
rrrrrpropertyrrrrrrrrrhs

c@s&eZdZdZejdZeddZdS)rz
    A VersionConflict that accepts a third parameter, the set of the
    requirements that required the installed Distribution.
    z by {self.required_by}cCs
|jdS)Nr?r9rrrrrsz%ContextualVersionConflict.required_byN)rrrrrhrrrrrrrrs
rc@sHeZdZdZdZeddZeddZeddZd	d
Z	ddZ
d
S)riz&A requested distribution was not foundzSThe '{self.req}' distribution was not found and is required by {self.requirers_str}cCs
|jdSrr9rrrrr&szDistributionNotFound.reqcCs
|jdSrr9rrrr	requirers*szDistributionNotFound.requirerscCs|js
dSd|jS)Nzthe applicationz, )rrErrrr
requirers_str.sz"DistributionNotFound.requirers_strcCs|jjftSrrrrrrr4szDistributionNotFound.reportcCs|Sr)rrrrr__str__7szDistributionNotFound.__str__N)rrrrrrrrrrrrrrrri s


c@seZdZdZdS)rjz>Distribution doesn't have an "extra feature" of the given nameNrrrrrrj;sz{}.{}rr?rcCs|t|<dS)aRegister `provider_factory` to make providers for `loader_type`

    `loader_type` is the type or class of a PEP 302 ``module.__loader__``,
    and `provider_factory` is a function that, passed a *module* object,
    returns an ``IResourceProvider`` for that module.
    N)_provider_factories)loader_typeprovider_factoryrrrrIscCstt|tr$t|p"tt|dSztj|}Wn&tk
rXt	|tj|}YnXt
|dd}tt||S)z?Return an IResourceProvider for the named module or requirementr
__loader__N)
isinstancerer[findrLstrrCmodulesKeyError
__import__getattr
_find_adapterr)moduleOrReqmoduleloaderrrrrNSs
cCsd|s\td}|dkrLd}tj|rLttdrLt|}d|krL|d}||	d|dS)Nrz0/System/Library/CoreServices/SystemVersion.plist	readPlistProductVersionr>)
rDmac_verospathexistshasattrplistlibrappendr	)_cacherplist
plist_contentrrrrF`s

rFcCsddd||S)Nppc)PowerPCPower_Macintosh)get)machinerrr_macos_archpsrcCs~ddlm}|}tjdkrz|dszz>t}tddd}dt	|dt	|d	t
|fWStk
rxYnX|S)
zReturn this platform's string for platform-specific distributions

    XXX Currently this is the same as ``distutils.util.get_platform()``, but it
    needs some hacks for Linux and macOS.
    r)ror=zmacosx- _zmacosx-%d.%d-%sr)	sysconfigrorCrD
startswithrFrunamereplaceintrrH)rorIrrrrrr@ts

r@zmacosx-(\d+)\.(\d+)-(.*)zdarwin-(\d+)\.(\d+)\.(\d+)-(.*)cCs|dks|dks||krdSt|}|rt|}|st|}|rt|d}d|d|df}|dkr||dks|dkr|d	krdSd
S|d|dks|d|dkrd
St|dt|dkrd
SdSd
S)zCan code for the `provided` platform run on the `required` platform?

    Returns true if either platform is ``None``, or the platforms are equal.

    XXX Needs compatibility checks for Linux and other unixy OSes.
    NTrz%s.%sr?z10.3z10.4Fr)rArBdarwinVersionStringrrG)providedrequiredreqMacprovMac
provDarwindversionmacosversionrrrrps2


cCs<tdj}|d}|||d<t|d||dS)z@Locate distribution `dist_spec` and run its `script_name` scriptrrrNrC	_getframe	f_globalsr2rLrM)Z	dist_specscript_namensnamerrrrMs
cCs>t|trt|}t|tr&t|}t|ts:td||S)z@Return a current distribution object for a Requirement or stringz-Expected string, Requirement, or Distribution)rrreparserNrd	TypeErrorrrrrrOs




cCst|||S)zDReturn `name` entry point of `group` for `dist` or raise ImportError)rOrPrrGrrrrrPscCst||S)=Return the entry point map for `group`, or the full entry map)rOrQ)rrGrrrrQscCst|||Sz<Return the EntryPoint object for `group`+`name`, or ``None``)rOrRrrrrrRsc@s<eZdZddZddZddZddZd	d
ZddZd
S)r~cCsdS)z;Does the package's distribution contain the named metadata?Nrrrrrhas_metadataszIMetadataProvider.has_metadatacCsdS)z'The named metadata resource as a stringNrrrrrget_metadataszIMetadataProvider.get_metadatacCsdS)zYield named metadata resource as list of non-blank non-comment lines

       Leading and trailing whitespace is stripped from each line, and lines
       with ``#`` as the first non-blank character are omitted.Nrrrrrget_metadata_linessz$IMetadataProvider.get_metadata_linescCsdS)z>Is the named metadata a directory?  (like ``os.path.isdir()``)Nrrrrrmetadata_isdirsz IMetadataProvider.metadata_isdircCsdS)z?List of metadata names in the directory (like ``os.listdir()``)Nrrrrrmetadata_listdirsz"IMetadataProvider.metadata_listdircCsdS)z=Execute the named script in the supplied namespace dictionaryNr)r	namespacerrrrMszIMetadataProvider.run_scriptN)	rrrrrrrrrMrrrrr~sc@s@eZdZdZddZddZddZdd	Zd
dZdd
Z	dS)rz3An object that provides access to package resourcescCsdS)zdReturn a true filesystem path for `resource_name`

        `manager` must be an ``IResourceManager``Nrmanager
resource_namerrrget_resource_filenamesz'IResourceProvider.get_resource_filenamecCsdS)ziReturn a readable file-like object for `resource_name`

        `manager` must be an ``IResourceManager``Nrrrrrget_resource_streamsz%IResourceProvider.get_resource_streamcCsdS)zmReturn a string containing the contents of `resource_name`

        `manager` must be an ``IResourceManager``Nrrrrrget_resource_stringsz%IResourceProvider.get_resource_stringcCsdS)z,Does the package contain the named resource?Nrrrrrhas_resourceszIResourceProvider.has_resourcecCsdS)z>Is the named resource a directory?  (like ``os.path.isdir()``)NrrrrrrYsz IResourceProvider.resource_isdircCsdS)z?List of resource names in the directory (like ``os.listdir()``)NrrrrrrWsz"IResourceProvider.resource_listdirN)
rrrrrrrrrYrWrrrrrsc@seZdZdZd'ddZeddZeddZd	d
ZddZ	d
dZ
d(ddZddZddZ
d)ddZd*ddZd+ddZddZd,dd Zd!d"Zd#d$Zd%d&ZdS)-rbzDA collection of active distributions on sys.path (or a similar list)NcCs>g|_i|_i|_g|_|dkr&tj}|D]}||q*dS)z?Create working set from list of path entries (default=sys.path)N)entries
entry_keysby_key	callbacksrCr	add_entry)rrentryrrr__init__szWorkingSet.__init__cCsb|}zddlm}Wntk
r.|YSXz||Wntk
r\||YSX|S)z1
        Prepare the master working set.
        r)__requires__)__main__rImportErrorrLrh_build_from_requirements)clswsrrrr
_build_master*s
zWorkingSet._build_mastercCsf|g}t|}||t}|D]}||q"tjD]}||jkr8||q8|jtjdd<|S)zQ
        Build a working set from a requirement spec. Rewrites sys.path.
        N)rlresolveraaddrCrrr)rreq_specrreqsdistsrrrrrr>s

z#WorkingSet._build_from_requirementscCs<|j|g|j|t|dD]}|||dq$dS)aAdd a path item to ``.entries``, finding any distributions on it

        ``find_distributions(entry, True)`` is used to find distributions
        corresponding to the path entry, and they are added.  `entry` is
        always appended to ``.entries``, even if it is already present.
        (This is because ``sys.path`` can contain the same value more than
        once, and the ``.entries`` of the ``sys.path`` WorkingSet should always
        equal ``sys.path``.)
        TFN)r
setdefaultrrr]r)rrrrrrrTs
zWorkingSet.add_entrycCs|j|j|kS)z9True if `dist` is the active distribution for its project)rrr4rrrrr__contains__cszWorkingSet.__contains__cCs,|j|j}|dk	r(||kr(t|||S)aFind a distribution matching requirement `req`

        If there is an active distribution for the requested project, this
        returns it as long as it meets the version requirement specified by
        `req`.  But, if there is an active distribution for the project and it
        does *not* meet the `req` requirement, ``VersionConflict`` is raised.
        If there is no active distribution for the requested project, ``None``
        is returned.
        N)rrr4rh)rrrrrrrgs

zWorkingSet.findcsfdd|DS)aYield entry point objects from `group` matching `name`

        If `name` is None, yields all entry points in `group` from all
        distributions in the working set, otherwise only ones matching
        both `group` and `name` are yielded (in distribution order).
        c3s8|]0}|D]}dks*|jkr|VqqdSr)rQvaluesr).0rrrGrrr	<genexpr>~s
z/WorkingSet.iter_entry_points.<locals>.<genexpr>rrrGrrrrrSwszWorkingSet.iter_entry_pointscCs>tdj}|d}|||d<||d||dS)z?Locate distribution for `requires` and run `script_name` scriptrrrNr)rrequiresrrrrrrrMs
zWorkingSet.run_scriptccsLi}|jD]<}||jkrq
|j|D] }||kr$d||<|j|Vq$q
dS)zYield distributions for non-duplicate projects in the working set

        The yield order is the order in which the items' path entries were
        added to the working set.
        rN)rrr)rseenitemr4rrr__iter__s

zWorkingSet.__iter__TFcCs|r|j|j||d|dkr$|j}|j|g}|j|jg}|sV|j|jkrVdS||j|j<|j|krx||j|j|kr||j||dS)aAdd `dist` to working set, associated with `entry`

        If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
        On exit from this routine, `entry` is added to the end of the working
        set's ``.entries`` (if it wasn't already present).

        `dist` is only added to the working set if it's for a project that
        doesn't already have a distribution in the set, unless `replace=True`.
        If it's added, any callbacks registered with the ``subscribe()`` method
        will be called.
        rN)		insert_onrlocationrr	r4rr
_added_new)rrrinsertrkeyskeys2rrrrs

zWorkingSet.addcCsxt|ddd}i}i}g}t}	tt}
|rt|d}||krHq.|	||sVq.||j}|dkr|j	|j}|dks||kr|r|}
|dkr|dkrt
|j}nt
g}tg}
|j
||
||d}||j<|dkr|
|d}t||||||kr$|
|}t|||||jddd}|||D] }|
||j|j|	|<qHd||<q.|S)aList all distributions needed to (recursively) meet `requirements`

        `requirements` must be a sequence of ``Requirement`` objects.  `env`,
        if supplied, should be an ``Environment`` instance.  If
        not supplied, it defaults to all distributions available within any
        entry or distribution in the working set.  `installer`, if supplied,
        will be invoked with each requirement that cannot be met by an
        already-installed distribution; it should return a ``Distribution`` or
        ``None``.

        Unless `replace_conflicting=True`, raises a VersionConflict exception
        if
        any requirements are found on the path that have the correct name but
        the wrong version.  Otherwise, if an `installer` is supplied it will be
        invoked to obtain the correct version of the requirement and activate
        it.

        `extras` is a list of the extras to be used with these requirements.
        This is important because extra requirements may look like `my_req;
        extra = "my_extra"`, which would otherwise be interpreted as a purely
        optional requirement.  Instead, we want to be able to assert that these
        requirements are truly required.
        Nrr)replace_conflictingT)list
_ReqExtrascollectionsdefaultdictsetpopmarkers_passrr4rrarrb
best_matchrirrhrrextrasextendrproject_name)rrequirementsenv	installerrr%	processedbestto_activate
req_extrasrrrrr
dependent_reqnew_requirementsnew_requirementrrrrsT







zWorkingSet.resolvecCs
t|}|i}i}|dkr4t|j}||7}n||}|g}	tt|	j||D]}
||
D]}|g}z|	|||}
WnBt	k
r}z$|||<|rWYqfn
WYqZW5d}~XYqfXtt|	j|
|
t|
qZqfqZt|}|||fS)asFind all activatable distributions in `plugin_env`

        Example usage::

            distributions, errors = working_set.find_plugins(
                Environment(plugin_dirlist)
            )
            # add plugins+libs to sys.path
            map(working_set.add, distributions)
            # display errors
            print('Could not load', errors)

        The `plugin_env` should be an ``Environment`` instance that contains
        only distributions that are in the project's "plugin directory" or
        directories. The `full_env`, if supplied, should be an ``Environment``
        contains all currently-available distributions.  If `full_env` is not
        supplied, one is created automatically from the ``WorkingSet`` this
        method is called on, which will typically mean that every directory on
        ``sys.path`` will be scanned for distributions.

        `installer` is a standard installer callback as used by the
        ``resolve()`` method. The `fallback` flag indicates whether we should
        attempt to resolve older versions of a plugin if the newest version
        cannot be resolved.

        This method returns a 2-tuple: (`distributions`, `error_info`), where
        `distributions` is a list of the distributions found in `plugin_env`
        that were loadable, along with any other distributions that are needed
        to resolve their dependencies.  `error_info` is a dictionary mapping
        unloadable plugin distributions to an exception instance describing the
        error that occurred. Usually this will be a ``DistributionNotFound`` or
        ``VersionConflict`` instance.
        N)
rsortrarrmapras_requirementrrgrr r!)r
plugin_envfull_envr*fallbackplugin_projects
error_info
distributionsr)
shadow_setr'rr	resolveesrrrrfind_pluginss4$




zWorkingSet.find_pluginscGs&|t|}|D]}||q|S)aEnsure that distributions matching `requirements` are activated

        `requirements` must be a string or a (possibly-nested) sequence
        thereof, specifying the distributions and versions required.  The
        return value is a sequence of the distributions that needed to be
        activated to fulfill the requirements; all relevant distributions are
        included, even if they were already activated in this working set.
        )rrlr)rr(neededrrrrrLms	zWorkingSet.requirecCs8||jkrdS|j||s"dS|D]}||q&dS)zInvoke `callback` for all distributions

        If `existing=True` (default),
        call on all existing ones, as well.
        N)rr)rcallbackexistingrrrr	subscribe}s
zWorkingSet.subscribecCs|jD]}||qdSr)r)rrr?rrrrs
zWorkingSet._added_newcCs,|jdd|j|j|jddfSr)rrr.rrrrrrr+s
zWorkingSet.__getstate__cCs@|\}}}}|dd|_||_||_|dd|_dSr)rr.rrr)re_k_b_crrrrrrrr-s


zWorkingSet.__setstate__)N)N)NTF)NNFN)NNT)T)rrrrrclassmethodrrrrrrSrMrrrr=rLrArr+r-rrrrrbs4






]
T
c@seZdZdZdddZdS)rz>
    Map each requirement to the extras that demanded it.
    Ncs2fdd|d|pdD}jp0t|S)z
        Evaluate markers for req against each extra that
        demanded it.

        Return False if the req has a marker and fails
        evaluation. Otherwise, return True.
        c3s|]}jd|iVqdS)extraNmarkerevaluate)r
rDrrrrsz*_ReqExtras.markers_pass.<locals>.<genexpr>rr)rrFany)rrr%extra_evalsrrHrr#s
z_ReqExtras.markers_pass)N)rrrrr#rrrrrsrc@sxeZdZdZdeefddZddZddZdd	d
Z	ddZ
d
dZdddZdddZ
ddZddZddZdS)raz5Searchable snapshot of distributions on a search pathNcCs i|_||_||_||dS)a!Snapshot distributions available on a search path

        Any distributions found on `search_path` are added to the environment.
        `search_path` should be a sequence of ``sys.path`` items.  If not
        supplied, ``sys.path`` is used.

        `platform` is an optional string specifying the name of the platform
        that platform-specific distributions must be compatible with.  If
        unspecified, it defaults to the current platform.  `python` is an
        optional string naming the desired version of Python (e.g. ``'3.6'``);
        it defaults to the current version.

        You may explicitly set `platform` (and/or `python`) to ``None`` if you
        wish to map *all* distributions, not just those compatible with the
        running platform or Python version.
        N)_distmaprDpythonscan)rsearch_pathrDrLrrrrszEnvironment.__init__cCs2|jdkp|jdkp|j|jk}|o0t|j|jS)zIs distribution `dist` acceptable for this environment?

        The distribution must match the platform and python version
        requirements specified when this environment was created, or False
        is returned.
        N)rL
py_versionrprD)rr	py_compatrrrcan_adds

zEnvironment.can_addcCs|j|j|dS)z"Remove `dist` from the environmentN)rKr4remover
rrrrRszEnvironment.removecCs4|dkrtj}|D]}t|D]}||qqdS)adScan `search_path` for distributions usable in this environment

        Any distributions found are added to the environment.
        `search_path` should be a sequence of ``sys.path`` items.  If not
        supplied, ``sys.path`` is used.  Only distributions conforming to
        the platform/python version defined at initialization are added.
        N)rCrr]r)rrNrrrrrrMs
zEnvironment.scancCs|}|j|gS)aReturn a newest-to-oldest list of distributions for `project_name`

        Uses case-insensitive `project_name` comparison, assuming all the
        project's distributions use their project's name converted to all
        lowercase as their key.

        )lowerrKr)rr'distribution_keyrrr__getitem__szEnvironment.__getitem__cCsL||rH|rH|j|jg}||krH|||jtddddS)zLAdd `dist` if we ``can_add()`` it and it has not already been added
        hashcmpTr4reverseN)	rQhas_versionrKr	r4rr2operator
attrgetter)rrrrrrrs

zEnvironment.addFcCsfz||}Wntk
r,|s$d}YnX|dk	r:|S||jD]}||krD|SqD|||S)aFind distribution best matching `req` and usable on `working_set`

        This calls the ``find(req)`` method of the `working_set` to see if a
        suitable distribution is already active.  (This may raise
        ``VersionConflict`` if an unsuitable version of the project is already
        active in the specified `working_set`.)  If a suitable distribution
        isn't active, this method returns the newest distribution in the
        environment that meets the ``Requirement`` in `req`.  If no suitable
        distribution is found, and `installer` is supplied, then the result of
        calling the environment's ``obtain(req, installer)`` method will be
        returned.
        N)rrhr4obtain)rrr[r*rrrrrr$s

zEnvironment.best_matchcCs|dk	r||SdS)aObtain a distribution matching `requirement` (e.g. via download)

        Obtain a distro that matches requirement (e.g. via download).  In the
        base ``Environment`` class, this routine just returns
        ``installer(requirement)``, unless `installer` is None, in which case
        None is returned instead.  This method is a hook that allows subclasses
        to attempt other ways of obtaining a distribution before falling back
        to the `installer` argument.Nr)rrequirementr*rrrr\s	zEnvironment.obtainccs"|jD]}||r
|Vq
dS)z=Yield the unique project names of the available distributionsN)rKrrr4rrrr)szEnvironment.__iter__cCsVt|tr||n<t|trD|D]}||D]}||q0q$ntd|f|S)z2In-place addition of a distribution or environmentzCan't add %r to environment)rrdrrar)rotherprojectrrrr__iadd__/s

zEnvironment.__iadd__cCs*|jgddd}||fD]}||7}q|S)z4Add an environment or distribution to an environmentN)rDrLr)rr_newr)rrr__add__;s
zEnvironment.__add__)N)NF)N)rrrrrKPY_MAJORrrQrRrMrUrr$r\rrardrrrrras"




c@seZdZdZdS)rkaTAn error occurred extracting a resource

    The following attributes are available from instances of this exception:

    manager
        The resource manager that raised this exception

    cache_path
        The base directory for resource extraction

    original_error
        The exception instance that caused extraction to fail
    NrrrrrrkGsc@seZdZdZdZddZddZddZd	d
ZddZ	d
dZ
ddZddZdddZ
eddZddZddZd ddZdS)!rcz'Manage resource extraction and packagesNcCs
i|_dSr)cached_filesrrrrr[szResourceManager.__init__cCst||S)zDoes the named resource exist?)rNrrpackage_or_requirementrrrrrX^szResourceManager.resource_existscCst||S)z,Is the named resource an existing directory?)rNrYrgrrrrYbszResourceManager.resource_isdircCst|||S)z4Return a true filesystem path for specified resource)rNrrgrrrrVhsz!ResourceManager.resource_filenamecCst|||S)z9Return a readable file-like object for specified resource)rNrrgrrrrUnszResourceManager.resource_streamcCst|||S)z%Return specified resource as a string)rNrrgrrrrTtszResourceManager.resource_stringcCst||S)z1List the contents of the named resource directory)rNrWrgrrrrWzsz ResourceManager.resource_listdircCsRtd}|jpt}td}t|jft	}||_
||_||_|dS)z5Give an error message for problems extracting file(s)ra
            Can't extract file(s) to egg cache

            The following error occurred while trying to extract file(s)
            to the Python egg cache:

              {old_exc}

            The Python egg cache directory is currently set to:

              {cache_path}

            Perhaps your account does not have write access to this directory?
            You can change the cache directory by setting the PYTHON_EGG_CACHE
            environment variable to point to an accessible directory.
            N)
rCexc_infoextraction_pathr`textwrapdedentlstriprkrrr
cache_pathoriginal_error)rold_excrntmplerrrrrextraction_errorsz ResourceManager.extraction_errorrcCsf|jp
t}tjj||df|}zt|Wntk
rL|YnX||d|j	|<|S)aReturn absolute location in cache for `archive_name` and `names`

        The parent directory of the resulting path will be created if it does
        not already exist.  `archive_name` should be the base filename of the
        enclosing egg (which may not be the name of the enclosing zipfile!),
        including its ".egg" extension.  `names`, if provided, should be a
        sequence of path name parts "under" the egg's extraction location.

        This method should only be called by resource providers that need to
        obtain an extraction location, and only for names they intend to
        extract, as it tracks the generated names for possible cleanup later.
        z-tmpr)
rjr`rrrE_bypass_ensure_directory	Exceptionrs_warn_unsafe_extraction_pathrf)rarchive_namenamesextract_pathtarget_pathrrrget_cache_paths


zResourceManager.get_cache_pathcCs\tjdkr|tjdsdSt|j}|tj@s>|tj@rXdjft	}t
|tdS)aN
        If the default extraction path is overridden and set to an insecure
        location, such as /tmp, it opens up an opportunity for an attacker to
        replace an extracted file with an unauthorized payload. Warn the user
        if a known insecure location is used.

        See Distribute #375 for more details.
        ntwindirNzExtraction path is writable by group/others and vulnerable to attack when used with get_resource_filename ({path}). Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).)
rrrenvironstatst_modeS_IWOTHS_IWGRPrrwarningswarnUserWarning)rmodemsgrrrrvs
z,ResourceManager._warn_unsafe_extraction_pathcCs.tjdkr*t|jdBd@}t||dS)a4Perform any platform-specific postprocessing of `tempname`

        This is where Mac header rewrites should be done; other platforms don't
        have anything special they should do.

        Resource providers should call this method ONLY after successfully
        extracting a compressed resource.  They must NOT call it on resources
        that are already in the filesystem.

        `tempname` is the current (temporary) name of the file, and `filename`
        is the name it will be renamed to by the caller after this routine
        returns.
        posiximiN)rrrrchmod)rtempnamefilenamerrrrpostprocesss
zResourceManager.postprocesscCs|jrtd||_dS)aSet the base path where resources will be extracted to, if needed.

        If you do not call this routine before any extractions take place, the
        path defaults to the return value of ``get_default_cache()``.  (Which
        is based on the ``PYTHON_EGG_CACHE`` environment variable, with various
        platform-specific fallbacks.  See that routine's documentation for more
        details.)

        Resources are extracted to subdirectories of this path based upon
        information given by the ``IResourceProvider``.  You may set this to a
        temporary directory, but then you must call ``cleanup_resources()`` to
        delete the extracted files when done.  There is no guarantee that
        ``cleanup_resources()`` will be able to remove all extracted files.

        (Note: you may not change the extraction path for a given resource
        manager once resources have been extracted, unless you first call
        ``cleanup_resources()``.)
        z5Can't change extraction path, files already extractedN)rfrHrjrrrrrr^s
z#ResourceManager.set_extraction_pathFcCsdS)aB
        Delete all extracted resource files and directories, returning a list
        of the file and directory names that could not be successfully removed.
        This function does not have any concurrency protection, so it should
        generally only be called when the extraction path is a temporary
        directory exclusive to a single process.  This method is not
        automatically called; you must call it explicitly or register it as an
        ``atexit`` function if you wish to ensure cleanup of a temporary
        directory used for extractions.
        Nr)rforcerrrr_sz!ResourceManager.cleanup_resources)r)F)rrrrrjrrXrYrVrUrTrWrsr{staticmethodrvrr^r_rrrrrcWs 

cCstjdptjddS)z
    Return the ``PYTHON_EGG_CACHE`` environment variable
    or a platform-relevant user cache dir for an app
    named "Python-Eggs".
    PYTHON_EGG_CACHEzPython-Eggs)appname)rr~rr
user_cache_dirrrrrr`s
cCstdd|S)zConvert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    [^A-Za-z0-9.]+-)resubrrrrrmscCsJzttj|WStjjk
rD|dd}tdd|YSXdS)zB
    Convert an arbitrary string to a standard version string
    rr>rrN)rrrrrrrr)rrrrrn s
cCstdd|S)zConvert an arbitrary string to a standard 'extra' name

    Any runs of non-alphanumeric characters are replaced with a single '_',
    and the result is always lowercased.
    z[^A-Za-z0-9.-]+r)rrrS)rDrrrrs,scCs|ddS)z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    rrrrrrrrt5sc
CsHzt|Wn6tk
rB}zd|_d|_|WYSd}~XYnXdS)zo
    Validate text as a PEP 508 environment marker; return an exception
    if invalid or False otherwise.
    NF)rvSyntaxErrorrlineno)texterrrru=sc
CsLztj|}|WStjjk
rF}zt||W5d}~XYnXdS)z
    Evaluate a PEP 508 environment marker.
    Return a boolean indicating the marker result in this environment.
    Raise SyntaxError if marker is invalid.

    This implementation uses the 'pyparsing' module.
    N)rmarkersMarkerrG
InvalidMarkerr)rrDrFrrrrrvKs

c@seZdZdZdZdZdZddZddZddZ	d	d
Z
ddZd
dZddZ
ddZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zed'd(Zd)d*ZdS)+rzETry to implement resources and metadata for arbitrary PEP 302 loadersNcCs(t|dd|_tjt|dd|_dS)Nr__file__r)rrrrdirnamemodule_pathrrrrrraszNullProvider.__init__cCs||j|Sr)_fnrrrrrrrresz"NullProvider.get_resource_filenamecCst|||Sr)ioBytesIOrrrrrrhsz NullProvider.get_resource_streamcCs|||j|Sr)_getrrrrrrrksz NullProvider.get_resource_stringcCs|||j|Sr)_hasrrrrrrrrnszNullProvider.has_resourcecCs||j|Sr)regg_inforrrrr_get_metadata_pathqszNullProvider._get_metadata_pathcCs |js|jS||}||Sr)rrrrrrrrrrts
zNullProvider.has_metadatac
Csj|js
dS||}||}z|dWStk
rd}z|jd||7_W5d}~XYnXdS)Nrutf-8z in {} file at path: {})rrrdecodeUnicodeDecodeErrorreasonr)rrrvalueexcrrrr{s

zNullProvider.get_metadatacCst||SrrqrrrrrrszNullProvider.get_metadata_linescCs|||j|Sr)_isdirrrrrrrrYszNullProvider.resource_isdircCs|jo|||j|Sr)rrrrrrrrszNullProvider.metadata_isdircCs|||j|Sr)_listdirrrrrrrrWszNullProvider.resource_listdircCs|jr|||j|SgSr)rrrrrrrrszNullProvider.metadata_listdirc	Csd|}||s$tdjft||dd}|dd}||j|}||d<tj	
|rt|}|}W5QRXt
||d}t|||n>dd	lm}	t|d|d|f|	|<t
||d}
t|
||dS)
Nzscripts/z<Script {script!r} not found in metadata at {self.egg_info!r}z


rexecr)cache)rrgrrrrrrrrrrreadcompiler	linecacherlenr	)rrrscriptscript_textscript_filenameZfidsourcecoderscript_coderrrrMs0

zNullProvider.run_scriptcCstddSNz9Can't perform this operation for unregistered loader typeNotImplementedErrorrrrrrszNullProvider._hascCstddSrrrrrrrszNullProvider._isdircCstddSrrrrrrrszNullProvider._listdircCs*|||r&tjj|f|dS|S)N/)_validate_resource_pathrrrEr	)rbaserrrrrs
zNullProvider._fncCsptjj|tjkp&t|p&t|}|s0dSd}t|rPt|sPt|t	j
|dddtdddS)aO
        Validate the resource paths according to the docs.
        https://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access

        >>> warned = getfixture('recwarn')
        >>> warnings.simplefilter('always')
        >>> vrp = NullProvider._validate_resource_path
        >>> vrp('foo/bar.txt')
        >>> bool(warned)
        False
        >>> vrp('../foo/bar.txt')
        >>> bool(warned)
        True
        >>> warned.clear()
        >>> vrp('/foo/bar.txt')
        >>> bool(warned)
        True
        >>> vrp('foo/../../bar.txt')
        >>> bool(warned)
        True
        >>> warned.clear()
        >>> vrp('foo/f../bar.txt')
        >>> bool(warned)
        False

        Windows path separators are straight-up disallowed.
        >>> vrp(r'\foo/bar.txt')
        Traceback (most recent call last):
        ...
        ValueError: Use of .. or absolute path in a resource path is not allowed.

        >>> vrp(r'C:\foo/bar.txt')
        Traceback (most recent call last):
        ...
        ValueError: Use of .. or absolute path in a resource path is not allowed.

        Blank values are allowed

        >>> vrp('')
        >>> bool(warned)
        False

        Non-string values are not.

        >>> vrp(None)
        Traceback (most recent call last):
        ...
        AttributeError: ...
        Nz=Use of .. or absolute path in a resource path is not allowed.rz/ and will raise exceptions in a future release.r
stacklevel)rrpardirr		posixpathsepisabsntpathrHrrDeprecationWarning)rinvalidrrrrrs6z$NullProvider._validate_resource_pathcCs$t|jdr|j|StddS)Nget_dataz=Can't perform this operation for loaders without 'get_data()')rrrrrrrrrs
zNullProvider._get)rrrregg_namerrrrrrrrrrrrYrrWrrMrrrrrrrrrrrrZs2

Jccs,d}||kr(|V|}tj|\}}qdS)z2
    yield all parents of path including path
    N)rrr	)rlastrrrr_parentss
rc@s(eZdZdZddZddZddZdS)	rz&Provider based on a virtual filesystemcCst|||dSr)rr
_setup_prefixrrrrr*szEggProvider.__init__cCs,ttt|j}t|d}|o&||dSr)filter_is_egg_pathrrnext_set_egg)reggsZeggrrrr.s
zEggProvider._setup_prefixcCs(tj||_tj|d|_||_dS)NEGG-INFO)rrbasenamerrEregg_rootrrrrr5szEggProvider._set_eggN)rrrrrrrrrrrr'sc@sDeZdZdZddZddZddZdd	Zd
dZe	dd
Z
dS)rz6Provides access to package resources in the filesystemcCstj|Sr)rrrrrrrr>szDefaultProvider._hascCstj|Sr)rrrrrrrrAszDefaultProvider._isdircCs
t|Sr)rlistdirrrrrrDszDefaultProvider._listdircCst||j|dSNrb)rrrrrrrrGsz#DefaultProvider.get_resource_streamc
Cs*t|d}|W5QRSQRXdSr)rr)rrstreamrrrrJszDefaultProvider._getcCs,d}|D]}tt|td}t||qdS)N)SourceFileLoaderSourcelessFileLoader)rimportlib_machinerytyper)rloader_namesr
loader_clsrrr	_registerNszDefaultProvider._registerN)rrrrrrrrrrCrrrrrr;sc@s8eZdZdZdZddZZddZddZd	d
Z	dS)rz.Provider that returns nothing for all requestsNcCsdSNFrrrrrr;^r<zEmptyProvider.<lambda>cCsdSNrrrrrrr`szEmptyProvider._getcCsgSrrrrrrrcszEmptyProvider._listdircCsdSrrrrrrrfszEmptyProvider.__init__)
rrrrrrrrrrrrrrrYsc@s eZdZdZeddZeZdS)ZipManifestsz
    zip manifest builder
    c
s@t|,fddD}t|W5QRSQRXdS)a
        Build a dictionary similar to the zipimport directory
        caches, except instead of tuples, store ZipInfo objects.

        Use a platform-specific path separator (os.sep) for the path keys
        for compatibility with pypy on Windows.
        c3s&|]}|dtj|fVqdS)rN)rrrgetinfor
rzfilerrr|sz%ZipManifests.build.<locals>.<genexpr>N)zipfileZipFilenamelistr )rrr&rrrbuildrs
	
zZipManifests.buildN)rrrrrCrloadrrrrrms
rc@s$eZdZdZeddZddZdS)MemoizedZipManifestsz%
    Memoized zipfile manifests.
    manifest_modzmanifest mtimecCsRtj|}t|j}||ks.||j|krH||}|||||<||jS)zW
        Load a manifest at path or return a suitable manifest already loaded.
        )	rrnormpathrst_mtimemtimerrmanifest)rrrrrrrrs
zMemoizedZipManifests.loadN)rrrrr
namedtuplerrrrrrrsrc@seZdZdZdZeZddZddZddZ	e
d	d
ZddZe
d
dZddZddZddZddZddZddZddZddZdd ZdS)!rz"Resource support for zips and eggsNcCs t|||jjtj|_dSr)rrrarchiverrzip_prerrrrrszZipProvider.__init__cCsP|tj}||jjkrdS||jr:|t|jdStd||jfdS)Nr%s is not a subpath of %s)	rstriprrrrrrrAssertionErrorrfspathrrr
_zipinfo_nameszZipProvider._zipinfo_namecCsP|j|}||jtjr:|t|jddtjStd||jfdS)Nrr)rrrrrrr	r)rzip_pathrrrr_partss
zZipProvider._partscCs|j|jjSr)_zip_manifestsrrrrrrrzipinfoszZipProvider.zipinfocCs\|jstd||}|}d|||krP|D]}||||q8|||S)Nz5resource_filename() only supported for .egg, not .zipr)rr_resource_to_zip_get_eager_resourcesrEr_extract_resource
_eager_to_zip)rrrreagersrrrrrs
z!ZipProvider.get_resource_filenamecCs"|j}|jd}t|}||fS)N)rrr)	file_size	date_timetimemktime)zip_statsizer	timestamprrr_get_date_and_sizes

zZipProvider._get_date_and_sizec
Csx||kr@||D]}||tj||}qtj|S||j|\}}ts`t	dz|
|j||}|
||r|WStdtj|d\}}	t||j|t|t|	||f||	|zt|	|Wnhtjk
rNtj|rH|
||r |YWStjdkrHt|t|	||YWSYnXWn tjk
rr|YnX|S)Nz>"os.rename" and "os.unlink" are not supported on this platformz	.$extract)dirr|)_indexrrrrErrr	
WRITE_SUPPORTIOErrorr{rr_is_current_mkstempwriterrcloserrrerrorisfilerrrs)
rrrrrrr	real_pathoutftmpnamrrrrsN





zZipProvider._extract_resourcec		Csx||j|\}}tj|s$dSt|}|j|ksB|j|krFdS|j	|}t
|d}|}W5QRX||kS)zK
        Return True if the file_path is current for this zip_path
        Fr)rr	rrr rst_sizerrrrr)	r	file_pathrrrrzip_contentsf
file_contentsrrrrs
zZipProvider._is_currentcCs>|jdkr8g}dD]}||r|||q||_|jS)N)znative_libs.txtzeager_resources.txt)rrr&r)rrrrrrrs

z ZipProvider._get_eager_resourcesc	Csz|jWStk
ri}|jD]V}|tj}|r"tj|dd}||krh|||dq"q2|g||<q2q"||_|YSXdS)Nr)		_dirindexAttributeErrorr	r	rrrErr")rindrpartsparentrrrr's
zZipProvider._indexcCs ||}||jkp||kSr)rr	r)rrrrrrr8s
zZipProvider._hascCs|||kSr)rrrrrrr<szZipProvider._isdircCst|||dSNr)rrrrrrrrr?szZipProvider._listdircCs|||j|Sr)rrrrrrrr
BszZipProvider._eager_to_zipcCs|||j|Sr)rrrrrrrr
EszZipProvider._resource_to_zip)rrrrrrrrrrrr	rrrrrrrrrrr
r
rrrrrs(



	7	c@s@eZdZdZddZddZddZdd	Zd
dZdd
Z	dS)ra*Metadata handler for standalone PKG-INFO files

    Usage::

        metadata = FileMetadata("/path/to/PKG-INFO")

    This provider rejects all data and metadata requests except for PKG-INFO,
    which is treated as existing, and will be the contents of the file at
    the provided location.
    cCs
||_dSrrrrrrrXszFileMetadata.__init__cCs|jSrr/rrrrr[szFileMetadata._get_metadata_pathcCs|dkotj|jS)NPKG-INFO)rrr rrrrr^szFileMetadata.has_metadatac	CsD|dkrtdtj|jddd}|}W5QRX|||S)Nr0z(No metadata except PKG-INFO is availablerr)encodingerrors)rrrrr_warn_on_replacement)rrr'metadatarrrras
zFileMetadata.get_metadatacCs,d}||kr(d}|jft}t|dS)Nu�z2{self.path} could not be properly decoded in UTF-8)rrrr)rr4replacement_charrqrrrrr3js
z!FileMetadata._warn_on_replacementcCst||SrrrrrrrqszFileMetadata.get_metadata_linesN)
rrrrrrrrr3rrrrrrLs	c@seZdZdZddZdS)rasMetadata provider for egg directories

    Usage::

        # Development eggs:

        egg_info = "/path/to/PackageName.egg-info"
        base_dir = os.path.dirname(egg_info)
        metadata = PathMetadata(base_dir, egg_info)
        dist_name = os.path.splitext(os.path.basename(egg_info))[0]
        dist = Distribution(basedir, project_name=dist_name, metadata=metadata)

        # Unpacked egg directories:

        egg_path = "/path/to/PackageName-ver-pyver-etc.egg"
        metadata = PathMetadata(egg_path, os.path.join(egg_path,'EGG-INFO'))
        dist = Distribution.from_filename(egg_path, metadata=metadata)
    cCs||_||_dSr)rr)rrrrrrrszPathMetadata.__init__Nrrrrrrrrrrusc@seZdZdZddZdS)rz Metadata provider for .egg filescCsD|jtj|_||_|jr0tj|j|j|_n|j|_|	dS)z-Create a metadata provider from a zipimporterN)
rrrrrprefixrrErr)rimporterrrrrszEggMetadata.__init__Nr6rrrrrsr _distribution_finderscCs|t|<dS)axRegister `distribution_finder` to find distributions in sys.path items

    `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
    handler), and `distribution_finder` is a callable that, passed a path
    item and the importer instance, yields ``Distribution`` instances found on
    that path item.  See ``pkg_resources.find_on_path`` for an example.Nr9)
importer_typedistribution_finderrrrrscCst|}tt|}||||S)z.Yield distributions accessible via `path_item`)rrr:)	path_itemonlyr8finderrrrr]s
c	cs|jdrdSt|}|dr2tj||dV|r:dS|dD]|}t|rtj	
||}tt
||}|D]
}|VqrqD|drDtj	
||}tt
|}||_t|||VqDdS)z@
    Find eggs in zip files; possibly multiple nested eggs.
    z.whlNr0r4r)
.dist-info	.egg-info)rendswithrrrd
from_filenamerWrrrrEfind_eggs_in_zip	zipimportzipimporterrSr
from_location)	r8r=r>r4subitemsubpathrrsubmetarrrrEs$

rEcCsdSr.r)r8r=r>rrrfind_nothingsrLcCsdd}t||ddS)aL
    Given a list of filenames, return them in descending order
    by version number.

    >>> names = 'bar', 'foo', 'Python-2.7.10.egg', 'Python-2.7.2.egg'
    >>> _by_version_descending(names)
    ['Python-2.7.10.egg', 'Python-2.7.2.egg', 'foo', 'bar']
    >>> names = 'Setuptools-1.2.3b1.egg', 'Setuptools-1.2.3.egg'
    >>> _by_version_descending(names)
    ['Setuptools-1.2.3.egg', 'Setuptools-1.2.3b1.egg']
    >>> names = 'Setuptools-1.2.3b1.egg', 'Setuptools-1.2.3.post1.egg'
    >>> _by_version_descending(names)
    ['Setuptools-1.2.3.post1.egg', 'Setuptools-1.2.3b1.egg']
    cSs2tj|\}}t|d|g}dd|DS)z6
        Parse each component of the filename
        rcSsg|]}tj|qSr)rrr)r
partrrr
<listcomp>sz?_by_version_descending.<locals>._by_version.<locals>.<listcomp>)rrsplitext	itertoolschainr	)rextr,rrr_by_versionsz+_by_version_descending.<locals>._by_versionTrW)sorted)rxrSrrr_by_version_descendingsrUc
#sttr4tjttjddVdSfddtD}fdd|D}t	|}|D]2}tj|}t
|}||D]
}	|	VqqjdS)z6Yield distributions accessible on a sys.path directoryrr@Nc3s|]}tj|VqdSr)rrrE)r
child)r=rrrszfind_on_path.<locals>.<genexpr>c3s|]}t|r|VqdSr)dist_factory)r
rr>r=rrrs)_normalize_cached_is_unpacked_eggrdrDrrrrEsafe_listdirrUrW)
r8r=r>rfilteredpath_item_entriesrfullpathfactoryrrrXrfind_on_paths,
r`cCsj|}|d}|do0tjtj||}|p8|}|rBtS|sRt|rRtS|sd|drdt	St
S)z*Return a dist_factory for the given entry.rBrAz	.egg-link)rSrCrrrrEdistributions_from_metadatarr]resolve_egg_linkNoDists)r=rr>rSZis_egg_infoZis_dist_infois_metarrrrWs$

rWc@s eZdZdZddZddZdS)rczS
    >>> bool(NoDists())
    False

    >>> list(NoDists()('anything'))
    []
    cCsdSrrrrrr__bool__/szNoDists.__bool__cCstdSr.)iter)rr^rrr__call__2szNoDists.__call__N)rrrrrergrrrrrc'srcc
Csbzt|WSttfk
r$Yn:tk
r\}z|jtjtjtjfkrLW5d}~XYnXdS)zI
    Attempt to list contents of path, but suppress some exceptions.
    Nr)	rrPermissionErrorNotADirectoryErrorOSErrorerrnoENOTDIREACCESENOENT)rrrrrr[6sr[ccsftj|}tj|r:tt|dkr.dSt||}nt|}tj|}t	j
|||tdVdS)Nr)
precedence)rrrrrrrrrrdrHr})rrootr4rrrrraFsrac	cs4t|"}|D]}|}|r|VqW5QRXdS)z1
    Yield non-empty lines from file at path
    N)rstrip)rr'linerrrnon_empty_linesUs

rscs.t}fdd|D}tt|}t|dS)za
    Given a path to an .egg-link, resolve distributions
    present in the referenced path.
    c3s$|]}tjtj|VqdSr)rrrEr)r
refr/rrrfsz#resolve_egg_link.<locals>.<genexpr>r)rsr3r]r)rreferenced_pathsresolved_pathsdist_groupsrr/rrb`s

rb
FileFinder_namespace_handlers)_namespace_packagescCs|t|<dS)aRegister `namespace_handler` to declare namespace packages

    `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
    handler), and `namespace_handler` is a callable like this::

        def namespace_handler(importer, path_entry, moduleName, module):
            # return a path_entry to use for child packages

    Namespace handlers are only called if the importer object has already
    agreed that it can handle the relevant path item, and they should only
    return a subpath if the module __path__ does not already contain an
    equivalent subpath.  For an example namespace handler, see
    ``pkg_resources.file_ns_handler``.
    Nry)r;namespace_handlerrrrrwscCst|}|dkrdSz||j}Wn<tk
r`ttd||}W5QRXYnX|dkrndStj	
|}|dkrt|}tj	|<g|_
t|nt|dstd|tt|}|||||}|dk	r|j
}||t|t||||S)zEEnsure that named package includes a subpath of path_item (if needed)Nignore__path__Not a package:)r	find_specrr*rcatch_warningssimplefilterfind_modulerCrrtypes
ModuleTyper~_set_parent_nsrrrrzr	importlib
import_module_rebuild_mod_path)packageNamer=r8rrhandlerrJrrrr
_handle_nss4








rcsjddtjDfddfdd}t||d}dd|D}t|jtr`||jd	d	<n||_d	S)
zq
    Rebuild module.__path__ ensuring that all entries are ordered
    corresponding to their sys.path order
    cSsg|]}t|qSrrYr
prrrrNsz%_rebuild_mod_path.<locals>.<listcomp>cs.z|WStk
r(tdYSXdS)z/
        Workaround for #520 and #513.
        infN)indexrHfloat)r)sys_pathrrsafe_sys_path_indexsz._rebuild_mod_path.<locals>.safe_sys_path_indexcs<|tj}dd}|d|}ttj|S)zR
        Return the ordinal of the path based on its position in sys.path
        r>rN)r	rrcountrYrE)r
path_partsmodule_partsr,)package_namerrrposition_in_sys_pathsz/_rebuild_mod_path.<locals>.position_in_sys_path)r4cSsg|]}t|qSrrrrrrrNsN)rCrrTrr~r)	orig_pathrrrnew_pathr)rrrrrs		rc
Cstz|tkrWdStj}|d\}}}|rt||tkrLt|ztj	|j
}Wn.tk
r}ztd||W5d}~XYnXt
|pdg|t
|g|D]}t||qW5tXdS)z9Declare that package 'packageName' is a namespace packageNr>r)_impacquire_lockrelease_lockr{rCr
rpartitionrZrrr~r*rr	rr)rrr-rrr=rrrrZs&cCsFtz.t|dD]}t||}|rt||qW5tXdS)zDEnsure that previously-declared namespace packages include path_itemrN)rrrr{rrr)r=r-packagerJrrrrs
cCsDtj||dd}t|}|jD]}t||kr&q@q&|SdS)zBCompute an ns-package subpath for a filesystem or zipfile importerr>rN)rrrEr	rYr~)r8r=rrrJ
normalizedrrrrfile_ns_handlers
rcCsdSrr)r8r=rrrrrnull_ns_handler	srcCs tjtjtjt|S)z1Normalize a file/dir name for comparison purposes)rrnormcaserealpathr
_cygwin_patchrrrrrx	scCstjdkrtj|S|S)a
    Contrary to POSIX 2008, on Cygwin, getcwd (3) contains
    symlink components. Using
    os.path.abspath() works around this limitation. A fix in os.getcwd()
    would probably better, in Cygwin even more so, except
    that this seems to be by design...
    cygwin)rCrDrrabspathrrrrr	srcCs8z
||WStk
r2t|||<}|YSXdSr)rrx)rrresultrrrrY(	s

rYcCst|pt|S)z7
    Determine if given path appears to be an egg.
    )_is_zip_eggrZr/rrrr0	srcCs$|do"tj|o"t|S)N.egg)rSrCrrr r
is_zipfiler/rrrr7	s

rcCs&|do$tjtj|ddS)z@
    Determine if given path appears to be an unpacked egg.
    rrr0)rSrCrrr rEr/rrrrZ?	srZcCs<|d}|}|r8d|}ttj||tj|dS)Nr>)r	r"rEsetattrrCr)rr,rr-rrrrI	s


rccsXt|tr6|D] }|}|r|ds|Vqn|D]}t|D]
}|VqFq:dS)z9Yield non-empty/non-comment lines of a string or sequence#N)rr
splitlinesrqrrq)strssssrrrrqQ	s

z\w+(\.\w+)*$z
    (?P<name>[^-]+) (
        -(?P<ver>[^-]+) (
            -py(?P<pyver>[^-]+) (
                -(?P<plat>.+)
            )?
        )?
    )?
    c@seZdZdZdddZddZdd	ZdddZd
dZdddZ	e
dZe
dddZe
ddZe
dddZe
dddZdS) rfz3Object representing an advertised importable objectrNcCs<t|std|||_||_t||_t||_||_dS)NzInvalid module name)MODULErHrmodule_nametupleattrsr%r)rrrrr%rrrrrq	s


zEntryPoint.__init__cCsHd|j|jf}|jr*|dd|j7}|jrD|dd|j7}|S)Nz%s = %s:r>z [%s],)rrrrEr%)rrrrrrz	szEntryPoint.__str__cCsdt|S)NzEntryPoint.parse(%r)rrrrrr	szEntryPoint.__repr__TcOs4|r|s|rtjdtdd|r,|j|||S)zH
        Require packages for this EntryPoint, then resolve it.
        zJParameters to load are deprecated.  Call .resolve and .require separately.r?r)rrrrLr)rrLr:kwargsrrrr	szEntryPoint.loadc
CsZt|jdgdd}ztt|j|WStk
rT}ztt||W5d}~XYnXdS)zD
        Resolve the entry point from its module and attrs.
        rr)fromlistlevelN)	rr	functoolsreducerrr*rr)rrrrrrr	s
zEntryPoint.resolvecCsL|jr|jstd||j|j}tj||||jd}tttj|dS)Nz&Can't require() without a distribution)r%)	r%rrjrr[rrr3r)rr)r*rr&rrrrL	s

zEntryPoint.requirez]\s*(?P<name>.+?)\s*=\s*(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+))?\s*(?P<extras>\[.*\])?\s*$cCsf|j|}|sd}t|||}||d}|drJ|ddnd}||d|d|||S)aParse a single entry point from string `src`

        Entry point syntax follows the form::

            name = some.module:some.attr [extra1, extra2]

        The entry name and module name are required, but the ``:attrs`` and
        ``[extras]`` parts are optional
        z9EntryPoint must be in 'name=module:attrs [extras]' formatr%attrr>rrr)patternrBrH	groupdict
_parse_extrasr	)rsrcrrJrresr%rrrrr	s
zEntryPoint.parsecCs(|sdStd|}|jr"t|jS)Nrx)rerspecsrHr%)rextras_specrrrrr	szEntryPoint._parse_extrascCsVt|std|i}t|D]2}|||}|j|krFtd||j|||j<q|S)zParse an entry point groupzInvalid group namezDuplicate entry point)rrHrqrr)rrGlinesrthisrreprrrparse_group	s

zEntryPoint.parse_groupcCstt|tr|}nt|}i}|D]J\}}|dkrB|s:q$td|}||kr\td|||||||<q$|S)z!Parse a map of entry point groupsNz%Entry points must be listed in groupszDuplicate group name)rr r&rrrHrqr)rdatarmapsrGrrrr	parse_map	s


zEntryPoint.parse_map)rrN)T)NN)N)N)N)rrrrrrrrrrLrrrrCrrrrrrrrrfn	s$
	



	
cCs@dd}t||}tt|d}|d\}}}t|p>dS)z
    Given an iterable of lines from a Metadata file, return
    the value of the Version field, if present, or None otherwise.
    cSs|dS)Nzversion:)rSr)rrrrris_version_line	sz+_version_from_file.<locals>.is_version_linerrN)rrrf	partitionrnrq)rr
version_linesrrrrrrr_version_from_file	s

rcseZdZdZdZddddedefddZedRddZ	dd	Z
ed
dZdd
Z
ddZddZddZddZddZddZeddZeddZddZed d!Zed"d#Zed$d%Zd&d'ZdSd)d*Zd+d,Zd-d.Zd/d0ZdTd2d3Z d4d5Z!d6d7Z"d8d9Z#d:d;Z$fd<d=Z%edUd>d?Z&d@dAZ'dBdCZ(dVdDdEZ)dFdGZ*dWdHdIZ+dJdKZ,dLdMZ-dNdOZ.edPdQZ/Z0S)Xrdz5Wrap an actual or potential sys.path entry w/metadatar0NcCsFt|pd|_|dk	r t||_||_||_||_||_|p>t|_	dS)NUnknown)
rmr'rn_versionrOrDrror	_provider)rrr4r'rrOrDrorrrr
s
zDistribution.__init__cKs~dgd\}}}}tj|\}}	|	tkr^t|	}t|}
|
r^|
dddd\}}}}|||f||||d|S)NrrverpyverrI)r'rrOrD)rrrOrS_distributionImplEGG_NAMErG_reload_version)rrrr4r#r'rrOrDrRrBrrrrH
s.zDistribution.from_locationcCs|Srrrrrrr!
szDistribution._reload_versioncCs$|j|j|j|j|jpd|jp dfSr)parsed_versionror4rrOrDrrrrrV$
szDistribution.hashcmpcCs
t|jSr)hashrVrrrr__hash__/
szDistribution.__hash__cCs|j|jkSrrVrr_rrr__lt__2
szDistribution.__lt__cCs|j|jkSrrrrrr__le__5
szDistribution.__le__cCs|j|jkSrrrrrr__gt__8
szDistribution.__gt__cCs|j|jkSrrrrrr__ge__;
szDistribution.__ge__cCst||jsdS|j|jkSr)rrrVrrrr__eq__>
szDistribution.__eq__cCs
||kSrrrrrr__ne__D
szDistribution.__ne__cCs6z|jWStk
r0|j|_}|YSXdSr)_keyr*r'rSr^rrrr4K
s
zDistribution.keycCst|dst|j|_|jS)N_parsed_version)rrrrrrrrrS
s
zDistribution.parsed_versioncCsXtjj}t|j|}|sdS|js&dStddd}t	
|jft|t
dS)Na>
            '{project_name} ({version})' is being parsed as a legacy,
            non PEP 440,
            version. You may find odd behavior and sort order.
            In particular it will be sorted as less than 0.0. It
            is recommended to migrate to PEP 440 compatible
            versions.
            rr)rrrrrrkrlrqrrrrvarsr)rLV	is_legacyrqrrr_warn_legacy_versionZ
s	z!Distribution._warn_legacy_versionc
Csnz|jWStk
rh}zB|}|dkrP||j}d|j|}t||||WYSd}~XYnXdS)Nz4Missing 'Version:' header and/or {} file at path: {})rr*_get_version_get_metadata_path_for_displayPKG_INFOrrH)rrrrrrrrrt
szDistribution.versioncCs4z|jWStk
r,|||_YnX|jS)z~
        A map of extra to its list of (direct) requirements
        for this distribution, including the null extra.
        )_Distribution__dep_mapr*_filter_extras_build_dep_maprrrr_dep_map
s
zDistribution._dep_mapcCsrttd|D]^}|}||}|d\}}}|oDt|pDt|}|rNg}t|pXd}||g|q|S)z
        Given a mapping of extras to dependencies, strip off
        environment markers and filter out any dependencies
        not matching the markers.
        Nr)	rrr"rrurvrsr	r&)dmrD	new_extrarrrFfails_markerrrrr
s
zDistribution._filter_extrascCs@i}dD]2}t||D]\}}||gt|qq|S)N)zrequires.txtzdepends.txt)rr
_get_metadatar	r&rl)rrrrDrrrrr
s
zDistribution._build_dep_maprcCsv|j}g}||dd|D]P}z||t|Wq tk
rn}ztd||f|W5d}~XYq Xq |S)z@List of Requirements needed for this distro if `extras` are usedNrz%s has no such extra feature %r)rr&rrsrrj)rr%rdepsrRrrrrr
s
zDistribution.requirescCs,z|j|}Wntk
r&YdSX|S)zK
        Return the path to the given metadata file, if available.
        z[could not detect])rrrurrrrr
s
z+Distribution._get_metadata_path_for_displayccs$||r ||D]
}|VqdSr)rr)rrrrrrrr
s
zDistribution._get_metadatacCs||j}t|}|Sr)rrr)rrrrrrr
szDistribution._get_versionFcCsV|dkrtj}|j||d|tjkrRt|j|dD]}|tjkr:t|q:dS)z>Ensure distribution is importable on `path` (default=sys.path)Nrnamespace_packages.txt)rCrrrrrrrZ)rrrpkgrrractivate
s


zDistribution.activatecCs8dt|jt|j|jptf}|jr4|d|j7}|S)z@Return what this distribution's standard .egg filename should bez
%s-%s-py%sr)rtr'rrOrerD)rrrrrr
szDistribution.egg_namecCs |jrd||jfSt|SdS)Nz%s (%s))rrrrrrr
szDistribution.__repr__cCs@zt|dd}Wntk
r(d}YnX|p0d}d|j|fS)Nrz[unknown version]z%s %s)rrHr')rrrrrr
s
zDistribution.__str__cCs|drt|t|j|S)zADelegate all unrecognized public attributes to .metadata providerr)rr*rr)rrrrr__getattr__
s
zDistribution.__getattr__cs.tttt|tdd|jDBS)Ncss|]}|ds|VqdSrN)r)r
rrrrrs
z'Distribution.__dir__.<locals>.<genexpr>)rr!superrd__dir__rrrbrrrszDistribution.__dir__cKs|jt|tj||f|Sr)rHrYrrr)rrr4r#rrrrD	s
zDistribution.from_filenamecCs<t|jtjjr"d|j|jf}nd|j|jf}t|S)z?Return a ``Requirement`` that matches this distribution exactlyz%s==%sz%s===%s)rrrrrr'rer)rspecrrrr4szDistribution.as_requirementcCs.|||}|dkr&td||ff|S)z=Return the `name` entry point of `group` or raise ImportErrorNzEntry point %r not found)rRrr)rrGrrrrrrPszDistribution.load_entry_pointcCsPz
|j}Wn,tk
r6t|d|}|_YnX|dk	rL||iS|S)rzentry_points.txtN)_ep_mapr*rfrrr)rrGep_maprrrrQ s
zDistribution.get_entry_mapcCs|||Sr)rQrrrrrrR,szDistribution.get_entry_infoc
Cs4|p|j}|sdSt|}tj|}dd|D}t|D]|\}}||kr^|rVqqdSq<||kr<|jtkr<|s|||dkrdS|tjkr|	|
|||
||qq<|tjkr|	|r|
d|n
||dSz|||d}	Wnt
k
rYq0YqX||	=||	=|	}qdS)aEnsure self.location is on path

        If replace=False (default):
            - If location is already in path anywhere, do nothing.
            - Else:
              - If it's an egg and its parent directory is on path,
                insert just ahead of the parent.
              - Else: add to the end of path.
        If replace=True:
            - If location is already on path anywhere (not eggs)
              or higher priority than its parent (eggs)
              do nothing.
            - Else:
              - If it's an egg and its parent directory is on path,
                insert just ahead of the parent,
                removing any lower-priority entries.
              - Else: add it to the front of path.
        NcSsg|]}|rt|p|qSrrrrrrrNKsz*Distribution.insert_on.<locals>.<listcomp>rr)rrYrrr	enumerateroryrCcheck_version_conflictrrrrH)
rrlocrnlocbdirnpathrrnprrrr1s@



zDistribution.insert_oncCs|jdkrdSt|d}t|j}|dD]p}|tjks2||ks2|tkrRq2|dkr\q2t	tj|dd}|rt|
|s2|
|jrq2td|||jfq2dS)N
setuptoolsrz
top_level.txt)
pkg_resourcesr
siterzIModule %s was already imported from %s, but %s is being added to sys.path)r4r r!rrxrrCrr{rr
issue_warning)rnsprmodnamefnrrrrus*



z#Distribution.check_version_conflictcCs6z
|jWn&tk
r0tdt|YdSXdS)NzUnbuilt egg for FT)rrHr
rrrrrrYs
zDistribution.has_versioncKs@d}|D]}||t||dq|d|j|jf|S)z@Copy this distribution, substituting in any changed keyword argsz<project_name version py_version platform location precedenceNr4)r	r	rrr)rr#rxrrrrclones
zDistribution.clonecCsdd|jDS)NcSsg|]}|r|qSrr)r
deprrrrNsz'Distribution.extras.<locals>.<listcomp>)rrrrrr%szDistribution.extras)N)r)NF)N)N)NF)1rrrrrreryrrCrHrrrVrrrrrrrr4rrrrrrrrrrrrrrrrrrDr4rPrQrRrrrYrr%
__classcell__rrrbrrd	sp










		

Dc@seZdZddZdS)EggInfoDistributioncCs|}|r||_|S)a
        Packages installed by distutils (e.g. numpy or scipy),
        which uses an old safe_version, and so
        their version numbers can get mangled when
        converted to filenames (e.g., 1.11.0.dev0+2329eae to
        1.11.0.dev0_2329eae). These distributions will not be
        parsed properly
        downstream by Distribution and safe_version, so
        take an extra step and try to get the version number from
        the metadata file itself instead of the filename.
        )rr)r
md_versionrrrrsz#EggInfoDistribution._reload_versionN)rrrrrrrrrsrc@s>eZdZdZdZedZeddZ	eddZ
dd	Zd
S)DistInfoDistributionzV
    Wrap an actual or potential sys.path entry
    w/metadata, .dist-info style.
    METADATAz([\(,])\s*(\d.*?)\s*([,\)])cCsFz|jWStk
r@||j}tj||_|jYSXdS)zParse and cache metadataN)	_pkg_infor*rremailparserParserparsestr)rr4rrr_parsed_pkg_infosz%DistInfoDistribution._parsed_pkg_infocCs2z|jWStk
r,||_|jYSXdSr)_DistInfoDistribution__dep_mapr*_compute_dependenciesrrrrrs

zDistInfoDistribution._dep_mapcsdgi}|_g|jdp gD]}t|q"fdd}t|d}|d||jdpjgD](}t|}tt|||||<ql|S)z+Recompute this distribution's dependencies.Nz
Requires-Distc3s*D] }|jr|jd|ir|VqdS)NrDrE)rDrrrrreqs_for_extraszBDistInfoDistribution._compute_dependencies.<locals>.reqs_for_extrazProvides-Extra)	rrget_allr&rl	frozensetrsrqr)rrrr!commonrDs_extrarr rrsz*DistInfoDistribution._compute_dependenciesN)rrrrrrrEQEQrrrrrrrrrs

	
r)rrBrAcOsZd}t}zt|j|kr&|d7}qWntk
r<YnXtj|d|di|dS)Nrr)rrCrrrHrr)r:r#rr)rrrr
sr
c	cstt|}|D]l}d|kr.|d|d}|drr|dd}z|t|7}Wntk
rpYdSXt|VqdS)zYield ``Requirement`` objects for each specification in `strs`

    `strs` must be a string, or a (possibly-nested) iterable thereof.
    z #N\)rfrqrrCrqr
StopIterationre)rrrrrrrrls

c@seZdZdZdS)RequirementParseErrorz,Compatibility wrapper for InvalidRequirementNrrrrrr*sr*csPeZdZfddZddZddZddZd	d
ZddZe	d
dZ
ZS)recstt|||j|_t|j}|||_|_dd|j	D|_
ttt
|j|_|j|j|j	t|j|jr|t|jndf|_t|j|_dS)z>DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!cSsg|]}|j|jfqSr)rZr)r
rrrrrNsz(Requirement.__init__.<locals>.<listcomp>N)rrerrunsafe_namermrSr'r4	specifierrrr3rsr%urlr#rFrhashCmpr_Requirement__hash)rrequirement_stringr'rbrrrs
zRequirement.__init__cCst|to|j|jkSr)rrer.rrrrr&s

zRequirement.__eq__cCs
||kSrrrrrrr,szRequirement.__ne__cCs0t|tr |j|jkrdS|j}|jj|ddS)NFT)prereleases)rrdr4rr,contains)rrrrrr/s

zRequirement.__contains__cCs|jSr)r/rrrrr;szRequirement.__hash__cCsdt|S)NzRequirement.parse(%r)rrrrrr>szRequirement.__repr__cCst|\}|Sr)rl)rrrrrrAs
zRequirement.parse)rrrrrrrrrrrrrrrbrrescCst|kr|tfS|S)zJ
    Ensure object appears in the mro even
    for old-style classes.
    )object)classesrrr_always_objectGs
r5cCs<ttt|dt|}|D]}||kr||SqdS)z2Return an adapter factory for `ob` from `registry`rN)r5inspectgetmrorr)registryr5rtrrrrQsrcCstj|}tj|dddS)z1Ensure that the parent directory of `path` existsT)exist_okN)rrrmakedirs)rrrrrrwYscCsXtstdt|\}}|rT|rTt|sTt|zt|dWntk
rRYnXdS)z/Sandbox-bypassing version of ensure_directory()z*"os.mkdir" not supported on this platform.iN)rrr	rrtrFileExistsError)rrrrrrrt_srtccsvd}g}t|D]V}|dr\|drP|s0|r:||fV|dd}g}qftd|q||q||fVdS)asSplit a string or iterable thereof into (section, content) pairs

    Each ``section`` is a stripped version of the section header ("[section]")
    and each ``content`` is a list of stripped lines excluding blank lines and
    comment-only lines.  If there are any such lines before the first section
    header, they're returned in a first ``section`` of ``None``.
    N[]rrzInvalid section heading)rqrrCrqrHr)rsectioncontentrrrrrrrls


cOs*tj}ztt_tj||WS|t_XdSr)rros_opentempfilemkstemp)r:r#old_openrrrrs
rr})categoryrcOs||||Srr)r'r:rrrr_call_asides
rFcs.t|d<|fddtDdS)z=Set up global resource manager (deliberately not state-saved)_managerc3s&|]}|ds|t|fVqdSr)rrrrrrrs
z_initialize.<locals>.<genexpr>N)rcrr)r)rrHr_initializes
rIcCs|t}td|d|j}|j}|j}|j}|}tdd|D|ddddg|_t	t
|jtj
ttd	S)
aE
    Prepare the master working set and make the ``require()``
    API available.

    This function has explicit effects on the global state
    of pkg_resources. It is intended to be invoked once at
    the initialization of this module.

    Invocation by other packages is unsupported and done
    at their own risk.
    r3)r[css|]}|jddVqdS)FrNr)r
rrrrrsz1_initialize_master_working_set.<locals>.<genexpr>cSs|jddS)NTrrJrrrrr;r<z0_initialize_master_working_set.<locals>.<lambda>F)r@N)rbrr$rLrSrArMrrrr3rrCrrrr)r[rLrSr\rMrrrr_initialize_master_working_sets"
rKc@seZdZdZdS)rz
    Base class for warning about deprecations in ``pkg_resources``

    This class is not derived from ``DeprecationWarning``, and as such is
    visible by default.
    Nrrrrrrs)N)N)F)F)F)F)N)rrCrrrrrrrFrrrpkgutilrZrDrremail.parserrrkrBrkrPr6rrrrrrimpr<	NameErrorrjrrrrrrrAos.pathrr	Zimportlib.machinery	machineryrrZpkg_resources.externr
rrversion_infoRuntimeErrorrLr[r\resources_streamr_resource_dirrUr^rYrTrSrWrVrXr:rzr{RuntimeWarningrrrr$r+r-r1r6r7r8
_sget_none
_sset_nonerK__all__rurgrhrrirjrrreryrzr{r|r}rrNrFrr@rrArrorprMrrOrPrQrRr~rrbr rrarrkrcr`rmrnrsrtrurvrr3rrrrrrrrrrGrrrrr]rErLrUr`rWrcr[rarsrbImpImporterrrxrrrrZrrrrxrrYrrrZrrqrBrVERBOSE
IGNORECASErrfrrdrrrr
rlr(InvalidRequirementr*rer5rrwrtrrrfilterwarningsrFrrIrKWarningrrrrr<module>sN



2 




.

6	
@
.)


##""


	

$3
4


'
Back to Directory File Manager