o
    “si˜  ã                   @   sJ  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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j"Z#ej"Z$dd„ Z%dd„ Z&ej'j&j e&_ e (ej'j)¡Z*G dd„ de*ƒZ)dd„ Z+ej,fdd„Z-e .e¡dd„ ƒZG dd„ de/ƒZ0e 1¡  dS )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                 C   sB   G dd„ dt jjƒ}|| ƒ}|jdd� |jr| |j¡ d S d S )Nc                       s6   e Zd ZdZ‡ fdd„Zd	‡ fdd„	Zdd„ Z‡  ZS )
z4_install_setup_requires.<locals>.MinimalDistributionzl
        A minimal version of a distribution for supporting the
        fetch_build_eggs interface.
        c                    s<   d}‡ fdd„t |ƒt ˆ ƒ@ D ƒ}tƒ  |¡ | j ¡  d S )N)Zdependency_linksÚsetup_requiresc                    s   i | ]}|ˆ | “qS © r   )Ú.0Úk©Úattrsr   úbC:\Users\PC\students\dividedattentionclub\venv\lib\python3.10\site-packages\setuptools/__init__.pyÚ
<dictcomp>8   s    zQ_install_setup_requires.<locals>.MinimalDistribution.__init__.<locals>.<dictcomp>)ÚsetÚsuperÚ__init__Úset_defaultsÚ_disable)Úselfr   Z_inclÚfiltered©Ú	__class__r   r   r   6   s   z=_install_setup_requires.<locals>.MinimalDistribution.__init__Nc                    s6   zt ƒ  |¡\}}|dfW S  ty   |df Y S w )zAIgnore ``pyproject.toml``, they are not related to setup_requiresr   )r   Z _split_standard_project_metadataÚ	Exception)r   Ú	filenamesÚcfgÚtomlr    r   r   Ú_get_project_config_files=   s   
ÿzN_install_setup_requires.<locals>.MinimalDistribution._get_project_config_filesc                 S   s   dS )zl
            Disable finalize_options to avoid building the working set.
            Ref #2158.
            Nr   )r   r   r   r   Úfinalize_optionsE   s    zE_install_setup_requires.<locals>.MinimalDistribution.finalize_options©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r&   r'   Ú__classcell__r   r   r    r   ÚMinimalDistribution0   s
    r.   T)Zignore_option_errors)Ú	distutilsÚcorer   Zparse_config_filesr   Zfetch_build_eggs)r   r.   Údistr   r   r   Ú_install_setup_requires-   s   ÿr2   c                  K   s"   t  ¡  t| ƒ tjjdi | ¤ŽS )Nr   )r   Ú	configurer2   r/   r0   r   r   r   r   r   r   S   s   r   c                       sB   e Zd ZejZdZ‡ fdd„Zddd„Zdd„ Zdd
d„Z	‡  Z
S )r   Fc                    s   t ƒ  |¡ t| ƒ |¡ dS )zj
        Construct the command for dist, updating
        vars(self) with any keyword parameters.
        N)r   r   ÚvarsÚupdate)r   r1   Úkwr    r   r   r   e   s   zCommand.__init__Nc                 C   sB   t | |ƒ}|d u rt| ||ƒ |S t|tƒstd|||f ƒ‚|S )Nz'%s' must be a %s (got `%s`))ÚgetattrÚsetattrÚ
isinstanceÚstrr   )r   ÚoptionÚwhatÚdefaultÚvalr   r   r   Ú_ensure_stringlikem   s   

ÿzCommand._ensure_stringlikec                 C   sr   t | |ƒ}|du rdS t|tƒrt| |t d|¡ƒ dS t|tƒr+tdd„ |D ƒƒ}nd}|s7td||f ƒ‚dS )zî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"].
        Nz,\s*|\s+c                 s   s   � | ]}t |tƒV  qd S r(   )r9   r:   )r   Úvr   r   r   Ú	<genexpr>…   s   € z-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))	r7   r9   r:   r8   ÚreÚsplitÚlistÚallr   )r   r;   r>   Úokr   r   r   Úensure_string_listx   s   



ÿÿzCommand.ensure_string_listr   c                 K   s    t  | ||¡}t|ƒ |¡ |S r(   )Ú_CommandÚreinitialize_commandr4   r5   )r   ÚcommandZreinit_subcommandsr6   Úcmdr   r   r   rI   �   s   zCommand.reinitialize_commandr(   )r   )r)   r*   r+   rH   r,   Zcommand_consumes_argumentsr   r?   rG   rI   r-   r   r   r    r   r   `   s    
r   c                 C   s&   dd„ t j| dd�D ƒ}tt jj|ƒS )z%
    Find all files under 'path'
    c                 s   s.   � | ]\}}}|D ]
}t j ||¡V  q	qd S r(   )ÚosÚpathÚjoin)r   ÚbaseÚdirsÚfilesÚfiler   r   r   rA   —   s   € ýþÿz#_find_all_simple.<locals>.<genexpr>T)Úfollowlinks)rL   ÚwalkÚfilterrM   Úisfile)rM   Úresultsr   r   r   Ú_find_all_simple“   s   þrX   c                 C   s6   t | ƒ}| tjkrtjtjj| d�}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)	rX   rL   ÚcurdirÚ	functoolsÚpartialrM   ÚrelpathÚmaprD   )ÚdirrQ   Zmake_relr   r   r   ÚfindallŸ   s
   

r`   c                 C   s(   ddl m} d}t ||ƒt¡ t| ƒS )Nr   )ÚcleandoczÓ
    The function `convert_path` is considered internal and not part of the public API.
    Its direct usage by 3rd-party packages is considered deprecated and the function
    may be removed in the future.
    )Úinspectra   ÚwarningsÚwarnr   Ú_convert_path)Úpathnamera   Úmsgr   r   r   r   «   s   r   c                   @   s   e Zd ZdZdS )Úsicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)r)   r*   r+   r,   r   r   r   r   rh   ¸   s    rh   )2r,   r[   rL   rB   rc   Z_distutils_hack.overrideZ_distutils_hackZdistutils.corer/   Zdistutils.errorsr   Zdistutils.utilr   re   Z_deprecation_warningr   Zsetuptools.versionÚ
setuptoolsZsetuptools.extensionr   Zsetuptools.distr   Zsetuptools.dependsr   Zsetuptools.discoveryr	   r
   Ú r   r   Ú__all__ÚversionÚ__version__Zbootstrap_install_fromÚfindr   r   r2   r   r0   Zget_unpatchedr   rH   rX   rZ   r`   Úwrapsr:   rh   Z	patch_allr   r   r   r   Ú<module>   sB    &3
