Viewing File: /opt/alt/python313/lib/python3.13/site-packages/pkg_resources/__pycache__/__init__.cpython-313.pyc

�

a0bi���t�SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSK
r
SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr SSKr\ SSKJ!r! SSKJ"r"J#r#J$r$ Sr%SSKJ&r' SS	K(J)r)J*r* SSK+J,r- \-R\ SS
K/J0r0J1r1J2r2 SSK3J4r4 SSK3J5r5 \6"S
5 \6"S5 \6"S5 \6"S5 \6"S5 \RnS:a\8"S5eSr9Sr:Sr;Sr<Sr=Sr>Sr?Sr@SrASrBSrCSrDSrESrFSrGSrHSrI\	R�"S\KSS9 \R�"S\R�5rN"SS\O5rP\5R�R�rS0rTSrUSrVSrWSrXSrYSrZS r[S!=r\r]S"r^/S#Qr_"S$S%\`5ra"S&S'\a5rb"S(S)\b5rc"S*S+\a5rd"S,S-\a5re0rfS.R�"\Rn6rhS/riSrjS0rkSrlS1rmS2rnS3ro/4S4jrpS5rqS6rr\R�"S75rs\R�"S85rt\rruS9rvS:rw\wrxS;ryS<rzS�S=jr{S>r|"S?S@5r}"SASB\}5r~"SCSD5r"SESF\�5r�"SGSH5r�\�r�"SISJ\85r�"SKSL5r�SMr�SNr�SOr�SPr�SQr�SRr�SSr�STr�S�SUjr�"SVSW5r�\n"\�\�5 SXr�"SYSZ\�5r�"S[S\\�5r�\�GR)5 "S]S^\�5r�\�"5r�"S_S`\�5r�"SaSb\�5r�"ScSd\�5r�\n"\GR4\�5 "SeSf\�5r�"SgSh\�5r�"SiSj\�5r�\U"Sk0Sl9 Smr�S�Snjr�S�Sojr�\�"\GR4\�5 S�Spjr�\�"\�\�5 S�Sqjr�Srr�"SsSt5r�Sur�Svr�Swr�Sxr�\�"\Sy5(a\�"\GRT\�5 \�"\-GRV\�5 \U"Sk0Sz9 \U"Sk0S{9 S|r�S}r�S~r�Sr�S�S�jr�S�r�\�"\Sy5(a\�"\GRT\�5 \�"\GR4\�5 \�"\-GRV\�5 S�r�\�"\�\�5 S�r�S�r�04S�jr�S�r�S�r�S�r�S�r�\R�"S�5GRtr�\R�"S�\GRx\GRz-5GRtr�"S�S�5r�S�r�"S�S�5r�"S�S�\�5r�"S�S�\�5r�\�\�\�S�.r�S�r�S�r�"S�S�\5GR�GR�5r�"S�S�\5GR�GR�5r�S�r�S�r�S�r�S�r�S�r�S�r�\	GR�"S�\PSS�9 S�r�\�\�"54S�j5r�"S�S�\�5r�\�S�5r�g!\a SSKrGNf=f!\a \ rGN'f=f!\a Sr%GN#f=f!\a Sr-GNf=f)�a�
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.

This module is deprecated. Users are directed to :mod:`importlib.resources`,
:mod:`importlib.metadata` and :pypi:`packaging` instead.
�N)�get_importer)�utime)�mkdir�rename�unlinkTF)�open)�isdir�split)�yield_lines�drop_comment�join_continuation)�platformdirs)�	packagingz&pkg_resources.extern.packaging.versionz)pkg_resources.extern.packaging.specifiersz+pkg_resources.extern.packaging.requirementsz&pkg_resources.extern.packaging.markersz$pkg_resources.extern.packaging.utils)��zPython 3.5 or later is requiredzbpkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html���
stacklevelz,^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)c��\rSrSrSrSrg)�
PEP440Warning�zU
Used when there is an issue with a version or specifier not complying with
PEP 440.
�N��__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r�ڏ/builddir/build/BUILDROOT/alt-python313-setuptools-69.0.2-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pkg_resources/__init__.pyrr�s��r rc��[5RU5 [R[R	X55 g�N)�globals�update�_state_vars�dict�fromkeys)�vartype�kws  r!�_declare_stater+�s)���I���R�����t�}�}�R�1�2r c�|�0n[5n[R5Hup#USU-"X5X'M U$)N�_sget_)r$r&�items��state�g�k�vs    r!�__getstate__r4�s>���E��	�A��!�!�#����X��\�?�1�4�(���$��Lr c�~�[5nUR5Hup#US[U-"X!UU5 M  U$)N�_sset_)r$r.r&r/s    r!�__setstate__r7�s<���	�A����
���	�(�[��^�
#�$�Q�!��a�0���Lr c�"�UR5$r#)�copy��vals r!�
_sget_dictr<�s���8�8�:�r c�F�UR5 URU5 gr#)�clearr%��key�obr0s   r!�
_sset_dictrB�s���H�H�J��I�I�e�r c�"�UR5$r#)r4r:s r!�_sget_objectrD�s������r c�&�URU5 gr#)r7r?s   r!�_sset_objectrF�s���O�O�E�r c��gr#r��argss r!�<lambda>rJ�s��r c��[5n[RU5nUbI[RS:Xa5SSR[
5SS5<SURS5<3nU$U$![a U$f=f)a-Return 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.
N�darwin�macosx-�.r�-r)	�get_build_platform�macosVersionString�match�sys�platform�join�_macos_vers�group�
ValueError)�plat�ms  r!�get_supported_platformr[�sy����D�� � ��&�A��}�����1�	�%(�X�X�k�m�B�Q�.?�%@�!�'�'�!�*�M�D��K�4�K���	���K�	�s�3A.�.
A<�;A<)G�require�
run_script�get_provider�get_distribution�load_entry_point�
get_entry_map�get_entry_info�iter_entry_points�resource_string�resource_stream�resource_filename�resource_listdir�resource_exists�resource_isdir�declare_namespace�working_set�add_activation_listener�find_distributions�set_extraction_path�cleanup_resources�get_default_cache�Environment�
WorkingSet�ResourceManager�Distribution�Requirement�
EntryPoint�ResolutionError�VersionConflict�DistributionNotFound�UnknownExtra�ExtractionErrorr�parse_requirements�
parse_version�	safe_name�safe_version�get_platform�compatible_platformsr�split_sections�
safe_extra�to_filename�invalid_marker�evaluate_marker�ensure_directory�normalize_path�EGG_DIST�BINARY_DIST�SOURCE_DIST�
CHECKOUT_DIST�DEVELOP_DIST�IMetadataProvider�IResourceProvider�FileMetadata�PathMetadata�EggMetadata�
EmptyProvider�empty_provider�NullProvider�EggProvider�DefaultProvider�ZipProvider�register_finder�register_namespace_handler�register_loader_type�fixup_namespace_packagesr�PkgResourcesDeprecationWarning�run_main�AvailableDistributionsc��\rSrSrSrSrSrg)rwi$z.Abstract base for dependency resolution errorsc�Z�URR[UR5-$r#)�	__class__r�reprrI��selfs r!�__repr__�ResolutionError.__repr__'s���~�~�&�&��d�i�i��8�8r rN)rrrrrr�rrr r!rwrw$s
��8�9r rwc�H�\rSrSrSrSr\S5r\S5rSr	Sr
Srg	)
rxi+z�
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 requiredc� �URS$�NrrHr�s r!�dist�VersionConflict.dist5����y�y��|�r c� �URS$�N�rHr�s r!�req�VersionConflict.req9r�r c�J�URR"S0[5D6$�Nr��	_template�format�localsr�s r!�report�VersionConflict.report=����~�~�$�$�0�v�x�0�0r c�D�U(dU$URU4-n[U6$)z\
If required_by is non-empty, return a version of self that is a
ContextualVersionConflict.
)rI�ContextualVersionConflict)r��required_byrIs   r!�with_context�VersionConflict.with_context@s'��
��K��y�y�K�>�)��(�$�/�/r rN)rrrrrr��propertyr�r�r�r�rrr r!rxrx+s?���F�I�
��������1�0r rxc�F�\rSrSrSr\RS-r\S5rSr	g)r�iKzy
A VersionConflict that accepts a third parameter, the set of the
requirements that required the installed Distribution.
z by {self.required_by}c� �URS$)NrrHr�s r!r��%ContextualVersionConflict.required_bySr�r rN)
rrrrrrxr�r�r�rrr r!r�r�Ks,���
 �)�)�,D�D�I�
���r r�c�X�\rSrSrSrSr\S5r\S5r\S5r	Sr
SrS	rg
)ryiXz&A requested distribution was not foundzSThe '{self.req}' distribution was not found and is required by {self.requirers_str}c� �URS$r�rHr�s r!r��DistributionNotFound.req`r�r c� �URS$r�rHr�s r!�	requirers�DistributionNotFound.requirersdr�r c�\�UR(dgSRUR5$)Nzthe applicationz, )r�rUr�s r!�
requirers_str�"DistributionNotFound.requirers_strhs���~�~�$��y�y����(�(r c�J�URR"S0[5D6$r�r�r�s r!r��DistributionNotFound.reportnr�r c�"�UR5$r#)r�r�s r!�__str__�DistributionNotFound.__str__qs���{�{�}�r rN)
rrrrrr�r�r�r�r�r�r�rrr r!ryryXsU��0�	2��
���������)��)�
1�r ryc��\rSrSrSrSrg)rziuz>Distribution doesn't have an "extra feature" of the given namerNrrr r!rzrzus��Hr rzz{}.{}rr����c��U[U'g)z�Register `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_type�provider_factorys  r!r�r��s��(8���$r c�\�[U[5(a3[RU5=(d [	[U55S$[RUn[USS5n[[U5"U5$![a! [U5 [RUnNMf=f)z?Return an IResourceProvider for the named module or requirementr�
__loader__N)
�
isinstancerurk�findr\�strrS�modules�KeyError�
__import__�getattr�
_find_adapterr�)�moduleOrReq�module�loaders   r!r^r^�s����+�{�+�+�����,�L���K�8H�0I�!�0L�L�*����[�)���V�\�4�
0�F��,�f�5�f�=�=��	�*��;�����[�)��*�s�
B�(B+�*B+c�N�U(d�[R"5SnUS:Xa\Sn[RR	U5(a6[[S5(a![R"U5nSU;aUSnURURS55 US$)Nr�z0/System/Library/CoreServices/SystemVersion.plist�	readPlist�ProductVersionrN)
rT�mac_ver�os�path�exists�hasattr�plistlibr��appendr
)�_cache�version�plist�
plist_contents    r!rVrV�s�����"�"�$�Q�'���b�=�F�E��w�w�~�~�e�$�$��8�[�1�1�$,�$6�$6�u�$=�M�'�=�8�"/�0@�"A���
�
�g�m�m�C�(�)��!�9�r c�*�SSS.RX5$)N�ppc)�PowerPC�Power_Macintosh)�get)�machines r!�_macos_archr��s����7�;�;�G�M�Mr c�N�SSKJn U"5n[RS:XarUR	S5(d\[5n[R"5SRSS5nS[US5[US	5[U54-$U$![a U$f=f)
z�Return 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)r�rLrM�� �_zmacosx-%d.%d-%sr�)�	sysconfigr�rSrT�
startswithrVr��uname�replace�intr�rX)r�rYr�r�s    r!rPrP�s���'��>�D�
�|�|�x�����	�(B�(B�	�!�m�G��h�h�j��m�+�+�C��5�G�$��G�A�J���G�A�J���G�$�(��
��K��	�	�
��K�		�s�AB�
B$�#B$zmacosx-(\d+)\.(\d+)-(.*)zdarwin-(\d+)\.(\d+)\.(\d+)-(.*)c�~�UbUbX:Xag[RU5nU(Ga[RU5nU(dw[RU5nU(aZ[UR	S55nUR	S5<SUR	S5<3nUS:XaUS:�dUS:XaUS:�agg	UR	S5UR	S5:wd$UR	S
5UR	S
5:wag	[UR	S55[UR	S55:�ag	gg	)z�Can 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.
Tr�rNr�z10.3�z10.4Fr)rQrR�darwinVersionStringrrW)�provided�required�reqMac�provMac�
provDarwin�dversion�macosversions       r!r�r��s����8�+�x�/C�� �
%�
%�h�
/�F�
�$�*�*�8�4���-�2�2�8�<�J���z�/�/��2�3��*0�,�,�q�/�6�<�<��?�K����M�$��.��1�}�$��.����=�=���v�|�|�A��.�'�-�-��2B�f�l�l�ST�o�2U���w�}�}�Q�� �3�v�|�|�A��#7�7���r c��[R"S5RnUSnUR5 X2S'[	U5SRX5 g)z@Locate distribution `dist_spec` and run its `script_name` scriptr�rrN�rS�	_getframe�	f_globalsr>r\r])�	dist_spec�script_name�ns�names    r!r]r]�sG��	���q�	�	#�	#�B�
�j�>�D��H�H�J��z�N��I��q��$�$�[�5r c���[U[5(a[RU5n[U[5(a[	U5n[U[
5(d[
SU5eU$)z@Return a current distribution object for a Requirement or stringz-Expected string, Requirement, or Distribution)r�r�ru�parser^rt�	TypeError�r�s r!r_r_sV���$����� � ��&���$��$�$��D�!���d�L�)�)��G��N�N��Kr c�6�[U5RX5$)zDReturn `name` entry point of `group` for `dist` or raise ImportError)r_r`�r�rWrs   r!r`r`s���D�!�2�2�5�?�?r c�6�[U5RU5$)�=Return the entry point map for `group`, or the full entry map)r_ra)r�rWs  r!raras���D�!�/�/��6�6r c�6�[U5RX5$�z<Return the EntryPoint object for `group`+`name`, or ``None``)r_rbrs   r!rbrb s���D�!�0�0��=�=r c�8�\rSrSrSrSrSrSrSrSr	Sr
g	)
r�i%c��g)z;Does the package's distribution contain the named metadata?Nr�rs r!�has_metadata�IMetadataProvider.has_metadata&��r c��g)z'The named metadata resource as a stringNrr$s r!�get_metadata�IMetadataProvider.get_metadata)r'r c��g)z�Yield 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.Nrr$s r!�get_metadata_lines�$IMetadataProvider.get_metadata_lines,r'r c��g)z>Is the named metadata a directory?  (like ``os.path.isdir()``)Nrr$s r!�metadata_isdir� IMetadataProvider.metadata_isdir2r'r c��g)z?List of metadata names in the directory (like ``os.listdir()``)Nrr$s r!�metadata_listdir�"IMetadataProvider.metadata_listdir5r'r c��g)z=Execute the named script in the supplied namespace dictionaryNr)r�	namespaces  r!r]�IMetadataProvider.run_script8r'r rN)rrrrr%r)r,r/r2r]rrr r!r�r�%s%��J�6�D�M�N�Lr r�c�<�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)r�i<z3An object that provides access to package resourcesc��g)z\Return a true filesystem path for `resource_name`

`manager` must be an ``IResourceManager``Nr��manager�
resource_names  r!�get_resource_filename�'IResourceProvider.get_resource_filename?r'r c��g)zaReturn a readable file-like object for `resource_name`

`manager` must be an ``IResourceManager``Nrr9s  r!�get_resource_stream�%IResourceProvider.get_resource_streamDr'r c��g)zeReturn a string containing the contents of `resource_name`

`manager` must be an ``IResourceManager``Nrr9s  r!�get_resource_string�%IResourceProvider.get_resource_stringIr'r c��g)z,Does the package contain the named resource?Nr�r;s r!�has_resource�IResourceProvider.has_resourceNr'r c��g)z>Is the named resource a directory?  (like ``os.path.isdir()``)NrrEs r!ri� IResourceProvider.resource_isdirQr'r c��g)z?List of resource names in the directory (like ``os.listdir()``)NrrEs r!rg�"IResourceProvider.resource_listdirTr'r rN)rrrrrr<r?rBrFrirgrrr r!r�r�<s%��=�5�
5�
5�
;�M�Nr r�c��\rSrSrSrSSjr\S5r\S5rSr	Sr
S	rSS
jrSr
SrSS
jrSSjrSrSSjrSrSSjrSrSrSrSrg)rriXzDA collection of active distributions on sys.path (or a similar list)Nc��/Ul0Ul0Ul0Ul/UlUc[
RnUHnURU5 M g)z?Create working set from list of path entries (default=sys.path)N)�entries�
entry_keys�by_key�normalized_to_canonical_keys�	callbacksrSr��	add_entry)r�rN�entrys   r!�__init__�WorkingSet.__init__[sJ�����������,.��)�����?��h�h�G��E��N�N�5�!�r c��U"5nSSKJn URU5 U$![a Us$f=f![a URU5s$f=f)z!
Prepare the master working set.
r)�__requires__)�__main__rX�ImportErrorr\rx�_build_from_requirements)�cls�wsrXs   r!�
_build_master�WorkingSet._build_masterisb��
�U��	�-�	>��J�J�|�$��	���	��I�	���	>��/�/��=�=�	>�s�#�5�2�2�A�Ac�@�U"/5n[U5nURU[55nUHnURU5 M [R
H%nXbR;dMURU5 M' UR[R
SS&U$)zA
Build a working set from a requirement spec. Rewrites sys.path.
N)r|�resolverq�addrSr�rNrS)r\�req_specr]�reqs�distsr�rTs       r!r[�#WorkingSet._build_from_requirements}s|����W��!�(�+���
�
�4���/���D��F�F�4�L���X�X�E��J�J�&����U�#��
�j�j�������	r c��URRU/5 URRU5 [	US5HnURX!S5 M g)a�Add 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)rO�
setdefaultrNr�rmrb)r�rTr�s   r!rS�WorkingSet.add_entry�sI��	
���"�"�5�"�-������E�"�&�u�d�3�D��H�H�T�%�(�4r c�R�URRUR5U:H$)z9True if `dist` is the active distribution for its project)rPr�r@�r�r�s  r!�__contains__�WorkingSet.__contains__�s���{�{���t�x�x�(�D�0�0r c��URRUR5nUcIURRUR5nUb!X1lURRU5nUbX!;a[	X!5eU$)a�Find 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.
)rPr�r@rQrx)r�r�r��
canonical_keys    r!r��WorkingSet.find�sp���{�{���s�w�w�'���<� �=�=�A�A�#�'�'�J�M��(�'���{�{���}�5������!�$�,�,��r c� ^^�UU4SjU5$)z�Yield 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).
c3�># �UHCnURT5R5HnTbTUR:XdMUv� M ME g7fr#)ra�valuesr)�.0r�rTrWrs   ��r!�	<genexpr>�/WorkingSet.iter_entry_points.<locals>.<genexpr>�sK����
����+�+�E�2�9�9�;���|�t�u�z�z�1�
�E�;�
��s�:A�
Ar�r�rWrs ``r!rc�WorkingSet.iter_entry_points�s���
��
�	
r c��[R"S5RnUSnUR5 XCS'UR	U5SRX#5 g)z?Locate distribution for `requires` and run `script_name` scriptr�rrNr)r��requiresrrrs     r!r]�WorkingSet.run_script�sK��
�]�]�1�
�
'�
'���*�~��
���
��:�����X��q�!�,�,�[�=r c#�# �0nURHFnX R;aMURUHnX1;dM
SX'URUv� M! MH g7f)z�Yield 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.
r�N)rNrOrP)r��seen�itemr@s    r!�__iter__�WorkingSet.__iter__�sU������L�L�D��?�?�*�����t�,���?� !�D�I��+�+�c�*�*�-�!�s
�8A�Ac��U(aURURX$S9 UcURnURR	U/5nURR	UR/5nU(dUR
UR;agXRUR
'[RRUR
5nUR
URU'UR
U;aURUR
5 UR
U;aURUR
5 URU5 g)a�Add `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_onrN�locationrOrhr@rPr�utils�canonicalize_namerQr��
_added_new)r�r�rT�insertr�keys�keys2�normalized_names        r!rb�WorkingSet.add�s�����N�N�4�<�<��N�@��=��M�M�E����)�)�%��4�����*�*�4�=�=�"�=���4�8�8�t�{�{�2�� $���D�H�H��#�/�/�;�;�D�H�H�E��=A�X�X��)�)�/�:��8�8�4���K�K����!��8�8�5� ��L�L����"�����r c	��[U5SSS2n0n0n/n[5n	[R"[5n
U(a�URS5nX�;aMU	R
X�5(dM7URX�XBX:U5nURUR5SSS2n
URU
5 U
H.nX�RUR5 URX�'M0 SXk'U(aM�U$)a6List 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.
Nr�rT)
�list�
_ReqExtras�collections�defaultdict�set�pop�markers_pass�
_resolve_distrz�extras�extendrb�project_name)r��requirements�env�	installer�replace_conflictingr��	processed�best�to_activate�
req_extrasr�r�r��new_requirements�new_requirements               r!ra�WorkingSet.resolves���B�L�)�$�B�$�/���	������\�
�"�-�-�c�2����"�"�1�%�C�����*�*�3�7�7���%�%��.�Y�[��D�
 $�}�}�S�Z�Z�8��2��>����� 0�1�$4���,�0�0��1A�1A�B�.1�j�j�
�+�$4�"�I�N�/�l�4�r c��URUR5nUc�URRUR5nUbX�;ayU(arUn	Uc/Uc[UR5nO[/5n[/5n	UR
XXSS9=o�UR'UcURUS5n
[X5eURU5 X�;aXan[X�5RU5eU$)N)r�)r�r@rPrqrNrr�
best_matchryr�rxr�)r�r�r�r�r�r�r�r�r�r]r��
dependent_reqs            r!r��WorkingSet._resolve_distOs����x�x���� ���<��;�;�?�?�3�7�7�+�D��|���4G����;��|�)�$�,�,�7��
*�"�o��'��^��'*�~�~��Y�(6�(���C�G�G�}��<� +����T� :�I�.�s�>�>����t�$��?�'�,�M�!�$�,�9�9�-�H�H��r c�j�[U5nUR5 0n0nUc[UR5nX�-
nOX!-nUR	/5n	[[U	RU55 UHvn
XHknUR5/nU	RX�U5n
[[U	RU
55 UR[RU
55  Mt Mx [U5nUR5 Xv4$![anX�U'U(aSnAM�SnA M�SnAff=f)a�Find 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)
r��sortrqrNr��maprb�as_requirementrar%r'r(rw)r��
plugin_env�full_envr��fallback�plugin_projects�
error_info�
distributionsr��
shadow_setr�r�r��	resolveesr3s               r!�find_plugins�WorkingSet.find_pluginsns ��F�z�*�������
��
����d�l�l�+�C���C��'�C��^�^�B�'�
��S�����
&�'�+�L�"�0���*�*�,�-��� *� 2� 2�3�Y� G�I���Z�^�^�Y�7�8�!�(�(����y�)A�B��+1�,�0�]�+�
������(�(��)'��'(�t�$�� ����s�D�
D2�D-�-D2c�n�UR[U55nUHnURU5 M U$)a�Ensure 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.
)rar|rb)r�r��neededr�s    r!r\�WorkingSet.require�s4�����0��>�?���D��H�H�T�N���
r c��XR;agURRU5 U(dgUHnU"U5 M
 g)zkInvoke `callback` for all distributions

If `existing=True` (default),
call on all existing ones, as well.
N)rRr�)r��callback�existingr�s    r!�	subscribe�WorkingSet.subscribe�s:���~�~�%�������h�'����D��T�N�r c�:�URHnU"U5 M
 gr#)rR)r�r�r�s   r!r��WorkingSet._added_new�s�����H��T�N�'r c���URSSURR5URR5URR5UR
SS4$r#)rNrOr9rPrQrRr�s r!r4�WorkingSet.__getstate__�sU���L�L��O��O�O� � �"��K�K�����-�-�2�2�4��N�N�1��
�	
r c��Uup#pEnUSSUlUR5UlUR5UlUR5UlUSSUlgr#)rNr9rOrPrQrR)r��	e_k_b_n_crNr�rPrQrRs       r!r7�WorkingSet.__setstate__�sO��IR�F��v�Y��q�z����)�)�+����k�k�m���,H�,M�,M�,O��)�"�1���r )rPrRrNrOrQr#)NTF)NNFN)NNT�T)rrrrrrU�classmethodr^r[rSrlr�rcr]rrbrar�r�r\r�r�r4r7rrr r!rrrrXs���N�"�����&����*
)�1��0
�>�+�"�F
��!��
H�T�>O)�b� ��
�&r rrc�"�\rSrSrSrSSjrSrg)r�i�z6
Map each requirement to the extras that demanded it.
Nc�^�U4SjURTS5U=(d S-5nTR(+=(d [U5$)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.
c3�^># �UH"nTRRSU05v� M$ g7f)�extraN��marker�evaluate)rtr�r�s  �r!ru�*_ReqExtras.markers_pass.<locals>.<genexpr>s/����
�@��
�J�J����%� 0�1�1�@�s�*-rr#)r�r��any)r�r�r��extra_evalss `  r!r��_ReqExtras.markers_pass�s?���
����#�r�*�f�.?��@�
���:�:�~�1��[�!1�1r rr#)rrrrrr�rrr r!r�r��s���2r r�c�z�\rSrSrSrS\"5\4SjrSrSr	SSjr
SrS	rSS
jr
SSjrSrS
rSrSrg)rqiz5Searchable snapshot of distributions on a search pathNc�L�0UlX lX0lURU5 g)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)�_distmaprT�python�scan)r��search_pathrTr�s    r!rU�Environment.__init__
s!��&��
� �
����	�	�+�r c���URSL=(d. URSL=(d URUR:HnU=(a  [URUR5$)z�Is 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)r��
py_versionr�rT)r�r��	py_compats   r!�can_add�Environment.can_add"sX��
�K�K�4��
.����$�&�
.����$�+�+�-�	�
�O�1�$�-�-����O�Or c�T�URURRU5 g)z"Remove `dist` from the environmentN)r�r@�removerks  r!r��Environment.remove0s���
�
�d�h�h��&�&�t�,r c��Uc[RnUH&n[U5HnURU5 M M( g)a<Scan `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)rSr�rmrb)r�r�r~r�s    r!r��Environment.scan4s7�����(�(�K��D�*�4�0�������1� r c�Z�UR5nURRU/5$)z�Return 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.

)�lowerr�r�)r�r��distribution_keys   r!�__getitem__�Environment.__getitem__Cs+��(�-�-�/���}�}� � �!1�2�6�6r c� �URU5(axUR5(abURRUR/5nX;a6URU5 UR
[R"S5SS9 gggg)zCAdd `dist` if we ``can_add()`` it and it has not already been added�hashcmpT)r@�reverseN)	r��has_versionr�rhr@r�r��operator�
attrgetter)r�r�res   r!rb�Environment.addNss���<�<����$�"2�"2�"4�"4��M�M�,�,�T�X�X�r�:�E�� ����T�"��
�
�x�2�2�9�=�t�
�L�!�#5�r c���URU5nUbU$XRHnXQ;dM
Us $ URX5$![a
 U(deSnNJf=f)ahFind 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)r�rxr@�obtain)r�r�rkr�r�r�s      r!r��Environment.best_matchVsk��	��#�#�C�(�D�
���K����M�D��{���"��{�{�3�*�*���	�&���D�	�s�A�A�Ac��UbU"U5$g)a�Obtain 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)r��requirementr�s   r!r��Environment.obtainqs��� ��[�)�)�!r c#�l# �URR5HnX(dMUv� M g7f)z=Yield the unique project names of the available distributionsN)r�r��r�r@s  r!r�Environment.__iter__}s(����=�=�%�%�'�C��y�y��	�(�s�%4�	4c���[U[5(aURU5 U$[U[5(a'UHnXHnURU5 M M! U$[	SU<S35e)z2In-place addition of a distribution or environmentz
Can't add z to environment)r�rtrbrqr)r��other�projectr�s    r!�__iadd__�Environment.__iadd__�sh���e�\�*�*��H�H�U�O���
��{�
+�
+� ��!�N�D��H�H�T�N�+�!�
���U�D�E�Er c�D�UR/SSS9nX4HnX#-
nM	 U$)z4Add an environment or distribution to an environmentN)rTr��r�)r�r��newr�s    r!�__add__�Environment.__add__�s.���n�n�R�$�t�n�<���;�C��J�C���
r )r�rTr�r#�NF)rrrrrr[�PY_MAJORrUr�r�r�r�rbr�r�rr�rrrr r!rqrqsK��?��)?�)A�(��0P�-�
�	7�M�+�6
*��
�r rqc��\rSrSrSrSrg)r{i�a4An 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
rNrrr r!r{r{�s��r r{c�|�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SSjr\S
5rSrSrSSjrSrg)rsi�z'Manage resource extraction and packagesNc��0Ulgr#)�cached_filesr�s r!rU�ResourceManager.__init__�s
����r c�6�[U5RU5$)zDoes the named resource exist?)r^rF�r��package_or_requirementr;s   r!rh�ResourceManager.resource_exists�s���2�3�@�@��O�Or c�6�[U5RU5$)z,Is the named resource an existing directory?)r^rir
s   r!ri�ResourceManager.resource_isdir�s���2�3�B�B�=�Q�Qr c�6�[U5RX5$)z4Return a true filesystem path for specified resource)r^r<r
s   r!rf�!ResourceManager.resource_filename�s���2�3�I�I��
�	
r c�6�[U5RX5$)z9Return a readable file-like object for specified resource)r^r?r
s   r!re�ResourceManager.resource_stream�����2�3�G�G��
�	
r c�6�[U5RX5$)z%Return specified resource as a string)r^rBr
s   r!rd�ResourceManager.resource_string�rr c�6�[U5RU5$)z1List the contents of the named resource directory)r^rgr
s   r!rg� ResourceManager.resource_listdir�s���2�3�D�D�]�S�Sr c�"�[R"5SnUR=(d
 [5n[R
"S5R
5n[UR"S0[5D65nXl
X$lXlUe)z5Give an error message for problems extracting file(s)r�a
            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.
            r)
rS�exc_info�extraction_pathrp�textwrap�dedent�lstripr{r�r�r:�
cache_path�original_error)r��old_excr�tmpl�errs     r!�extraction_error� ResourceManager.extraction_error�sv���,�,�.��#���)�)�@�->�-@�
����
�
�"�&�(�#	
�$�d�k�k�5�F�H�5�6����#��$���	r c� �UR=(d
 [5n[RR"X1S-/UQ76n[U5 URU5 SURU'U$![a UR5 N>f=f)afReturn 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�)
rrpr�r�rU�_bypass_ensure_directory�	Exceptionr#�_warn_unsafe_extraction_pathr)r��archive_name�names�extract_path�target_paths     r!�get_cache_path�ResourceManager.get_cache_path�s����+�+�B�/@�/B���g�g�l�l�<��1F�O��O��	$�$�[�1�	
�)�)�,�7�)*����+�&����
�	$��!�!�#�	$�s�A0�0B
�B
c��[RS:Xa(UR[RS5(dg[R"U5R
nU[R-(dU[R-(a6SR"S0[5D6n[R"U[5 gg)a
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.
�nt�windirNz�Extraction 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).r)
r�rr�environ�stat�st_mode�S_IWOTH�S_IWGRPr�r��warnings�warn�UserWarning)r��mode�msgs   r!r(�,ResourceManager._warn_unsafe_extraction_paths����7�7�d�?�4�?�?�2�:�:�h�3G�#H�#H�
��w�w�t�}�$�$���$�,�,��$����"5�:��f��!��x�!�C�
�M�M�#�{�+�#6r c��[RS:Xa=[R"U5RS-S-n[R"X5 gg)a�Perform 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.
�posiximi�N)r�rr3r4�chmod)r��tempname�filenamer:s    r!�postprocess�ResourceManager.postprocess#s?���7�7�g���W�W�X�&�.�.�%�7�6�A�D��H�H�X�$�r c�H�UR(a[S5eXlg)abSet 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)rrXr�r�r�s  r!rn�#ResourceManager.set_extraction_path7s��&����T�U�U�#�r c��g)a�
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)r��forces  r!ro�!ResourceManager.cleanup_resourcesOr'r )rr�r�F)rrrrrrrUrhrirfrerdrgr#r-�staticmethodr(rBrnrorrr r!rsrs�s]��1��O��P�R�
�
�
�T��<�2�,��,�4%�($�0
r rsc�v�[RRS5=(d [R"SS9$)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)r�r2r�r�user_cache_dirrr r!rprp]s/���:�:�>�>�,�-���1L�1L��2�r c�2�[R"SSU5$)z�Convert an arbitrary string to a standard distribution name

Any runs of non-alphanumeric/. characters are replaced with a single '-'.
�[^A-Za-z0-9.]+rO)�re�subr$s r!r~r~hs��
�6�6�"�C��.�.r c���[[RRU55$![RRa- URSS5n[R"SSU5s$f=f)z:
Convert an arbitrary string to a standard version string
r�rNrRrO)r�rr��Version�InvalidVersionrrSrT)r�s r!rrpsb��6��9�$�$�,�,�W�5�6�6�����+�+�6��/�/�#�s�+���v�v�&��W�5�5�6�s�'*�AA5�4A5c���URSS5n[RU5nU(aUSnU[U5SnOSnUnS[	U53RS5nUSU3$)a�Fallback when ``safe_version`` is not safe enough
>>> parse_version(_forgiving_version('0.23ubuntu1'))
<Version('0.23.dev0+sanitized.ubuntu1')>
>>> parse_version(_forgiving_version('0.23-'))
<Version('0.23.dev0+sanitized')>
>>> parse_version(_forgiving_version('0.-_'))
<Version('0.dev0+sanitized')>
>>> parse_version(_forgiving_version('42.+?1'))
<Version('42.dev0+sanitized.1')>
>>> parse_version(_forgiving_version('hello world'))
<Version('0.dev0+sanitized.hello.world')>
r�rN�safeN�0z
sanitized.z.dev0+)r�_PEP440_FALLBACK�search�len�
_safe_segment�strip)r�rRrY�rest�locals     r!�_forgiving_versionrb|sx���o�o�c�3�'�G��#�#�G�,�E���V�}���s�4�y�{�#��������t�,�-�.�4�4�S�9�E��V�6�%��!�!r c��[R"SSU5n[R"SSU5n[R"SSU5RS5$)z/Convert an arbitrary string into a safe segmentrRrOz-[^A-Za-z0-9]+z\.[^A-Za-z0-9]+rNz.-)rSrTr_)�segments r!r^r^�sG���f�f�%�s�G�4�G��f�f�%�s�G�4�G�
�6�6�$�c�7�3�9�9�$�?�?r c�N�[R"SSU5R5$)z�Convert 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�)rSrTr�)r�s r!r�r��s!���6�6�#�S�%�0�6�6�8�8r c�&�URSS5$)ztConvert a project or version name to its filename-escaped form

Any '-' characters are currently replaced with '_'.
rOr�r�r$s r!r�r��s��
�<�<��S�!�!r c�j�[U5 g![anSUlSUlUsSnA$SnAff=f)zc
Validate text as a PEP 508 environment marker; return an exception
if invalid or False otherwise.
NF)r��SyntaxErrorrA�lineno)�text�es  r!r�r��s9��
����
��	����
��������s��
2�-�2�2c���[RRU5nUR5$![RRan[U5UeSnAff=f)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)r�markers�Markerr��
InvalidMarkerrh)rjr�r�rks    r!r�r��sR��$��"�"�)�)�$�/����� � �����*�*�$��!�n�!�#��$�s�.1�A �A�A c��\rSrSrSrSrSrSrSrSr	Sr
SrSrS	r
S
rSrSrS
rSrSrSrSrSrSrSrSr\S5rSrSrg)r�i�zETry to implement resources and metadata for arbitrary PEP 302 loadersNc��[USS5Ul[RR	[USS55Ulg)Nr��__file__r�)r�r�r�r��dirname�module_path)r�r�s  r!rU�NullProvider.__init__�s0���f�l�D�9����7�7�?�?�7�6�:�r�+J�K��r c�:�URURU5$r#)�_fnrt�r�r:r;s   r!r<�"NullProvider.get_resource_filename�s���x�x��(�(�-�8�8r c�L�[R"URX55$r#)�io�BytesIOrBrxs   r!r?� NullProvider.get_resource_stream�s���z�z�$�2�2�7�J�K�Kr c�X�URURURU55$r#)�_getrwrtrxs   r!rB� NullProvider.get_resource_string��"���y�y����$�"2�"2�M�B�C�Cr c�X�URURURU55$r#)�_hasrwrt�r�r;s  r!rF�NullProvider.has_resource�r�r c�:�URURU5$r#)rw�egg_info�r�rs  r!�_get_metadata_path�NullProvider._get_metadata_path�s���x�x��
�
�t�,�,r c��UR(dUR$URU5nURU5$r#)r�r�r��r�rr�s   r!r%�NullProvider.has_metadata�s1���}�}��=�=� ��&�&�t�,���y�y���r c��UR(dgURU5nURU5nURS5$![a*nU=R
SR
X5-
sleSnAff=f)Nr��utf-8z in {} file at path: {})r�r�r�decode�UnicodeDecodeError�reasonr�)r�rr��value�excs     r!r)�NullProvider.get_metadata�sl���}�}���&�&�t�,���	�	�$���	��<�<��(�(��!�	�
�J�J�3�:�:�4�F�F�J���		�s�A�
A;�%A6�6A;c�6�[URU55$r#�rr)r�s  r!r,�NullProvider.get_metadata_lines�����4�,�,�T�2�3�3r c�X�URURURU55$r#)�_isdirrwrtr�s  r!ri�NullProvider.resource_isdir�s"���{�{�4�8�8�D�$4�$4�m�D�E�Er c�~�UR=(a+ URURURU55$r#)r�r�rwr�s  r!r/�NullProvider.metadata_isdir�s)���}�}�K����T�X�X�d�m�m�T�-J�!K�Kr c�X�URURURU55$r#)�_listdirrwrtr�s  r!rg�NullProvider.resource_listdirs"���}�}�T�X�X�d�&6�&6�
�F�G�Gr c�~�UR(a+URURURU55$/$r#)r�r�rwr�s  r!r2�NullProvider.metadata_listdirs,���=�=��=�=����$�-�-��!>�?�?��	r c��SU-nURU5(d#[SR"S
0[5D65eUR	U5RSS5nURSS5nUR
URU5nXRS'[RRU5(a>[U5nUR5nSSS5 [WUS5n[X�U5 gSS	KJn	 [#U5SUR%S5U4X�'[XES5n
[X�U5 g!,(df   Ng=f)Nzscripts/z<Script {script!r} not found in metadata at {self.egg_info!r}z
�
�
rr�execr)�cacher)r%rwr�r�r)rrwr�r�r�r�r�read�compiler��	linecacher�r]r
)r�rr5�script�script_text�script_filename�fid�source�coder��script_codes           r!r]�NullProvider.run_script	s ���k�)��� � ��(�(�!�N�U�U���h���
�
�'�'��/�7�7���E��!�)�)�$��5���(�(�4�=�=�&�9�� /�*��
�7�7�>�>�/�*�*��o�&�#������'��6�?�F�;�D���)�,�'��K� ���!�!�$�'��	&�E�"�"�+��G�K����3�'�&�s�D3�3
Ec��[S5e�Nz9Can't perform this operation for unregistered loader type��NotImplementedErrorrEs  r!r��NullProvider._has&���!�G�
�	
r c��[S5er�r�rEs  r!r��NullProvider._isdir+r�r c��[S5er�r�rEs  r!r��NullProvider._listdir0r�r c��URU5 U(a0[RR"U/UR	S5Q76$U$)N�/)�_validate_resource_pathr�r�rUr
)r��baser;s   r!rw�NullProvider._fn5s;���$�$�]�3���7�7�<�<��@�}�':�':�3�'?�@�@��r c��[RRUR[R
5;=(d3 [R"U5=(d [R"U5nU(dgSn[R"U5(a&[R"U5(d[U5e[USSS-[5 g)a
Validate the resource paths according to the docs.
https://setuptools.pypa.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.r�z/ and will raise exceptions in a future release.)r�r��pardirr
�	posixpath�sep�isabs�ntpathrX�
issue_warning�DeprecationWarning)r��invalidr;s   r!r��$NullProvider._validate_resource_path;s���l
�G�G�N�N�d�j�j����7�7�
"����t�$�
"��|�|�D�!�	�
��M���<�<����i�o�o�d�&;�&;��S�/�!�	����H�H�H��	
r c��[URS5(aURRU5$[S5e)N�get_dataz=Can't perform this operation for loaders without 'get_data()')r�r�r�r�rEs  r!r�NullProvider._get�s8���4�;�;�
�+�+��;�;�'�'��-�-�!�K�
�	
r )r�rt)rrrrr�egg_namer�r�rUr<r?rBrFr�r%r)r,rir/rgr2r]r�r�r�rwrLr�rrrr r!r�r��s���O��H��H�
�F�L�9�L�D�D�-���4�F�L�H��
4�:
�

�

�
��G
��G
�R
r r�c#�x# �SnX:wa/Uv� Un[RRU5upX:waM.gg7f)z*
yield all parents of path including path
N)r�r�r
)r��lastr�s   r!�_parentsr��s6����D�
�,��
����'�'�-�-��%����,�s�4:�:c�8^�\rSrSrSrU4SjrSrSrSrU=r	$)r�i�z&Provider based on a virtual filesystemc�D>�[TU]U5 UR5 gr#)�superrU�
_setup_prefix�r�r�r�s  �r!rU�EggProvider.__init__�s���
���� ����r c��[[[UR55n[	US5nU=(a URU5 g gr#)�filter�_is_egg_pathr�rt�next�_set_egg)r��eggs�eggs   r!r��EggProvider._setup_prefix�s;���l�H�T�-=�-=�$>�?���4�����"��
�
�c�"�"r c��[RRU5Ul[RR	US5UlXlg)N�EGG-INFO)r�r��basenamer�rUr��egg_rootrEs  r!r��EggProvider._set_egg�s3�����(�(��.��
������T�:�6��
��
r )r�r�r�)
rrrrrrUr�r�r�
__classcell__r�s@r!r�r��s���0��#��r r�c�F�\rSrSrSrSrSrSrSrSr	\
S5rS	rg
)r�i�z6Provides access to package resources in the filesystemc�@�[RRU5$r#)r�r�r�rEs  r!r��DefaultProvider._has�s���w�w�~�~�d�#�#r c�@�[RRU5$r#)r�r�r	rEs  r!r��DefaultProvider._isdir�s���w�w�}�}�T�"�"r c�.�[R"U5$r#)r��listdirrEs  r!r��DefaultProvider._listdir�s���z�z�$��r c�N�[URURU5S5$�N�rb)rrwrtrxs   r!r?�#DefaultProvider.get_resource_stream�s ���D�H�H�T�-�-�}�=�t�D�Dr c�p�[US5nUR5sSSS5 $!,(df   g=fr�)rr�)r�r��streams   r!r�DefaultProvider._get�s#��
�$��
���;�;�=��
�
�s�'�
5c�d�SnUH(n[[U[S55n[X05 M* g)N)�SourceFileLoader�SourcelessFileLoader)r��importlib_machinery�typer�)r\�loader_namesr�
loader_clss    r!�	_register�DefaultProvider._register�s0��
��!�D� �!4�d�D��J�G�J� ��1�!r rN)
rrrrrr�r�r�r?rr�r�rrr r!r�r��s3��@�$�#� �E�!��2��2r r�c�8�\rSrSrSrSrS=rrSrSr	Sr
Srg)	r�i�z.Provider that returns nothing for all requestsNc��grrrEs  r!rJ�EmptyProvider.<lambda>�s��ur c��g�Nr�rrEs  r!r�EmptyProvider._get�s��r c��/$r#rrEs  r!r��EmptyProvider._listdir�s���	r c��gr#rr�s r!rU�EmptyProvider.__init__�s��r r)rrrrrrtr�r�rr�rUrrr r!r�r��s#��8��K�,�,�F�T���
r r�c�,�\rSrSrSr\S5r\rSrg)�ZipManifestsi�z
zip manifest builder
c�^�[R"U5mU4SjTR55n[U5sSSS5 $!,(df   g=f)z�
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.
c3�># �UH6nURS[R5TRU54v� M8 g7f)r�N)rr�r��getinfo)rtr�zfiles  �r!ru�%ZipManifests.build.<locals>.<genexpr>�s<�����
-�D��L�L��b�f�f�-��M�M�$�'��-�s�>AN)�zipfile�ZipFile�namelistr')r\r�r.rs   @r!�build�ZipManifests.build�s@����_�_�T�
"�e��
"�N�N�,��E���;�#�
"�
"�s�%A�
ArN)	rrrrrr�r�loadrrr r!rr�s"�������$�Dr rc�D�\rSrSrSr\R"SS5rSrSr	g)�MemoizedZipManifestsi�z
Memoized zipfile manifests.
�manifest_modzmanifest mtimec��[RRU5n[R"U5RnX;dXR
U:wa$UR
U5nURX25X'XR$)zG
Load a manifest at path or return a suitable manifest already loaded.
)	r�r��normpathr3�st_mtime�mtimerr�manifest)r�r�rrs    r!r�MemoizedZipManifests.loadsn���w�w����%������
�&�&����t�z�/�/�5�8��z�z�$�'�H��*�*�8�;�D�J��z�"�"�"r rN)
rrrrrr��
namedtuplerrrrr r!rr�s!����)�)�.�:J�K�L�#r rc�^�\rSrSrSrSr\"5rU4SjrSr	Sr
\S5rSr
\S	5rS
rSrSrS
rSrSrSrSrSrSrU=r$)r�iz"Resource support for zips and eggsNc�|>�[TU]U5 URR[R
-Ulgr#)r�rUr��archiver�r��zip_prer�s  �r!rU�ZipProvider.__init__s*���
���� ��{�{�*�*�R�V�V�3��r c��UR[R5nXRR:XagURUR5(aU[UR5S$[U<SUR<35e)Nr�� is not a subpath of )	�rstripr�r�r�r#rr$r]�AssertionError�r��fspaths  r!�
_zipinfo_name�ZipProvider._zipinfo_namesi�����r�v�v�&���[�[�(�(�(�����T�\�\�*�*��#�d�l�l�+�-�.�.��F�D�L�L�Q�R�Rr c�*�URU-nURUR[R-5(a8U[UR5S-SR
[R5$[U<SUR<35e)Nr�r')r$rr�r�r�r]r
r))r��zip_pathr+s   r!�_parts�ZipProvider._parts(so������(�����T�]�]�R�V�V�3�4�4��#�d�m�m�,�q�0�2�3�9�9�"�&�&�A�A��F�D�M�M�R�S�Sr c�`�URRURR5$r#)�_zip_manifestsrr�r#r�s r!�zipinfo�ZipProvider.zipinfo0s#���"�"�'�'����(;�(;�<�<r c�8�UR(d[S5eURU5nUR5nSR	URU55U;a)UH#nUR
XRU55 M% UR
X5$)Nz5resource_filename() only supported for .egg, not .zipr�)r�r��_resource_to_zip�_get_eager_resourcesrUr0�_extract_resource�
_eager_to_zip)r�r:r;r/�eagersrs      r!r<�!ZipProvider.get_resource_filename4s����}�}�%�G��
��(�(��7���*�*�,���8�8�D�K�K��)�*�f�4����&�&�w�0B�0B�4�0H�I���%�%�g�8�8r c�j�URnURS-n[R"U5nX14$)N)rrr�)�	file_size�	date_time�time�mktime)�zip_stat�sizer?�	timestamps    r!�_get_date_and_size�ZipProvider._get_date_and_sizeAs3���!�!���&�&��3�	��K�K�	�*�	���r c��X R5;ahUR5UH2nURU[RR	X#55nM4 [RRW5$UR
URU5upV[(d[S5eURURURU55nURXr5(aU$[S[RRU5S9up�[R"X�R R#U55 [R$"U5 ['X�U45 UR)X�5 [+X�5 U$![R,an [RR/U5(aHURXr5(aUs$[R0S:Xa[3U5 [+X�5 Us$ef=f![R,a UR55 W$f=f)Nz>"os.rename" and "os.unlink" are not supported on this platformz	.$extract)�dirr0)�_indexr9r�r�rUrsrEr4�
WRITE_SUPPORT�OSErrorr-r�r0�_is_current�_mkstemp�writer�r��closerrBr�error�isfilerrr#)
r�r:r/rr�rDrC�	real_path�outf�tmpnams
          r!r9�ZipProvider._extract_resourceKs����{�{�}�$����
�h�/���-�-�g�r�w�w�|�|�H�7S�T��0��7�7�?�?�4�(�(��1�1�$�,�,�x�2H�I��	��}��S��
�!	'��.�.�t�}�}�d�k�k�(�>S�T�I����	�4�4� � �#���G�G�O�O�I�.��L�D�
�H�H�T�;�;�/�/��9�:��H�H�T�N��&�i�0�1�����2�
��v�)�&���#�8�8�
��7�7�>�>�)�,�,��'�'�	�<�<� )�(����D���y�)��v�1�(�(��
���x�x�	'��$�$�&���		'�sE�3AH�6BH�F�AH� H�",H�H�H�H�$H=�<H=c��URURU5up4[RR	U5(dg[R
"U5nURU:wdURU:wagURRU5n[US5nUR5nSSS5 Xh:H$!,(df   UW:H$=f)z;
Return True if the file_path is current for this zip_path
Fr�N)rEr4r�r�rQr3�st_sizerr�r�rr�)	r��	file_pathr/rDrCr3�zip_contents�f�
file_contentss	         r!rL�ZipProvider._is_current}s����1�1�$�,�,�x�2H�I��	��w�w�~�~�i�(�(���w�w�y�!���<�<�4��4�=�=�I�#=���{�{�+�+�H�5��
�)�T�
"�a��F�F�H�M�#��,�,�#�
"��}�,�,�s�$C�
Cc���URcI/nSH;nURU5(dMURURU55 M= XlUR$)N)znative_libs.txtzeager_resources.txt)r;r%r�r,)r�r;rs   r!r8� ZipProvider._get_eager_resources�sU���;�;���F�B���$�$�T�*�*��M�M�$�"9�"9�$�"?�@�C�!�K��{�{�r c�|�UR$![a� 0nURH�nUR[R
5nU(dM+[R
R
USS5nXA;aXRUS5 MjUR5/X'U(aM[M� XlUs$f=f)Nr�)	�	_dirindex�AttributeErrorr4r
r�r�rUr�r�)r��indr��parts�parents     r!rI�ZipProvider._index�s���	��>�>�!���	��C������
�
�2�6�6�*���e��V�V�[�[��s���4�F��}���*�*�5��9�5��',�y�y�{�m���
�e�%�!�N��J�	�s��?B;�AB;�,B;�:B;c�r�URU5nX R;=(d X R5;$r#)r,r4rI)r�r+r/s   r!r��ZipProvider._has�s-���%�%�f�-���<�<�'�D�8�{�{�}�+D�Dr c�F�URU5UR5;$r#)r,rIr*s  r!r��ZipProvider._isdir�s���!�!�&�)�T�[�[�]�:�:r c�r�[UR5RURU5S55$r�)r�rIr�r,r*s  r!r��ZipProvider._listdir�s+���D�K�K�M�%�%�d�&8�&8��&@�"�E�F�Fr c�X�URURURU55$r#)r,rwr�r�s  r!r:�ZipProvider._eager_to_zip�s"���!�!�$�(�(�4�=�=�-�"H�I�Ir c�X�URURURU55$r#)r,rwrtr�s  r!r7�ZipProvider._resource_to_zip�s$���!�!�$�(�(�4�+;�+;�]�"K�L�Lr )r`r;r$)rrrrrr;rr3rUr,r0r�r4r<rLrEr9rLr8rIr�r�r�r:r7rr�r�s@r!r�r�s����,�
�F�)�+�N�4�S�T��=��=�9�����0�d-� ��"E�;�G�J�M�Mr r�c�<�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)r�i�aMetadata 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.
c��Xlgr#�r�rEs  r!rU�FileMetadata.__init__�s���	r c��UR$r#rrr�s  r!r��FileMetadata._get_metadata_path�s���y�y�r c�l�US:H=(a) [RRUR5$)N�PKG-INFO)r�r�rQr�s  r!r%�FileMetadata.has_metadata�s#���z�!�?�b�g�g�n�n�T�Y�Y�&?�?r c���US:wa[S5e[URSSS9nUR5nSSS5 UR	W5 U$!,(df   N!=f)Nrwz(No metadata except PKG-INFO is availabler�r)�encoding�errors)r�rr�r��_warn_on_replacement)r�rrZ�metadatas    r!r)�FileMetadata.get_metadata�sV���:���E�F�F�
�$�)�)�g�i�
@�A��v�v�x�H�A��!�!�(�+���A�
@�s�A�
A!c�x�SnX!;a3SnUR"S0[5D6n[R"U5 gg)Nu�z2{self.path} could not be properly decoded in UTF-8r)r�r�r7r8)r�r}�replacement_charr!r;s     r!r|�!FileMetadata._warn_on_replacement�s7�� ���'�G�D��+�+�)���)�C��M�M�#��(r c�6�[URU55$r#r�r�s  r!r,�FileMetadata.get_metadata_lines�r�r rrN)rrrrrrUr�r%r)r|r,rrr r!r�r��s&��	���@���4r r�c��\rSrSrSrSrSrg)r�i�aCMetadata 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)
c��XlX lgr#)rtr�)r�r�r�s   r!rU�PathMetadata.__init__�s
���� �
r )r�rtN�rrrrrrUrrr r!r�r��s���&!r r�c��\rSrSrSrSrSrg)r�i�z Metadata provider for .egg filesc�,�UR[R-UlXlUR
(a:[RRURUR
5UlOURUlUR5 g)z-Create a metadata provider from a zipimporterN)
r#r�r�r$r��prefixr�rUrtr�)r��importers  r!rU�EggMetadata.__init__sa�� �'�'�"�&�&�0������?�?�!�w�w�|�|�H�,<�,<�h�o�o�N�D��'�/�/�D�����r )r�rtr$Nr�rr r!r�r��s
��*�	r r�r'��_distribution_findersc��U[U'g)ahRegister `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.Nr�)�
importer_type�distribution_finders  r!r�r�s��,?��-�(r c�J�[U5n[[U5nU"X U5$)z.Yield distributions accessible via `path_item`)rr�r�)�	path_item�onlyr��finders    r!rmrms&���I�&�H�
�0�(�
;�F��(�t�,�,r c#�# �URRS5(ag[U5nURS5(a[RXS9v� U(agUR
S5H�n[U5(aK[RRX5n[[R"U5U5nUShv�N M^UR5RS5(dM�[RRX5n[[R"U55nXWl[R!XU5v� M� gN�7f)z8
Find eggs in zip files; possibly multiple nested eggs.
z.whlNrw�r}r�)�
.dist-info�	.egg-info)r#�endswithr�r%rt�
from_filenamergr�r�r�rU�find_eggs_in_zip�	zipimport�zipimporterr�r��
from_location)r�r�r�r}�subitem�subpathre�submetas        r!r�r� s������ � ��(�(�	��8�$�H����Z�(�(��(�(��(�F�F����,�,�R�0���� � ��g�g�l�l�9�6�G�$�Y�%:�%:�7�%C�W�M�E����
�]�]�_�
%�
%�&A�
B�
B��g�g�l�l�9�6�G�!�)�"7�"7��"@�A�G�&���,�,�Y��I�I�1�
�s�CE�
E�(E�7A"Ec��gr�r)r�r�r�s   r!�find_nothingr�=s��
r c
#�^# �[T5m[T5(a?[RT[	T[
RRTS55S9v� gU4Sj[T55n[U5H?n[
RRTU5n[TXB5nU"U5Shv�N MA gN	7f)z6Yield distributions accessible on a sys.path directoryr�r�Nc3�d># �UH%n[RRTU5v� M' g7fr#)r�r�rU)rt�childr�s  �r!ru�find_on_path.<locals>.<genexpr>Os%����S�;R�%�r�w�w�|�|�I�u�-�-�;R�s�-0)�_normalize_cached�_is_unpacked_eggrtr�r�r�r�rU�safe_listdir�sorted�dist_factory)r�r�r�rNrT�fullpath�factorys `     r!�find_on_pathr�Ds�����!�)�,�I��	�"�"��(�(��!�)�R�W�W�\�\�)�Z�-P�Q�)�
�	
�	�S�<�	�;R�S�G������7�7�<�<�	�5�1���y�%�6���8�$�$�$�!�	%�s�B5C�8C�9
Cc��UR5nURS5nURS5=(a< [RR	[RRX55nU=(d UnU(a[$U(d[U5(a[$U(dURS5(a[$[5$)z*Return a dist_factory for the given entry.r�r�z	.egg-link)r�r�r�r�r	rU�distributions_from_metadatar�rm�resolve_egg_link�NoDists)r�rTr�r��is_egg_info�is_dist_info�is_metas       r!r�r�Xs����K�K�M�E��.�.��-�K��>�>�,�/��B�G�G�M�M�
�����Y�&�5�L��)�\�G��	$����U�+�+� ������{�3�3����Y�r c�$�\rSrSrSrSrSrSrg)r�ikz?
>>> bool(NoDists())
False

>>> list(NoDists()('anything'))
[]
c��grrr�s r!�__bool__�NoDists.__bool__ts��r c��[S5$r�)�iter)r�r�s  r!�__call__�NoDists.__call__ws���B�x�r rN)rrrrrr�r�rrr r!r�r�ks����r r�c��[R"U5$![[4a g[aHnUR
[
R[
R[
R4;aeSnAgSnAff=f)zA
Attempt to list contents of path, but suppress some exceptions.
Nr)	r�r��PermissionError�NotADirectoryErrorrK�errno�ENOTDIR�EACCES�ENOENT)r�rks  r!r�r�{sk����z�z�$�����/�0�
�����
�7�7�5�=�=�%�,�,����E�E��F�
���s��A;�	A;�>A6�6A;c#�~# �[RRU5n[RRU5(a0[	[R
"U55S:Xag[
X5nO[U5n[RRU5n[RUUU[S9v� g7f)Nr)�
precedence)r�r�rsr	r]r�r�r�r�rtr�r�)r��rootr}rTs    r!r�r��s����
�7�7�?�?�4� �D�	�w�w�}�}�T����r�z�z�$�� �A�%����+����%���G�G���T�"�E�
�
$�
$��
���	%���s�B;B=c#�# �[U5nUH nUR5nU(dMUv� M" SSS5 g!,(df   g=f7f)z)
Yield non-empty lines from file at path
N)rr_)r�rZ�lines   r!�non_empty_linesr��s8���
�d��q��D��:�:�<�D��t��
��
���s�A�>�>�	A�
A�Ac�j^�[T5nU4SjU5n[[U5n[US5$)zU
Given a path to an .egg-link, resolve distributions
present in the referenced path.
c3�># �UHBn[RR[RRT5U5v� MD g7fr#)r�r�rUrs)rt�refr�s  �r!ru�#resolve_egg_link.<locals>.<genexpr>�s4�����<L�S������R�W�W�_�_�T�*�C�0�0�<L�s�A
A
r)r�r�rmr�)r��referenced_paths�resolved_paths�dist_groupss`   r!r�r��s;���
'�t�,���<L��N��(�.�9�K���R� � r �ImpImporter��_namespace_handlers)�_namespace_packagesc��U[U'g)arRegister `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``.
Nr�)r��namespace_handlers  r!r�r��s��*;��
�&r c��[U5nUcgURU5nU(aUROSnWcg[RRU5nUc<[R"U5=n[RU'/Ul
[U5 O[US5(d[!SU5e[#[$U5nU"X!X5nUb?URnUR'U5 [(R*"U5 [-X�U5 U$![a] [R
"5 [R"S5 URU5nSSS5 GM/!,(df   GN?=ff=f)zEEnsure that named package includes a subpath of path_item (if needed)N�ignore�__path__�Not a package:)r�	find_specr�rar7�catch_warnings�simplefilter�find_modulerSr�r��types�
ModuleTyper��_set_parent_nsr�rr�r�r��	importlib�
import_module�_rebuild_mod_path)	�packageNamer�r��specr�r��handlerr�r�s	         r!�
_handle_nsr��s=���I�&�H����/��!�!�+�.��!%����$��
�~��
�[�[�_�_�[�
)�F�
�~�,1�,<�,<�[�,I�I�����[�)�����{�#�
�V�Z�
(�
(��(�+�6�6��/��:�G��h�;�?�G����������G������,��$�V�4��N��1�7�
�
$�
$�
&��!�!�(�+��)�)�+�6�F�'�
&�
&�
&��7�s)�D�E:�2(E&�E:�&
E6	�0E:�6E:c�<^^^�[RVs/sHn[U5PM snmU4SjmUU4Sjn[XS9nUVs/sHn[U5PM nn[	UR
[5(aXRR
SS&gXRlgs snfs snf)ze
Rebuild module.__path__ ensuring that all entries are ordered
corresponding to their sys.path order
c�^>�TRU5$![a [S5s$f=f)z
Workaround for #520 and #513.
�inf)�indexrX�float)rT�sys_paths �r!�safe_sys_path_index�._rebuild_mod_path.<locals>.safe_sys_path_index�s0���	 ��>�>�%�(�(���	 ���<��	 �s��,�,c��>�UR[R5nTRS5S-nUSU*nT"[	[RRU555$)zB
Return the ordinal of the path based on its position in sys.path
rNr�N)r
r�r��countr�rU)r��
path_parts�module_partsrc�package_namer�s    ��r!�position_in_sys_path�/_rebuild_mod_path.<locals>.position_in_sys_path	sX����Z�Z����'�
�#�)�)�#�.��2���>�\�M�*��"�#4�R�V�V�[�[��5G�#H�I�Ir )r@N)rSr�r�r�r�r�r�)�	orig_pathr�r��pr��new_pathr�r�s `    @@r!r�r��s����
/2�h�h�7�h��!�!�$�h�7�H� �J��i�:�H�.6�7�h��!�!�$�h�H�7��&�/�/�4�(�(�%�����"���58��*8s�B�Bc���SU<S3n[R"U[SS9 [R"5 U[
;a[R"5 g[RnURS5un nU(a>[U5 U[
;a[U5 [RURn[
R!U=(d S/5R#U5 [
R!U/5 UHn[%X5 M [R"5 g![an[SU5UeSnAff=f![R"5 f=f)z9Declare that package 'packageName' is a namespace packagez4Deprecated call to `pkg_resources.declare_namespace(z�)`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packagesrrNrNr�)r7r8r��_imp�acquire_lockr��release_lockrSr��
rpartitionrjr�r�r�rarrhr�r�)r�r;r�rdr�rkr�s       r!rjrj	s6��?�{�o�N3�	3��
�M�M�#�)�a�8�������-�-��2	
����/�x�x��"�-�-�c�2����1���f�%��0�0��6�"�
A��{�{�6�*�3�3��	�&�&�v�~��r�:�A�A�+�N��&�&�{�B�7��I�
�{�.��	
�����"�
A�� 0�&�9�q�@��
A��	
����s7�
E�AE�&D1�AE�1
E
�;
E�E
�
E�E'c��[R"5 [RUS5H"n[	X 5nU(dM[X25 M$ [R"5 g![R"5 f=f)zDEnsure that previously-declared namespace packages include path_itemrN)r�rr�r�r�r�r)r�rd�packager�s    r!r�r�B	s\�������*�.�.�v�r�:�G� ��4�G��w�(��:�;�
	
���������s�)A)�A)�)Bc���[RRXRS5S5n[	U5nUR
Hn[	U5U:XdM g U$)zBCompute an ns-package subpath for a filesystem or zipfile importerrNr�N)r�r�rUr
r�r�)r�r�r�r�r��
normalizedr~s       r!�file_ns_handlerrN	sU���g�g�l�l�9�&7�&7��&<�R�&@�A�G�"�7�+�J������T�"�j�0�� �
�r c��gr#r)r�r�r�r�s    r!�null_ns_handlerr	b	s��r c	���[RR[RR[RR	[U5555$)z1Normalize a file/dir name for comparison purposes)r�r��normcase�realpathr�
_cygwin_patch�rAs r!r�r�i	s:��
�7�7���B�G�G�,�,�R�W�W�-=�-=�m�H�>U�-V�W�X�Xr c�l�[RS:Xa[RR	U5$U$)z�
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)rSrTr�r��abspathrs r!r
r
n	s'��),����(@�2�7�7�?�?�8�$�N�h�Nr c�N�X$![a [U5=X'nUs$f=fr#)r�r�)rAr��results   r!r�r�y	s6���������$2�8�$<�<���6��
��s��$�$c�<�[U5=(d [U5$)z/
Determine if given path appears to be an egg.
)�_is_zip_eggr�rrs r!r�r��	s���t��6� 0�� 6�6r c���UR5RS5=(a< [RR	U5=(a [
R"U5$)N�.egg)r�r�r�r�rQr�
is_zipfilerrs r!rr�	sC���
�
����f�%�	%��G�G�N�N�4� �	%����t�$�r c���UR5RS5=(a> [RR	[RRUSS55$)z8
Determine if given path appears to be an unpacked egg.
rr�rw)r�r�r�r�rQrUrrs r!r�r��	sE���:�:�<� � ��(��R�W�W�^�^�
�����T�:�z�2�.�r c���URS5nUR5nU(aASRU5n[[R
UU[R
U5 gg)NrN)r
r�rU�setattrrSr�)r�rcrrds    r!r�r��	sP�����c�"�E��9�9�;�D�����%�������F�#�T�3�;�;�{�+C�D�
r z\w+(\.\w+)*$z�
    (?P<name>[^-]+) (
        -(?P<ver>[^-]+) (
            -py(?P<pyver>[^-]+) (
                -(?P<plat>.+)
            )?
        )?
    )?
    c��\rSrSrSrSSjrSrSrSSjrSr	SS	jr
\R"S
5r
\SSj5r\S5r\SS
j5r\SSj5rSrg)rvi�	z3Object representing an advertised importable objectNc��[U5(d[SU5eXlX l[	U5Ul[	U5UlXPlg)NzInvalid module name)�MODULErXr�module_name�tuple�attrsr�r�)r�rrr!r�r�s      r!rU�EntryPoint.__init__�	sA���k�"�"��2�K�@�@��	�&���5�\��
��F�m����	r c��UR<SUR<3nUR(a!USSRUR5--
nUR(a!USSRUR5--
nU$)Nz = �:rNz [%s]�,)rrr!rUr�)r��ss  r!r��EntryPoint.__str__�	sa�����D�$4�$4�5���:�:�
��s�x�x��
�
�+�+�+�A��;�;�
��3�8�8�D�K�K�0�0�0�A��r c��S[U5-$)NzEntryPoint.parse(%r)�r�r�s r!r��EntryPoint.__repr__�	s��%��D�	�1�1r c��U(aU(dU(a[R"S[SS9 U(aUR"U0UD6 UR	5$)z8
Require packages for this EntryPoint, then resolve it.
zJParameters to load are deprecated.  Call .resolve and .require separately.rr)r7r8r�r\ra)r�r\rI�kwargss    r!r�EntryPoint.load�	sD���$�&��M�M�'�.��	
���L�L�$�)�&�)��|�|�~�r c���[URS/SS9n[R"[UR
U5$![an[[U55UeSnAff=f)z4
Resolve the entry point from its module and attrs.
rr)�fromlist�levelN)	r�r�	functools�reducer�r!rarZr�)r�r�r�s   r!ra�EntryPoint.resolve�	sY���D�,�,�
�|�1�M��	1��#�#�G�T�Z�Z��@�@���	1��c�#�h�'�S�0��	1�s�%>�
A"�A�A"c�,�UR(aUR(d[SU5eURRUR5n[RX1X RS9n[
[[RU55 g)Nz&Can't require() without a distribution)r�)	r�r�rzrzrkrar�r�rb)r�r�r�rdr.s     r!r\�EntryPoint.require�	sc���;�;�t�y�y��G��N�N��y�y�!�!�$�+�+�.���#�#�D�y���#�M���S����%�
(�)r z]\s*(?P<name>.+?)\s*=\s*(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+))?\s*(?P<extras>\[.*\])?\s*$c�
�URRU5nU(d
Sn[XA5eUR5nUR	US5nUS(aUSRS5OSnU"USUSXvU5$)z�Parse 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��attrrNrrr�)�patternrRrX�	groupdict�
_parse_extrasr
)r\�srcr�rZr;�resr�r!s        r!r�EntryPoint.parse�	s��
�K�K���c�"���M�C��S�&�&��k�k�m���"�"�3�x�=�1��*-�f�+��F��!�!�#�&�2���3�v�;��H�
�u�d�C�Cr c��U(dg[RSU-5nUR(a
[5eUR$)Nr�x)rur�specsrXr�)r\�extras_specr�s   r!r:�EntryPoint._parse_extras

s6��������k� 1�2���9�9��,���z�z�r c���[U5(d[SU5e0n[U5HHnURXS5nURU;a[SXR5eXdUR'MJ U$)zParse an entry point groupzInvalid group namezDuplicate entry point)rrXrrr)r\rW�linesr��thisr��eps       r!�parse_group�EntryPoint.parse_group
sl���e�}�}��1�5�9�9�����&�D����4�&�B��w�w�$�� �!8�%���I�I�����M�	'�
�r c��[U[5(aUR5nO[U5n0nUHQupEUcU(dM[	S5eUR5nXC;a[	SU5eUR
XEU5X4'MS U$)z!Parse a map of entry point groupsz%Entry points must be listed in groupszDuplicate group name)r�r'r.r�rXr_rG)r\�datar��mapsrWrDs      r!�	parse_map�EntryPoint.parse_map 
s����d�D�!�!��:�:�<�D�!�$�'�D��� �L�E��}��� �!H�I�I��K�K�M�E��}� �!7��?�?��/�/�%��=�D�K�!��r )r!r�r�rr)rrNr�)NNr#)rrrrrrUr�r�rrar\rSr�r8r�rr:rGrLrrr r!rvrv�	s���=���2�
�1�*��j�j�	#��G��D��D�&�����
��
����r rvc��Sn[X5n[[U5S5nURS5u pE[	UR55=(d S$)zx
Given an iterable of lines from a Metadata file, return
the value of the Version field, if present, or None otherwise.
c�@�UR5RS5$)Nzversion:)r�r)r�s r!�is_version_line�+_version_from_file.<locals>.is_version_line:
s���z�z�|�&�&�z�2�2r r�r$N)r�r�r��	partitionrr_)rDrP�
version_linesr�r�r�s      r!�_version_from_filerT4
sL��3��?�2�M���]�#�R�(�D��.�.��%�K�A�q�����
�&�.�$�.r c�^�\rSrSrSrSrSSSS\S\4Sjr\	S,Sj5r
Sr\S5r
S	rS
rSrSrS
rSrSr\S5r\S5r\S5r\S5r\S5r\S5rSrS-SjrSrSrSr S.Sjr!Sr"Sr#Sr$Sr%U4S jr&\	S,S!j5r'S"r(S#r)S,S$jr*S%r+S.S&jr,S'r-S(r.S)r/\S*5r0S+r1U=r2$)/rtiC
z5Wrap an actual or potential sys.path entry w/metadatarwNc��[U=(d S5UlUb[U5UlXPlX`lXlXplU=(d [Ul	g)N�Unknown)
r~r�r�_versionr�rTr�r�r��	_provider)r�r�r}r�r�r�rTr�s        r!rU�Distribution.__init__H
sH��&�l�&?�i�@�����(��1�D�M�$�� �
� �
�$��!�3�^��r c�@�S/S-upVpx[RRU5up)U	R5[;a@[U	R5n[U5n
U
(aU
R
SSSS5upVpxU"UU4UUUUS.UD6R5$)Nr�r�ver�pyverrY)r�r�r�rT)r�r��splitextr��_distributionImpl�EGG_NAMErW�_reload_version)r\r�r�r}r*r�r�r�rT�extrRs           r!r��Distribution.from_location[
s���7;�f�q�j�3��z����(�(��2�
���9�9�;�+�+�#�C�I�I�K�0�C��X�&�E��>C�k�k��E�7�F�?�;��z����
�&��!��

��
��/�
�	r c��U$r#rr�s r!ra�Distribution._reload_versionq
s���r c��URURURURUR=(d SUR
=(d S4$r)�_forgiving_parsed_versionr�r@r�r�rTr�s r!r��Distribution.hashcmpt
sD��
�*�*��O�O��H�H��M�M��O�O�!�r��M�M��R�

�	
r c�,�[UR5$r#)�hashr�r�s r!�__hash__�Distribution.__hash__
s���D�L�L�!�!r c�4�URUR:$r#�r��r�r�s  r!�__lt__�Distribution.__lt__�
����|�|�e�m�m�+�+r c�4�URUR:*$r#rnros  r!�__le__�Distribution.__le__�
����|�|�u�}�}�,�,r c�4�URUR:�$r#rnros  r!�__gt__�Distribution.__gt__�
rrr c�4�URUR:�$r#rnros  r!�__ge__�Distribution.__ge__�
rvr c�j�[XR5(dgURUR:H$r)r�r�r�ros  r!�__eq__�Distribution.__eq__�
s'���%���0�0���|�|�u�}�}�,�,r c��X:X+$r#rros  r!�__ne__�Distribution.__ne__�
���� � r c��UR$![a& URR5=UlnUs$f=fr#)�_keyrar�r�r�s  r!r@�Distribution.key�
s@��	��9�9����	�"�/�/�5�5�7�7�D�I���J�	�s��->�>c��[US5(d'[UR5UlUR$UR$![RR
afnSURS3n[US5(aURU5 e[RR[U5SU35SeSnAff=f)N�_parsed_versionz
(package: �)�add_noter�)	r�r}r�r�rrWr�r�r�)r��ex�infos   r!�parsed_version�Distribution.parsed_version�
s����t�.�/�/�
V�'4�T�\�\�'B��$��#�#�#�t�#�#�#���$�$�3�3�
V�#�D�$5�$5�#6�a�8���2�z�*�*��K�K��%���'�'�6�6�#�b�'��!�D�6�7J�K�QU�U��
V�s�A�C	�#A!C�C	c
��UR$![RRa�n[	[UR55UlSR[US/55nS[U5SUSURSURS3	n[R"U[5 URsSnA$SnAff=f)Nr��	__notes__zg!!


            *************************************************************************
            zl

            This is a long overdue deprecation.
            For the time being, `pkg_resources` will use `z�`
            as a replacement to avoid breaking existing environments,
            but no future compatibility is guaranteed.

            If you maintain package z� you should implement
            the relevant changes to adequate the project to PEP 440 immediately.
            *************************************************************************
            

!!
            )r�rr�rWr}rbr�rUr�r�r�r7r8r�)r�r��notesr;s    r!rg�&Distribution._forgiving_parsed_version�
s���	(��&�&�&��� � �/�/�	(�#0�1C�D�L�L�1Q�#R�D� ��I�I�g�b�+�r�:�;�E�
�
��W�I�R��w�;�<@�;O�;O�:P�Q%�&*�%6�%6�$7�8
�
�C�
�M�M�#�1�2��'�'�'��)	(�s��C�BC�=C�Cc��UR$![abnUR5nUcCURUR5nSRURU5n[
X@5UeUsSnA$SnAff=f)Nz4Missing 'Version:' header and/or {} file at path: {})rXra�_get_version�_get_metadata_path_for_display�PKG_INFOr�rX)r�rkr�r�r;s     r!r��Distribution.version�
su��	��=�=� ���		��'�'�)�G����:�:�4�=�=�I��M�U�U��M�M�4���!��+��2��N��		�s��
A:�AA5�/A:�5A:c��UR$![a2 URUR55UlUR$f=f)zf
A map of extra to its list of (direct) requirements
for this distribution, including the null extra.
)�_Distribution__dep_mapra�_filter_extras�_build_dep_mapr�s r!�_dep_map�Distribution._dep_map�
sH��	H��>�>�!���	H�!�0�0��1D�1D�1F�G�D�N��~�~��	H�s��.A
�	A
c�^�[[SU55H�nUnURU5nURS5up$nU=(a" [	U5=(d [U5(+nU(a/n[
U5=(d SnURU/5RU5 M� U$)z�
Given a mapping of extras to dependencies, strip off
environment markers and filter out any dependencies
not matching the markers.
Nr$)	r�r�r�rRr�r�r�rhr�)�dmr��	new_extrardr�r��fails_markers       r!r��Distribution._filter_extras�
s����&��r�*�+�E��I��6�6�%�=�D�#(�?�?�3�#7� �I�&�!���v�&�E�o�f�.E�*E�
����"�9�-�5��I��M�M�)�R�(�/�/��5�,��	r c��0nSHPn[URU55H/up4URU/5R[	U55 M1 MR U$)N)zrequires.txtzdepends.txt)r��
_get_metadatarhr�r|)r�r�rr�rds     r!r��Distribution._build_dep_map�
sT��
��1�D�-�d�.@�.@��.F�G����
�
�e�R�(�/�/�0B�4�0H�I� H�2��	r c��URn/nURURSS55 UH!nURU[U55 M# U$![an[U<SU<35UeSnAff=f)z@List of Requirements needed for this distro if `extras` are usedNrz has no such extra feature )r�r�r�r�r�rz)r�r�r��depsrbrks      r!rz�Distribution.requiress|��
�]�]�������B�F�F�4��$�%��C�
����B�z�#��/�0�����	�
�"�9=�s�C�����
�s�A�
A;�#A6�6A;c�^�URRU5nU$![a gf=f)z;
Return the path to the given metadata file, if available.
z[could not detect])rYr�r'r�s   r!r��+Distribution._get_metadata_path_for_displays8��		(��>�>�4�4�T�:�D�����	(�'�	(�s��
,�,c#�p# �URU5(aURU5Shv�N ggN7fr#)r%r,r�s  r!r��Distribution._get_metadata!s2������T�"�"��.�.�t�4�4�4�#�4�s�+6�4�6c�R�URUR5n[U5nU$r#)r�r�rT)r�rDr�s   r!r��Distribution._get_version%s%���"�"�4�=�=�1��$�U�+���r c��Uc[RnURXS9 U[RLaO[UR5 URS5H$nU[R;dM[U5 M& gg)z>Ensure distribution is importable on `path` (default=sys.path)Nr��namespace_packages.txt)rSr�r�r�r�r�r�rj)r�r�r�pkgs    r!�activate�Distribution.activate+sf���<��8�8�D����t��-��3�8�8��$�T�]�]�3��)�)�*B�C���#�+�+�%�%�c�*�D�r c���[UR5<S[UR5<SUR=(d [<3nUR
(aUSUR
--
nU$)z@Return what this distribution's standard .egg filename should berOz-py)r�r�r�r�rrT)r�rAs  r!r��Distribution.egg_name6sU��
��)�)�*�����%��O�O�'�x�'�
���=�=���d�m�m�+�+�H��r c�b�UR(aU<SUR<S3$[U5$)Nz (r�)r�r�r�s r!r��Distribution.__repr__Bs"���=�=� $�d�m�m�4�4��t�9�r c�~�[USS5nU=(d SnUR<SU<3$![a SnN,f=f)Nr�z[unknown version]r�)r�rXr�)r�r�s  r!r��Distribution.__str__HsI��	��d�I�t�4�G��0�0���+�+�W�5�5���	��G�	�s�
-�<�<c�p�URS5(a[U5e[URU5$)zADelegate all unrecognized public attributes to .metadata providerr�)rrar�rY)r�r7s  r!�__getattr__�Distribution.__getattr__Ps-���?�?�3��� ��&�&��t�~�~�t�,�,r c�>�[[[[U]55[SUR
R	555-5$)Nc3�T# �UHoRS5(aMUv� M  g7f�r�N)r)rtr7s  r!ru�'Distribution.__dir__.<locals>.<genexpr>Ys���X�#;�4�?�?�SV�CW�$�$�#;�s�(�	()r�r�r�rt�__dir__rY)r�r�s �r!r��Distribution.__dir__VsC������l�D�1�3�4��X�4�>�>�#9�#9�#;�X�X�
Y�
�	
r c�x�UR"[U5[RR	U5U40UD6$r#)r�r�r�r�r�)r\rAr}r*s    r!r��Distribution.from_filename\s8��� � ��h�'����)9�)9�(�)C�X�
�QS�
�	
r c��[UR[RR5(aUR
<SUR<3nOUR
<SUR<3n[RU5$)z?Return a ``Requirement`` that matches this distribution exactlyz==z===)r�r�rr�rVr�rur)r�r�s  r!r��Distribution.as_requirementbs^���d�)�)�9�+<�+<�+D�+D�E�E�#�0�0�$�2E�2E�F�D� $� 1� 1�4�3F�3F�G�D�� � ��&�&r c�l�URX5nUc[SX4<S35eUR5$)z=Return the `name` entry point of `group` or raise ImportErrorzEntry point z
 not found)rbrZr)r�rWrrFs    r!r`�Distribution.load_entry_pointks3��
�
 �
 ��
-��
�:��U�M�K�L�L��w�w�y�r c��URnUbURU05$U$![a. [RUR	S5U5=o lNNf=f)rzentry_points.txt)�_ep_maprarvrLr�r�)r�rW�ep_maps   r!ra�Distribution.get_entry_maprsg��	��\�\�F�
���:�:�e�R�(�(��
��
�	�$.�$8�$8��"�"�#5�6��%�
�F�\�	�s�%�5A�Ac�B�URU5RU5$r!)rar�rws   r!rb�Distribution.get_entry_info~s���!�!�%�(�,�,�T�2�2r c��U=(d URnU(dg[U5n[RR	U5nUVs/sHof=(a [U5=(d UPM! nn[U5H�uphX�:XaU(a O� gX�:XdMUR[:XdM2U(d
XGUS;a gU[RLaUR5 URXb5 URXd5  OQ U[RLaUR5 U(aURSU5 gURU5 gURXFS-5n	Xy	X	U	nMs snf![a gf=f)adEnsure 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.
Nrr�)r�r�r�r�rs�	enumerater�r�rS�check_version_conflictr�r�r�rX)
r�r��locr�nloc�bdirr��npathr~�nps
          r!r��Distribution.insert_on�sb��(�"�T�]�]���� ��%���w�w���t�$��<@�A�D�q�,�)�!�,�1��1�D��A� ��'�G�A��|������$�/�/�X�"=� �T�1�2�Y�%6���3�8�8�#��/�/�1����A�#����Q�%��#(�&�s�x�x���+�+�-�����A�s�#�
����C� ���
��[�[��1�u�-���I�t�x�����=B��B�
��	�
�s�&E8�E=�=
F
�	F
c
�2�URS:Xag[RURS55n[	UR
5nURS5H�nU[R;dX1;d
U[;aM(US;aM0[[RUSS5nU(aA[	U5RU5(d URUR
5(aM�[SU<SU<SUR
<S	35 M� g)
N�
setuptoolsr�z
top_level.txt)�
pkg_resourcesr��siterrzModule z was already imported from z, but z is being added to sys.path)r@r'r(r�r�r�rSr�r�r�rr�)r��nspr��modname�fns     r!r��#Distribution.check_version_conflict�s����8�8�|�#���m�m�D�.�.�/G�H�I���T�]�]�+���)�)�/�:�G��s�{�{�*��>��1�1���A�A������W�-�z�4�@�B���r�"�-�-�c�2�2�b�m�m�D�M�M�6R�6R���")�2�t�}�}�>�
�;r c��UR g![a [S[U5-5 g[a gf=f)NzUnbuilt egg for FT)r�rXr�r��SystemErrorr�s r!r��Distribution.has_version�sD��	��L�L���
�	��,�t�D�z�9�:���	��	�s��!>�	>�>c	���SnUR5HnURU[XS55 M! URSUR5 UR"S0UD6$)z@Copy this distribution, substituting in any changed keyword argsz<project_name version py_version platform location precedenceNr}r)r
rhr�rYr�)r�r*r*r7s    r!�clone�Distribution.clone�sP��N���K�K�M�D��M�M�$���D� 9�:�"�
�
�
�j�$�.�.�1��~�~�#��#�#r c�V�URVs/sH
o(dMUPM sn$s snfr#)r�)r��deps  r!r��Distribution.extras�s ��#�}�}�4�}����}�4�4��4s�
&�&)�	__dep_mapr�r�r�rYrXr�rTr�r�r�r#rJr)3rrrrrr�rr�rUr�r�rar�r�rkrprtrxr{r~r�r@r�rgr�r�rLr�r�rzr�r�r�r�r�r�r�r�r�r�r�r`rarbr�r�r�r�r�rr�r�s@r!rtrtC
sx���?��H��������4�&����*��
��
�"�,�-�,�-�-�!������$��$��(��(�2�����	��	�����(���"5��	+�
��6�-�
��
��
�
'��
�3�
B�H�4	�$��5��5r rtc��\rSrSrSrSrg)�EggInfoDistributioni�c�@�UR5nU(aXlU$)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.
)r�rX)r��
md_versions  r!ra�#EggInfoDistribution._reload_version�s���&�&�(�
��&�M��r )rXN)rrrrrarrr r!r�r��s��r r�c�f�\rSrSrSrSr\R"S5r\	S5r
\	S5rSrSr
g	)
�DistInfoDistributionizJ
Wrap an actual or potential sys.path entry
w/metadata, .dist-info style.
�METADATAz([\(,])\s*(\d.*?)\s*([,\)])c���UR$![a\ URUR5n[R
R
5RU5UlURs$f=f)zParse and cache metadata)�	_pkg_inforar)r��email�parser�Parser�parsestr)r�r}s  r!�_parsed_pkg_info�%DistInfoDistribution._parsed_pkg_infos]��	"��>�>�!���	"��(�(����7�H�"�\�\�0�0�2�;�;�H�E�D�N��>�>�!�	"�s��A#A4�3A4c�~�UR$![a$ UR5UlURs$f=fr#)�_DistInfoDistribution__dep_mapra�_compute_dependenciesr�s r!r��DistInfoDistribution._dep_maps:��	"��>�>�!���	"�!�7�7�9�D�N��>�>�!�	"�s��+<�<c�^�S/0=ol/mURRS5=(d /HnTR[	U55 M U4Sjn[
R"[RU"S555nUSRU5 URRS5=(d /H>n[UR55nU"U5Vs/sHowU;dM
UPM snX'M@ U$s snf)z+Recompute this distribution's dependencies.Nz
Requires-Distc3�># �TH<nUR(a$URRSU05(dM8Uv� M> g7f)Nr�r�)r�r�rds  �r!�reqs_for_extra�BDistInfoDistribution._compute_dependencies.<locals>.reqs_for_extra0s5�������z�z�S�Z�Z�%8�%8�'�5�9I�%J�%J��I��s
�7A�	AzProvides-Extra)r�r��get_allr�r|r��MappingProxyTyper'r(r�r_)	r�r�r�r�commonr��s_extra�rrds	        @r!r��*DistInfoDistribution._compute_dependencies's����#�R�j�(��^����(�(�0�0��A�G�R�G�C��K�K�*�3�/�0�H�	�
�'�'��
�
�n�T�6J�(K�L��
�4�������*�*�2�2�3C�D�J��J�E� �����/�G�&4�U�&;�O�&;����1�&;�O�B�K�K��	��Ps�&	D�3D)r�r�N)rrrrrr�rSr��EQEQr�r�r�r�rrr r!r�r�sH���
�H�
�:�:�4�5�D�
�"��"��"��"�r r�)rr�r�c��Sn[5n[R"U5RULa*US-
n[R"U5RULaM*[
R"USUS-0UD6 g![a N(f=f)Nr�r)r$rSrrrXr7r8)rIr*r0r1s    r!r�r�Fs~��
�E��	�A�
��m�m�E�"�,�,��1��Q�J�E��m�m�E�"�,�,��1�
�M�M��4�U�Q�Y�4��4���
��
�s�AA7�7
B�Bc�b�[[[[[[	U5555$)z�
Yield ``Requirement`` objects for each specification in `strs`.

`strs` must be a string, or a (possibly-nested) iterable thereof.
)r�rur
rr)�strss r!r|r|Ss#���{�-�c�,��D�@Q�.R�S�T�Tr c��\rSrSrSrSrg)�RequirementParseErrori\z,Compatibility wrapper for InvalidRequirementrNrrr r!r
r
\s��2r r
c�V^�\rSrSrU4SjrSrSrSrSrSr	\
S5rS	rU=r
$)
rui`c�r>�[[U]U5 URUl[UR5nX"R
5sUlUlURVs/sHo3RUR4PM snUl[[[UR 55UlURUR"UR[%UR 5UR&(a[)UR&5OS4Ul[-UR*5Ulgs snf)z>DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!N)r�rurUr�unsafe_namer~r�r�r@�	specifierr�r�r@r r�r�r��url�	frozensetr�r��hashCmprj�_Requirement__hash)r��requirement_stringr�r�r�s    �r!rU�Requirement.__init__as����
�k�4�)�*<�=��9�9��� ����+��&2�4F�4F�4H�#���4�8�@D���O���}�}�d�l�l�3��O��
��C�
�D�K�K�8�9����H�H��H�H��N�N��d�k�k�"� $���C������
����4�<�<�(����Ps�%!D4c�b�[U[5=(a URUR:H$r#)r�rurros  r!r~�Requirement.__eq__rs!���%��-�O�$�,�,�%�-�-�2O�Or c��X:X+$r#rros  r!r��Requirement.__ne__ur�r c��[U[5(a'URUR:wagURnURRUSS9$)NFT)�prereleases)r�rtr@r�r�contains)r�r~s  r!rl�Requirement.__contains__xsG���d�L�)�)��x�x�4�8�8�#���<�<�D�
�~�~�&�&�t��&�>�>r c��UR$r#)rr�s r!rk�Requirement.__hash__�s���{�{�r c��S[U5-$)NzRequirement.parse(%r)r)r�s r!r��Requirement.__repr__�s��&��T��2�2r c� �[U5unU$r#)r|)r&r�s  r!r�Requirement.parse�s��#�A�&����
r )�__hashr�rr@r�r@r)rrrrrUr~r�rlrkr�rLrrr�r�s@r!ruru`s6���)�"P�!�
?��3����r ruc�.�[U;a
U[4-$U$)z>
Ensure object appears in the mro even
for old-style classes.
)�object)�classess r!�_always_objectr*�s��
�W���&��"�"��Nr c��[[R"[US[	U5555nUHnX0;dM
Xs $ g)z2Return an adapter factory for `ob` from `registry`r�N)r*�inspect�getmror�r�)�registryrAr��ts    r!r�r��s9���7�>�>�'�"�k�4��8�*L�M�N�E�
���=��;��r c�l�[RRU5n[R"USS9 g)z1Ensure that the parent directory of `path` existsT)�exist_okN)r�r�rs�makedirs)r�rss  r!r�r��s"���g�g�o�o�d�#�G��K�K��$�'r c���[(d[S5e[U5upU(a2U(a*[U5(d[	U5 [US5 gggg![a gf=f)z/Sandbox-bypassing version of ensure_directory()z*"os.mkdir" not supported on this platform.i�N)rJrKr
r	r&r�FileExistsError)r�rsrAs   r!r&r&�s`���=��B�C�C��d���G��8�E�'�N�N� ��)�	��'�5�!�%3�8�w���	��	�s�A�
A+�*A+c#�(# �Sn/n[U5HvnURS5(aLURS5(a*U(dU(aX4v� USSR5n/nMY[	SU5eURU5 Mx X4v� g7f)a_Split 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�[�]r�r�zInvalid section heading)rrr�r_rXr�)r&�section�contentr�s    r!r�r��s�����G��G��A����?�?�3����}�}�S�!�!��g�!�*�*��q��*�*�*�,���� �!:�D�A�A��N�N�4� ���
��s�BBc��[Rn[[l[R"U0UD6U[l$!U[lf=fr#)r�r�os_open�tempfile�mkstemp)rIr*�old_opens   r!rMrM�s;���w�w�H���������,��,�����(���s�$A�
Ar�)�categoryr�c��U"U0UD6 U$r#r)rZrIr,s   r!�_call_asiderA�s���t��v���Hr c�l^�[5mTUS'URU4Sj[T555 g)z=Set up global resource manager (deliberately not state-saved)�_managerc3�p># �UH+nURS5(aMU[TU54v� M- g7fr�)rr�)rtrr:s  �r!ru�_initialize.<locals>.<genexpr>�s2����
� �D����s�#�	'��w�w��%�&� �s�6�6N)rsr%rH)r1r:s @r!�_initializerF�s3�����G��A�j�M��H�H�
���L�
�r c��\rSrSrSrSrg)r�i�z�
Base class for warning about deprecations in ``pkg_resources``

This class is not derived from ``DeprecationWarning``, and as such is
visible by default.
rNrrr r!r�r��s��r r�c��[R5n[SUS9 URnURnUR
nURnUn[SU55 U"SSS9 /Ul[[UR[R55 [5R[!55 g)a%
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.
r()rkc3�># �UHoRSS9v� M g7f)Fr�N�r�)rtr�s  r!ru�1_initialize_master_working_set.<locals>.<genexpr>
s���	?�;�4�-�-��-�
&�;�s�c� �URSS9$)NTr�rJrs r!rJ�0_initialize_master_working_set.<locals>.<lambda>
s��T�]�]�4�]�0r F)r�N)rrr^r+r\rcr�r]r rNr�r�rSrSr�r$r%r�)rkr\rcrlr]r�s      r!�_initialize_master_working_setrN�s����*�*�,�K��8��5��!�!�G�#�5�5��)�3�3���'�'�J��H�

�	?�;�	?�?��0����K����[�
"�
"�C�H�H�	-�.��I���V�X�r r#rK)�rrSr�r{r@rSr�rr�r7r3r1�pkgutilr�rTr�r��email.parserr�r�r<rr,r�r�r�rr�rZ�impr4�	NameErrorrKrrrrrJrr;�os.pathr	r
�importlib.machinery�	machineryr�r� pkg_resources.extern.jaraco.textrrr
�pkg_resources.externrrr��version_info�RuntimeErrorr\rkrl�resources_streamro�resource_dirrernrirdrcrgrfrhr�r�r�r8r�r��Ir[�RuntimeWarningrr�rVr}r&r+r4r7r<rBrDrF�
_sget_none�
_sset_noner[�__all__r'rwrxr�ryrzr�r�rr�r�r�r�r�r�r^rVr�rPrQrr�r�r]r�r_r`rarbr�r�rrr'r�rqr�r{rsrpr~rrbr^r�r�r�r�r�r(r�r�r�r�r�r�rrr�r�r�r�r�r�rmr�r�r�r�r�r�r�r�r�r�r��
FileFinderr�r�r�rjr�rr	r�r
r�r�rr�r�rRr�VERBOSE�
IGNORECASEr`rvrTrtr�r�r_r�r|r��InvalidRequirementr
rur*r�r�r&r�rM�filterwarningsrAr$rF�Warningr�rNrr r!�<module>rgs����&�	�	��	�����������������
��� ���
��
��(�(��M�
� ��5�� � ���.�*�
�3�4�
�6�7�
�8�9�
�3�4�
�1�2����f��
�8�
9�9�����������������������������������	�
�
�B���	��:�:�M�r�t�t�T���N���!�!�)�)�
���3�
����
��-�,�
�Z��0S��l9�i�9�0�o�0�@
��
��?��:I�?�I����>�>�3�+�+�,���������
���8�
>��
� N��2�Z�Z� ;�<���j�j�!C�D��!��.�b6����@�
7�
>�
L�L�.N�)�N�8X&�X&�v2��2�(M�M�b%��
�l�
� n�n�d�/�	6�"�2@�9�"��$�@
�@
�F�V�\�*�&��,��(2�k�2�<����
�L�
�"����4��6#�<�#�*aM�+�aM�H�Y�*�*�K�8�&4�=�&4�R!�?�!�2�+���v�R�0�?�-�J�4�	�%�%�'7�8�����%�%�(�&
�
� 
� �$�
!��7�M�"�"��G�'�'��6��#�.�.��=��v�2�.��v�2�.�;�$"�J#�D(�V	�
��7�M�"�"��w�2�2�O�D��9�0�0�/�B��.�9�9�?�K���6�?�3�Y�
O�(*��7���E�
���O�	$�	*�	*��
�:�:���J�J�������%�	�A�A�H/�s5�s5�l
�,��&0�<�0�h
�$�&���
5�U�3�I�2�2�E�E�3�-�)�(�(�4�4�-�`��(�
��4�	����=��F�
�

��)��
���W��
�!�
�!��[f��������O������M��������sH�*U<�/V
�8V�V+�<
V
�	V
�
V�V�V(�'V(�+V7�6V7
Back to Directory File Manager