ó
    ¯ii;  ã                  óÂ  • S r SSKJr  SSKrSSKrSSKrSSKrSSKJrJ	r	  SSK
Jr  SSKJr  SSKJr  \R"                  " \R$                  5      r\S-  r/ r\R,                   H@  r\R"                  " \5      r \R1                  \R3                  \R$                  5      5        MB     \R7                  S	 S
S9   " S S5      r\R:                  r\R>                  r  " S S\5      rSSS jjr!S r"SSS jjr#SS S jjr$\RJ                  (       a  \RL                  " SS5      r'O\RL                  " S5      r'S!S"S jjr(S#S jr)S r*\*" 5       r+S r,\," 5       r-g! \ a     Mû  f = f)$að  
Additional helper methods for working specifically with Anaconda distributions are found at
:mod:`PyInstaller.utils.hooks.conda_support<PyInstaller.utils.hooks.conda>`
which is designed to mimic (albeit loosely) the `importlib.metadata`_ package. These functions find and parse the
distribution metadata from json files located in the ``conda-meta`` directory.

.. versionadded:: 4.2.0

This module is available only if run inside a Conda environment. Usage of this module should therefore be wrapped in
a conditional clause::

    from PyInstaller.compat import is_pure_conda

    if is_pure_conda:
        from PyInstaller.utils.hooks import conda_support

        # Code goes here. e.g.
        binaries = conda_support.collect_dynamic_libs("numpy")
        ...

Packages are all referenced by the *distribution name* you use to install it, rather than the *package name* you import
it with. I.e., use ``distribution("pillow")`` instead of ``distribution("PIL")`` or use ``package_distribution("PIL")``.
é    )ÚannotationsN)ÚIterableÚList)ÚPackagePath)Úcompat)Úloggerz
conda-metac                ó,   • [        U R                  5      $ ©N)ÚlenÚparts)Úps    ÚJC:\des-py\RoboSAPF\venv\Lib\site-packages\PyInstaller/utils/hooks/conda.pyÚ<lambda>r   >   s   € ¤s¨1¯7©7¤|ó    T)ÚkeyÚreversec                  ó\   • \ rS rSrSrSS jrS rS rS r\	SS j5       r
\	SS j5       rS	rg
)ÚDistributionéA   ao  
A bucket class representation of a Conda distribution.

This bucket exports the following attributes:

:ivar name: The distribution's name.
:ivar version: Its version.
:ivar files: All filenames as :meth:`PackagePath`\ s included with this distribution.
:ivar dependencies: Names of other distributions that this distribution depends on (with version constraints
                    removed).
:ivar packages: Names of importable packages included in this distribution.

This class is not intended to be constructed directly by users. Rather use :meth:`distribution` or
:meth:`package_distribution` to provide one for you.
c                ó^  •  [         R                  " U5      U l        U R                  R                  5       (       d   e [        R                  " U R                  R                  5       5      U l        U R                  S   U l        U R                  S   U l        U R                  S    Vs/ s H  n[        U5      PM     snU l        U R!                  5       U l        U R%                  5       U l        g ! [        [
        4 a$    [	        SR                  [        U5      5      5      ef = fs  snf )Nz_Distribution requires a path to a conda-meta json. Perhaps you want `distribution({})` instead?ÚnameÚversionÚfiles)ÚpathlibÚPathÚ
_json_pathÚexistsÚ	TypeErrorÚAssertionErrorÚformatÚreprÚjsonÚloadsÚ	read_textÚrawr   r   r   r   Ú_init_dependenciesÚdependenciesÚ_init_package_namesÚpackages)ÚselfÚ	json_pathÚis      r   Ú__init__ÚDistribution.__init__Q   sò   € ð	Ü%Ÿlšl¨9Ó5ˆDŒOØ—?‘?×)Ñ)×+Ñ+Ð+Ñ+ô Ÿš D§O¡O×$=Ñ$=Ó$?Ó@ˆŒð Ÿ™ &Ñ)ˆŒ	Ø ŸH™H YÑ/ˆŒØ.2¯h©h°wÒ.?Ó@Ò.?¨”k !–nÑ.?Ñ@ˆŒ
Ø ×3Ñ3Ó5ˆÔØ×0Ñ0Ó2ˆ�øô œ>Ð*ó 	Üð.ß.4©f´T¸)³_Ó.Eóð ð	üò As   ‚<C3 Â+D*Ã34D'c                óv   • SR                  [        U 5      R                  U R                  U R                  5      $ )Nz{}(name="{}", packages={}))r    ÚtypeÚ__name__r   r)   ©r*   s    r   Ú__repr__ÚDistribution.__repr__e   s,   € Ø-×4Ñ4´T¸$³Z×5HÑ5HÈ$Ï)É)ÐUY×UbÑUbÓcÐcr   c                óx   • / nU R                   S    H$  nUR                  SS9tp4UR                  U5        M&     U$ )zÓ
Read dependencies from ``self.raw["depends"]``.

:return: Dependent distribution names.
:rtype: list

The names in ``self.raw["depends"]`` come with extra version constraint information which must be stripped.
Údependsé   )Úmaxsplit)r%   ÚsplitÚappend)r*   r'   Ú
dependencyr   Úversion_constraintss        r   r&   ÚDistribution._init_dependenciesh   sH   € ð ˆàŸ(™( 9Ô-ˆJà)3×)9Ñ)9À1Ð)9Ð)EÐ&ˆDØ×Ñ Ö%ñ .ð Ðr   c                ór   • / nU R                    H$  n[        U5      nUc  M  UR                  U5        M&     U$ )z¸
Search ``self.files`` for package names shipped by this distribution.

:return: Package names.
:rtype: list

These are names you would ``import`` rather than names you would install.
)r   Ú_get_package_namer:   )r*   r)   ÚfileÚpackages       r   r(   Ú Distribution._init_package_namesy   s:   € ð ˆØ—J”JˆDÜ'¨Ó-ˆGØÓ"Ø—‘ Ö(ñ ð ˆr   c                ó\   • U[         ;   a	  [         U   $ [        SR                  U5      5      e)zŽ
Get distribution information for a given distribution **name** (i.e., something you would ``conda install``).

:rtype: :class:`Distribution`
zIDistribution {} is either not installed or was not installed using Conda.)ÚdistributionsÚModuleNotFoundErrorr    ©Úclsr   s     r   Ú	from_nameÚDistribution.from_name‰   s3   € ð ”=Ó Ü  Ñ&Ð&Ü!ØW×^Ñ^Ð_cÓdó
ð 	
r   c                ó\   • U[         ;   a	  [         U   $ [        SR                  U5      5      e)a|  
Get distribution information for a **package** (i.e., something you would import).

:rtype: :class:`Distribution`

For example, the package ``pkg_resources`` belongs to the distribution ``setuptools``, which contains three
packages.

>>> package_distribution("pkg_resources")
Distribution(name="setuptools",
             packages=['easy_install', 'pkg_resources', 'setuptools'])
zDPackage {} is either not installed or was not installed using Conda.)Údistributions_by_packagerE   r    rF   s     r   Úfrom_package_nameÚDistribution.from_package_name–   s0   € ð Ô+Ó+Ü+¨DÑ1Ð1Ü!Ð"h×"oÑ"oÐptÓ"uÓvÐvr   )r   r'   r   r   r)   r%   r   N)r+   Ústr)r   rN   )r1   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r-   r3   r&   r(   ÚclassmethodrH   rL   Ú__static_attributes__© r   r   r   r   A   sF   † ñô3ò(dòò"ð  ó

ó ð

ð ówó ówr   r   c                  ó   • \ rS rSrSrS rSrg)r   é­   zç
A filename relative to Conda's root (``sys.prefix``).

This class inherits from :class:`pathlib.PurePosixPath` even on non-Posix OSs. To convert to a :class:`pathlib.Path`
pointing to the real file, use the :meth:`locate` method.
c                óP   • [         R                  " [        R                  5      U -  $ )zO
Return a path-like object for this path pointing to the file's true location.
)r   r   ÚsysÚprefixr2   s    r   ÚlocateÚPackagePath.locate´   s   € ô �|Š|œCŸJ™JÓ'¨$Ñ.Ð.r   rU   N)r1   rO   rP   rQ   rR   r[   rT   rU   r   r   r   r   ­   s   † ñõ/r   r   c                ó®  • Ub  [        U5      nSSKJn  0 nU" U /5      nU(       a†  UR                  5       n [        R                  U5      =X5'   n[        R                  " SXP5        UR                   H,  nXs;   a  M
  Xu:X  a  M  Ub  Xq;   a  M  UR                  U5        M.     U(       a  M†  U$ ! [         a    [        R                  " SXP5         M³  f = f)ai  
Collect a :class:`Distribution` and all direct and indirect dependencies of that distribution.

Arguments:
    initial:
        Distribution name to collect from.
    excludes:
        Distributions to exclude.
Returns:
    A ``{name: distribution}`` mapping where ``distribution`` is the output of
    :func:`conda_support.distribution(name) <distribution>`.
r   )Údequez8Collected Conda distribution '%s', a dependency of '%s'.z‰Conda distribution '%s', dependency of '%s', was not found. If you installed this distribution with pip then you may ignore this warning.)ÚsetÚcollectionsr^   Úpopr   rH   r   ÚdebugrE   Úwarningr'   r:   )ÚinitialÚexcludesr^   ÚdoneÚnames_to_dor   ÚdistributionÚ_names           r   Úwalk_dependency_treerj   »   sÝ   € ð ÑÜ�x“=ˆõ "Ø€DÙ˜˜	Ó"€Kæ
à�‰Ó ˆð		ä(4×(>Ñ(>¸tÓ(DÐDˆD‰J˜Ü�LŠLÐSÐUYÔcð "×.Ô.ˆEØ‹}áØ‹}ñ ØÑ#¨Ó(9áØ×Ñ˜uÖ%ñ /÷ ˆ+ð4 €Køô' #ó 	Ü�NŠNð`Øaeôò ð	ús   ¸0B/ Â/!CÃCc                ón   • U(       a  [        X5      R                  5       $ [        R                  U 5      /$ r
   )rj   Úvaluesr   rH   )r   r'   re   s      r   Ú_iter_distributionsrm   í   s-   € ÞÜ# DÓ3×:Ñ:Ó<Ð<ä×&Ñ& tÓ,Ð-Ð-r   c                ój   • U(       a  [        U 5      R                  $ [        U 5      R                  S   $ )zß
List requirements of a distribution.

Arguments:
    name:
        The name of the distribution.
    strip_versions:
        List only their names, not their version constraints.
Returns:
    A list of distribution names.
r6   )rh   r'   r%   )r   Ústrip_versionss     r   Úrequiresrp   ô   s.   € ö Ü˜DÓ!×.Ñ.Ð.Ü˜Ó×!Ñ! )Ñ,Ð,r   c                óp   • [        XU5       VVs/ s H  o3R                    H  oDPM     M     snn$ s  snnf )a¥  
List all files belonging to a distribution.

Arguments:
    name:
        The name of the distribution.
    dependencies:
        Recursively collect files of dependencies too.
    excludes:
        Distributions to ignore if **dependencies** is true.
Returns:
    All filenames belonging to the given distribution.

With ``dependencies=False``, this is just a shortcut for::

    conda_support.distribution(name).files
)rm   r   )r   r'   re   Údistr@   s        r   r   r     s3   € ô$ 1°ÀXÔNÔfÒN�T×[eÕ[eÐSWŠDÑ[e‰DÑNÒfÐfùÓfs   �2ÚLibraryÚbinÚlibc           	     óz  • Sn/ n[        XU5       H¡  n[        R                  " U5      R                  [        :w  a  M-  UR                  5       nUR                  5       (       d  MT  [        U Vs/ s H  o‡R                  U5      PM     sn5      (       d  M…  UR                  [        U5      U45        M£     U$ s  snf )av  
Collect DLLs for distribution **name**.

Arguments:
    name:
        The distribution's project-name.
    dest:
        Target destination, defaults to ``'.'``.
    dependencies:
        Recursively collect libs for dependent distributions (recommended).
    excludes:
        Dependent distributions to skip, defaults to ``None``.
Returns:
    List of DLLs in PyInstaller's ``(source, dest)`` format.

This collects libraries only from Conda's shared ``lib`` (Unix) or ``Library/bin`` (Windows) folders. To collect
from inside a distribution's installation use the regular :func:`PyInstaller.utils.hooks.collect_dynamic_libs`.
)z*.dllz*.dylibz*.soz*.so.*)r   r   ÚPurePathÚparentÚlib_dirr[   Úis_fileÚanyÚmatchr:   rN   )	r   Údestr'   re   ÚDLL_SUFFIXESÚ_filesr@   Úresolved_fileÚsuffixs	            r   Úcollect_dynamic_libsr‚      s£   € ð& :€LØ€FÜ�d¨(Ö3ˆô ×Ò˜DÓ!×(Ñ(¬GÓ3ÙàŸ™›ˆØ×$Ñ$×&Ñ&Ùä¹lÓKºl°F×'Ñ'¨Ö/¹lÑK×LÑLÙà�‰”s˜=Ó)¨4Ð0Ö1ñ% 4ð& €Mùò	 Ls   Á.B8
c                óì  • [         R                  " U 5      n U R                  S:X  a+  U R                  [        R
                  ;   a  U R                  n OU R                  [        R
                  ;  a  g[         Hz  n[        U R                  5      [        UR                  5      S-   :w  a  M4  [        R                  " [        U R                  5      [        U5      5      (       d  Mn  U R                  s  $    g)aQ  
Determine the package name of a Python file in :data:`sys.path`.

Arguments:
    file:
        A Python filename relative to Conda root (sys.prefix).
Returns:
    Package name or None.

This function only considers single file packages e.g. ``foo.py`` or top level ``foo/__init__.py``\ s.
Anything else is ignored (returning ``None``).
r-   Nr7   )r   r   Ústemr�   r   ÚALL_SUFFIXESrx   ÚPYTHONPATH_PREFIXESr   r   ÚfnmatchrN   )r@   rZ   s     r   r?   r?   N  s¦   € ô �<Š<˜Ó€Dð
 ‡y�y�JÓ 4§;¡;´&×2EÑ2EÓ#EØ�{‰{‰Ø	�‰œF×/Ñ/Ó	/à÷
 &ˆÜˆt�z‰z‹?œc &§,¡,Ó/°!Ñ3Ó3áô �?Š?œ3˜tŸ{™{Ó+¬S°«[×9Ó9Ø—9‘9Òò &r   c                 ót   • 0 n [         R                  S5       H  n[        U5      nX UR                  '   M     U $ )Nz*.json)ÚCONDA_META_DIRÚglobr   r   )rD   Úpathrr   s      r   Ú_init_distributionsrŒ   ~  s:   € Ø€MÜ×#Ñ# HÖ-ˆÜ˜DÓ!ˆØ#'�d—i‘iÓ ñ .ð Ðr   c                 ón   • 0 n [         R                  5        H  nUR                   H  nXU'   M	     M     U $ r
   )rD   rl   r)   )rK   rh   rA   s      r   Ú_init_packagesrŽ   ‰  s;   € Ø!ÐÜ%×,Ñ,Ö.ˆØ#×,Ô,ˆGØ0< WÓ-ó -ñ /ð $Ð#r   r
   )rd   rN   re   úIterable[str] | None)F)r   rN   ro   ÚboolÚreturnz	List[str])FN)r   rN   r'   r�   re   zlist | Noner‘   zList[PackagePath])Ú.TN)r   rN   r}   rN   r'   r�   re   r�   )r@   r   ).rR   Ú
__future__r   r‡   r"   r   rY   Útypingr   r   Úimportlib.metadatar   Ú_PackagePathÚPyInstallerr   ÚPyInstaller.logr   r   rZ   Ú
CONDA_ROOTr‰   r†   r‹   Ú_pathr:   Úrelative_toÚ
ValueErrorÚsortr   rH   rh   rL   Úpackage_distributionrj   rm   rp   r   Úis_winrw   ry   r‚   r?   rŒ   rD   rŽ   rK   rU   r   r   Ú<module>r       sV  ðñõ. #ã Û Û Û 
ß !Ý :å Ý "ð �\Š\˜#Ÿ*™*Ó%€
Ø˜lÑ*€ð Ð Ø�XŒX€EØ�LŠL˜Ó€EðØ×"Ñ" 5×#4Ñ#4°S·Z±ZÓ#@ÖAñ ð × Ñ Ñ3¸TÐ Ñ B÷ewñ ewðP ×%Ñ%€Ø#×5Ñ5Ð ô/�,ô /ö/òd.ö-ö"gð* 
‡=‡=Ø×Ò˜y¨%Ó0�Gà×Ò˜uÓ%€Gö(ô\"ò`ñ $Ó%€ò$ñ *Ó+Ñ øðm
 ó Úðús   Á8*EÅEÅE