Ë
    
_ßd*$  ã                   óZ  — d Z ddlZddlZddlZddlZddlZddlm	Z	 ddl
mZ ddlmZ ddlZddlmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZ g d¢Zej<                  j>                  ZdZ ejB                  Z"ejB                  Z#d„ Z$d„ Z%d„ Z&ejN                  jL                  j                   e&_          ejP                  ejN                  jR                  «      Z* G d„ de*«      Z)d„ Z+ejX                  fd„Z- ej\                  e«      d„ «       Z G d„ de/«      Z0 ejb                  «        y)z@Extensions to the 'distutils' for large or complex distributionsé    N)ÚDistutilsOptionError)Úconvert_pathé   )ÚSetuptoolsDeprecationWarning)Ú	Extension)ÚDistribution)ÚRequire)ÚPackageFinderÚPEP420PackageFinder)Úmonkey)Úlogging)Úsetupr   ÚCommandr   r	   r   Úfind_packagesÚfind_namespace_packagesc                 ó®   —  G d„ dt         j                  j                  «      } || «      }|j                  d¬«       |j                  rt        |«       y y )Nc                   ó4   ‡ — e Zd ZdZˆ fd„Zdˆ fd„	Zd„ Zˆ xZS )ú4_install_setup_requires.<locals>.MinimalDistributionzl
        A minimal version of a distribution for supporting the
        fetch_build_eggs interface.
        c                 ó¶   •— d}t        |«      t        |«      z  D �ci c]  }|||   “Œ
 }}t        ‰| �	  |«       | j                  j	                  «        y c c}w )N)Údependency_linksÚsetup_requires)ÚsetÚsuperÚ__init__Úset_defaultsÚ_disable)ÚselfÚattrsÚ_inclÚkÚfilteredÚ	__class__s        €ú5/usr/lib/python3/dist-packages/setuptools/__init__.pyr   z=_install_setup_requires.<locals>.MinimalDistribution.__init__5   sU   ø€ Ø8ˆEÜ-0°«Z¼#¸e»*Ñ-DÖE¨˜˜5 ™8™ÐEˆHÐEÜ‰GÑ˜XÔ&à×Ñ×&Ñ&Õ(ùò Fs   �Ac                 óX   •— 	 t         ‰| �  |«      \  }}|dfS # t        $ r |dfcY S w xY w)zAIgnore ``pyproject.toml``, they are not related to setup_requires© )r   Ú _split_standard_project_metadataÚ	Exception)r   Ú	filenamesÚcfgÚtomlr"   s       €r#   Ú_get_project_config_fileszN_install_setup_requires.<locals>.MinimalDistribution._get_project_config_files<   s=   ø€ ð%Ü!™GÑDÀYÓO‘	��TØ˜B�w�øÜò %Ø  "�}Ò$ð%ús   ƒ ™)¨)c                  ó   — y)zl
            Disable finalize_options to avoid building the working set.
            Ref #2158.
            Nr%   )r   s    r#   Úfinalize_optionszE_install_setup_requires.<locals>.MinimalDistribution.finalize_optionsD   s   � ó    ©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r+   r-   Ú__classcell__©r"   s   @r#   ÚMinimalDistributionr   /   s   ø„ ñ	ô
	)õ	%ö	r.   r6   T)Úignore_option_errors)Ú	distutilsÚcorer   Úparse_config_filesr   Ú_fetch_build_eggs)r   r6   Údists      r#   Ú_install_setup_requiresr=   ,   sM   € ôœiŸn™n×9Ñ9ô ñ6 ˜uÓ%€Dð 	×Ñ°ÐÔ6Ø×ÒÜ˜$Õð r.   c                 óú   — 	 | j                  | j                  «       y # t        $ rS}d}d|j                  j                  v r3t        |d«      r|j                  |«       ‚ | j                  d|› d�«       ‚ d }~ww xY w)Na–  
        It is possible a package already installed in your system
        contains an version that is invalid according to PEP 440.
        You can try `pip install --use-pep517` as a workaround for this problem,
        or rely on a new virtual environment.

        If the problem refers to a package that is not installed yet,
        please contact that package's maintainers or distributors.
        ÚInvalidVersionÚadd_noteú
)Úfetch_build_eggsr   r'   r"   r0   Úhasattrr@   Úannounce)r<   ÚexÚmsgs      r#   r;   r;   R   sz   € ðØ×Ñ˜d×1Ñ1Õ2øÜò ðˆð ˜rŸ|™|×4Ñ4Ñ4Ü�r˜:Ô&Ø—‘˜CÔ ð 	ð —‘  3 % r˜lÔ+Øûðús   ‚ ž	A:§AA5Á5A:c                  ó~   — t        j                  «        t        | «       t        j                  j
                  di | ¤ŽS )Nr%   )r   Ú	configurer=   r8   r9   r   )r   s    r#   r   r   g   s.   € ä×ÑÔÜ˜EÔ"Ü�>‰>×ÑÑ( %Ñ(Ð(r.   c                   ó<   ‡ — e Zd ZdZdZˆ fd„Zdd„Zd„ Zdd„Zˆ xZ	S )	r   a›
  
    Setuptools internal actions are organized using a *command design pattern*.
    This means that each action (or group of closely related actions) executed during
    the build should be implemented as a ``Command`` subclass.

    These commands are abstractions and do not necessarily correspond to a command that
    can (or should) be executed via a terminal, in a CLI fashion (although historically
    they would).

    When creating a new command from scratch, custom defined classes **SHOULD** inherit
    from ``setuptools.Command`` and implement a few mandatory methods.
    Between these mandatory methods, are listed:

    .. method:: initialize_options(self)

        Set or (reset) all options/attributes/caches used by the command
        to their default values. Note that these values may be overwritten during
        the build.

    .. method:: finalize_options(self)

        Set final values for all options/attributes used by the command.
        Most of the time, each option/attribute/cache should only be set if it does not
        have any value yet (e.g. ``if self.attr is None: self.attr = val``).

    .. method:: run(self)

        Execute the actions intended by the command.
        (Side effects **SHOULD** only take place when ``run`` is executed,
        for example, creating new files or writing to the terminal output).

    A useful analogy for command classes is to think of them as subroutines with local
    variables called "options".  The options are "declared" in ``initialize_options()``
    and "defined" (given their final values, aka "finalized") in ``finalize_options()``,
    both of which must be defined by every command class. The "body" of the subroutine,
    (where it does all the work) is the ``run()`` method.
    Between ``initialize_options()`` and ``finalize_options()``, ``setuptools`` may set
    the values for options/attributes based on user's input (or circumstance),
    which means that the implementation should be careful to not overwrite values in
    ``finalize_options`` unless necessary.

    Please note that other commands (or other parts of setuptools) may also overwrite
    the values of the command's options/attributes multiple times during the build
    process.
    Therefore it is important to consistently implement ``initialize_options()`` and
    ``finalize_options()``. For example, all derived attributes (or attributes that
    depend on the value of other attributes) **SHOULD** be recomputed in
    ``finalize_options``.

    When overwriting existing commands, custom defined classes **MUST** abide by the
    same APIs implemented by the original class. They also **SHOULD** inherit from the
    original class.
    Fc                 óX   •— t         ‰| �  |«       t        | «      j                  |«       y)zj
        Construct the command for dist, updating
        vars(self) with any keyword parameters.
        N)r   r   ÚvarsÚupdate)r   r<   Úkwr"   s      €r#   r   zCommand.__init__­   s$   ø€ ô
 	‰Ñ˜ÔÜˆT‹
×Ñ˜"Õr.   c           	      óŠ   — t        | |«      }|€t        | ||«       |S t        |t        «      st	        d|›d|›d|›d�«      ‚|S )Nú'z' must be a z (got `z`))ÚgetattrÚsetattrÚ
isinstanceÚstrr   )r   ÚoptionÚwhatÚdefaultÚvals        r#   Ú_ensure_stringlikezCommand._ensure_stringlikeµ   sL   € Ü�d˜FÓ#ˆØˆ;Ü�D˜& 'Ô*ØˆNÜ˜C¤Ô%Ý&Ú28º$ÂÐDóð ð ˆ
r.   c                 óø   — t        | |«      }|€yt        |t        «      r"t        | |t	        j
                  d|«      «       yt        |t        «      rt        d„ |D «       «      }nd}|st        d|›d|›d�«      ‚y)a¼  Ensure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].

        ..
           TODO: This method seems to be similar to the one in ``distutils.cmd``
           Probably it is just here for backward compatibility with old Python versions?

        :meta private:
        Nz,\s*|\s+c              3   ó<   K  — | ]  }t        |t        «      –— Œ y ­wr/   )rR   rS   )Ú.0Úvs     r#   ú	<genexpr>z-Command.ensure_string_list.<locals>.<genexpr>Ó   s   è ø€ Ò9°œ A¤s×+Ñ9ùs   ‚FrO   z!' must be a list of strings (got ú))	rP   rR   rS   rQ   ÚreÚsplitÚlistÚallr   )r   rT   rW   Úoks       r#   Úensure_string_listzCommand.ensure_string_listÀ   su   € ô �d˜FÓ#ˆØˆ;ØÜ˜œSÔ!Ü�D˜&¤"§(¡(¨;¸Ó"<Õ=ä˜#œtÔ$ÜÑ9°SÔ9Ó9‘à�ÙÝ*ÚAGÊÐMóð ð r.   c                 óh   — t         j                  | ||«      }t        |«      j                  |«       |S r/   )Ú_CommandÚreinitialize_commandrK   rL   )r   ÚcommandÚreinit_subcommandsrM   Úcmds        r#   rg   zCommand.reinitialize_commandÛ   s.   € Ü×+Ñ+¨D°'Ð;MÓNˆÜˆS‹	×Ñ˜ÔØˆ
r.   r/   )r   )
r0   r1   r2   r3   Úcommand_consumes_argumentsr   rX   rd   rg   r4   r5   s   @r#   r   r   t   s%   ø„ ñ4ðl "'Ðôó	ò÷6r.   r   c                 ó†   — d„ t        j                  | d¬«      D «       }t        t         j                  j                  |«      S )z%
    Find all files under 'path'
    c              3   ór   K  — | ]/  \  }}}|D ]$  }t         j                  j                  ||«      –— Œ& Œ1 y ­wr/   )ÚosÚpathÚjoin)r[   ÚbaseÚdirsÚfilesÚfiles        r#   r]   z#_find_all_simple.<locals>.<genexpr>å   sB   è ø€ ò áˆD�$˜Øòð ô 	�‰�‰�T˜4× ðØ ñùs   ‚57T)Úfollowlinks)rn   ÚwalkÚfilterro   Úisfile)ro   Úresultss     r#   Ú_find_all_simplerz   á   s3   € ñä!#§¡¨¸4Ô!@ô€Gô
 ”"—'‘'—.‘. 'Ó*Ð*r.   c                 óÊ   — t        | «      }| t        j                  k(  r;t        j                  t        j
                  j                  | ¬«      }t        ||«      }t        |«      S )zŒ
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )Ústart)	rz   rn   ÚcurdirÚ	functoolsÚpartialro   ÚrelpathÚmapra   )Údirrs   Úmake_rels      r#   Úfindallr„   í   sJ   € ô
 ˜SÓ!€EØ
Œb�i‰iÒÜ×$Ñ$¤R§W¡W§_¡_¸CÔ@ˆÜ�H˜eÓ$ˆÜ�‹;Ðr.   c                 óH   — t        j                  ddd¬«       t        | «      S )NzAccess to implementation detaila  
        The function `convert_path` is not provided by setuptools itself,
        and therefore not part of the public API.

        Its direct usage by 3rd-party packages is considered improper and the function
        may be removed in the future.
        )iç  é   é   )Údue_date)r   ÚemitÚ_convert_path)Úpathnames    r#   r   r   ù   s*   € ä ×%Ñ%Ø)ð	ð  õ
ô ˜Ó"Ð"r.   c                   ó   — e Zd ZdZy)Úsicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)r0   r1   r2   r3   r%   r.   r#   r�   r�   	  s   „ ÚEr.   r�   )2r3   r~   rn   r_   Ú_distutils_hack.overrideÚ_distutils_hackÚdistutils.corer8   Údistutils.errorsr   Údistutils.utilr   rŠ   Úwarningsr   Úsetuptools.versionÚ
setuptoolsÚsetuptools.extensionr   Úsetuptools.distr   Úsetuptools.dependsr	   Úsetuptools.discoveryr
   r   Ú r   r   Ú__all__ÚversionÚ__version__Úbootstrap_install_fromÚfindr   r   r=   r;   r   r9   Úget_unpatchedr   rf   rz   r}   r„   ÚwrapsrS   r�   Ú	patch_allr%   r.   r#   ú<module>r£      s  ðÙ Fã Û 	Û 	ã ã Ý 1Ý 8å 2ã Ý *Ý (Ý &ß CÝ Ý ò	€ð × Ñ ×,Ñ,€àÐ ð ×"Ñ"€Ø-×2Ñ2Ð ò# òLò*)ð —‘×$Ñ$×,Ñ,€„ð  ˆ6×Ñ 	§¡× 6Ñ 6Ó7€ôjˆhô jòZ	+ð —	‘	ó 	ð €‡��Óñ#ó  ð#ôFˆ#ô Fð
 €× Ñ Õ r.   