§
    øyIfØ&  ã                  ó0  — d dl mZ d dlZd dlmZmZ d dlmZ d dlm	Z	m
Z
mZmZmZmZmZmZ ddlmZmZmZmZ ddlmZ dd	lmZ e	rd d
lmZ d dlmZ ddlmZ ddl m!Z!  ed¦  «        Z" G d„ de¦  «        Z# G d„ de#¦  «        Z$ G d„ de#¦  «        Z%dZ&dS )é    )ÚannotationsN)ÚABCÚabstractmethod)ÚPath)ÚTYPE_CHECKINGÚAnyÚCallableÚIteratorÚMappingÚSequenceÚTypeVarÚcasté   )ÚConfigConstantDefinitionÚConfigDefinitionÚConfigDynamicDefinitionÚConfigLoadArgs)ÚSetEnv)ÚEnvList)ÚLoader)ÚConfig)ÚFactory)ÚSectionÚVc                  óâ   — e Zd ZdZd7d
„Zed8d„¦   «         Zd8d„Z	 	 d9d:d„Zd;d„Z	e
d<d!„¦   «         Zd=d$„Zd>d&„Zd?d)„Zd@dAd,„ZdBd-„ZdCd/„ZdDd1„ZdEd3„ZdFd4„ZedBd5„¦   «         ZedGd6„¦   «         ZdS )HÚ	ConfigSetzdA set of configuration that belong together (such as a tox environment settings, core tox settings).Úconfr   Úsectionr   Úenv_nameú
str | NoneÚreturnÚNonec                óž   — || _         || _        || _        g | _        i | _        i | _        i | _        d| _        |                      ¦   «          d S )NF)	Ú_sectionÚ	_env_nameÚ_confÚloadersÚ_definedÚ_keysÚ_aliasÚ_finalÚregister_config)Úselfr   r   r   s       úC/var/www/piapp/venv/lib/python3.11/site-packages/tox/config/sets.pyÚ__init__zConfigSet.__init__   sR   € ØˆŒØ!ˆŒØˆŒ
Ø*,ˆŒØ:<ˆŒØ&(ˆŒ
Ø&(ˆŒØˆŒØ×ÒÑÔÐÐÐó    c                ó   — t           ‚©N)ÚNotImplementedError©r-   s    r.   r,   zConfigSet.register_config$   s   € å!Ð!r0   c                ó   — d| _         d S )NT)r+   r4   s    r.   Úmark_finalizedzConfigSet.mark_finalized(   s   € ØˆŒˆˆr0   NÚkeysústr | Sequence[str]Úof_typeútype[V]Údefaultú%Callable[[Config, str | None], V] | VÚdescÚstrÚpost_processúCallable[[V], V] | NoneÚfactoryúFactory[Any] | NoneúConfigDynamicDefinition[V]c                óð   — | j         rd}t          |¦  «        ‚|                      |¦  «        }t          ||||||¦  «        }	|                      ||	¦  «        }
t          t          t                   |
¦  «        S )a¥  
        Add configuration value.

        :param keys: the keys under what to register the config (first is primary key)
        :param of_type: the type of the config value
        :param default: the default value of the config value
        :param desc: a help message describing the configuration
        :param post_process: a callback to post-process the configuration value after it has been loaded
        :param factory: factory method used to build contained objects (if ``of_type`` is a container type it
          should perform the contained item creation, otherwise creates objects that match the type)
        :return: the new dynamic config definition
        ú7config set has been marked final and cannot be extended)r+   ÚRuntimeErrorÚ
_make_keysr   Ú	_add_confr   r   )r-   r7   r9   r;   r=   r?   rA   ÚmsgÚkeys_Ú
definitionÚresults              r.   Ú
add_configzConfigSet.add_config+   ss   € ð* Œ;ð 	$ØKˆCÝ˜sÑ#Ô#Ð#Ø—’ Ñ%Ô%ˆÝ,¨U°D¸'À7ÈLÐZaÑbÔbˆ
Ø—’  zÑ2Ô2ˆÝÕ+­AÔ.°Ñ7Ô7Ð7r0   Úvaluer   úConfigConstantDefinition[V]c                óê   — | j         rd}t          |¦  «        ‚|                      |¦  «        }t          |||¦  «        }|                      ||¦  «        }t          t          t                   |¦  «        S )a  
        Add a constant value.

        :param keys: the keys under what to register the config (first is primary key)
        :param desc: a help message describing the configuration
        :param value: the config value to use
        :return: the new constant config value
        rE   )r+   rF   rG   r   rH   r   r   )r-   r7   r=   rN   rI   rJ   rK   rL   s           r.   Úadd_constantzConfigSet.add_constantH   sl   € ð Œ;ð 	$ØKˆCÝ˜sÑ#Ô#Ð#Ø—’ Ñ%Ô%ˆÝ-¨e°T¸5ÑAÔAˆ
Ø—’  zÑ2Ô2ˆÝÕ,­QÔ/°Ñ8Ô8Ð8r0   úSequence[str]c                ó6   — t          | t          ¦  «        r| fn| S r2   )Ú
isinstancer>   )r7   s    r.   rG   zConfigSet._make_keysY   s   € å$ T­3Ñ/Ô/Ð9�ˆwˆw°TÐ9r0   rK   úConfigDefinition[V]c                ó¤   — |d         }|| j         v r|                      ||¦  «         d | j        |<   |D ]}|| j        |<   Œ|D ]}|| j         |<   Œ|S )Nr   )r(   Ú_on_duplicate_confr)   r*   )r-   r7   rK   ÚkeyÚitems        r.   rH   zConfigSet._add_conf]   s{   € Ø�1ŒgˆØ�$”-ÐÐØ×#Ò# C¨Ñ4Ô4Ð4àˆŒ
�3‰Øð 	$ð 	$ˆDØ #ˆDŒK˜ÑÐØð 	,ð 	,ˆCØ!+ˆDŒM˜#ÑÐØÐr0   rX   c                óV   — d| j         › d| j        |         › d|› �}t          |¦  «        ‚)Nz'duplicate configuration definition for z:
has: z
new: )Únamer(   Ú
ValueError)r-   rX   rK   rI   s       r.   rW   zConfigSet._on_duplicate_confi   s6   € Ør¸¼	ÐrÐrÈ4Ì=ÐY\ÔK]ÐrÐrÐfpÐrÐrˆÝ˜‰oŒoÐr0   rY   r   c                ó,   — |                       |¦  «        S )z²
        Get the config value for a given key (will materialize in case of dynamic config).

        :param item: the config key
        :return: the configuration value
        )Úload©r-   rY   s     r.   Ú__getitem__zConfigSet.__getitem__m   s   € ð �yŠy˜‰ŒÐr0   Úchainúlist[str] | Nonec           	     ó�   — | j         |         }|                     | j        | j        t	          || j        | j        ¦  «        ¦  «        S )a&  
        Get the config value for a given key (will materialize in case of dynamic config).

        :param item: the config key
        :param chain: a chain of configuration keys already loaded for this load operation (used to detect circles)
        :return: the configuration value
        )r(   Ú__call__r&   r'   r   r[   r   )r-   rY   ra   Úconfig_definitions       r.   r^   zConfigSet.loadv   sB   € ð !œM¨$Ô/ÐØ ×)Ò)¨$¬*°d´lÅNÐSXÐZ^ÔZcÐeiÔerÑDsÔDsÑtÔtÐtr0   c                ó0   — | j         j        › d| j        ›d�S )Nz	(loaders=ú))Ú	__class__Ú__name__r'   r4   s    r.   Ú__repr__zConfigSet.__repr__�   s    € Ø”.Ô)ÐEÐE°D´LÐEÐEÐEÐEr0   úIterator[str]c                óN   — t          | j                             ¦   «         ¦  «        S )zD:return: iterate through the defined config keys (primary keys used))Úiterr)   r7   r4   s    r.   Ú__iter__zConfigSet.__iter__„   s   € å�D”J—O’OÑ%Ô%Ñ&Ô&Ð&r0   Úboolc                ó   — || j         v S )z¼
        Check if a configuration key is within the config set.

        :param item: the configuration value
        :return: a boolean indicating the truthiness of the statement
        ©r*   r_   s     r.   Ú__contains__zConfigSet.__contains__ˆ   s   € ð �t”{Ð"Ð"r0   ú	list[str]c                ó  — t          ¦   «         }d„ | j        D ¦   «         }| j        D ]:}t          |¦  «        |vr'|                     |                     ¦   «         ¦  «         Œ;|| j                             ¦   «         z  }t          |¦  «        S )zH:return: Return a list of keys present in the config source but not usedc                óD   — h | ]}|j         ®	t          |j         ¦  «        ’ŒS r2   )ÚparentÚid)Ú.0Úis     r.   ú	<setcomp>z#ConfigSet.unused.<locals>.<setcomp>•   s'   € ÐNÐNÐN A¸¼Ð9M•2�a”h‘<”<Ð9MÐ9MÐ9Mr0   )Úsetr'   rw   ÚupdateÚ
found_keysr(   r7   Úsorted)r-   ÚfoundÚparentsÚloaders       r.   ÚunusedzConfigSet.unused‘   s…   € å™%œ%ˆàNÐN¨¬ÐNÑNÔNˆØ”lð 	2ð 	2ˆFÝ�&‰zŒz Ð(Ð(Ø—’˜V×.Ò.Ñ0Ô0Ñ1Ô1Ð1øØ�”×#Ò#Ñ%Ô%Ñ%ˆÝ�e‰}Œ}Ðr0   c                ó   — | j         |         S )z¤
        Get the primary key for a config key.

        :param key: the config key
        :return: the key that's considered the primary for the input key
        rq   )r-   rX   s     r.   Úprimary_keyzConfigSet.primary_keyœ   s   € ð Œ{˜3ÔÐr0   c                ó   — | j         j        S r2   )r$   r[   r4   s    r.   r[   zConfigSet.name¥   s   € àŒ}Ô!Ð!r0   c                ó   — | j         S r2   )r%   r4   s    r.   r   zConfigSet.env_name©   s
   € àŒ~Ðr0   )r   r   r   r   r   r    r!   r"   ©r!   r"   )NN)r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   r!   rC   )r7   r8   r=   r>   rN   r   r!   rO   )r7   r8   r!   rR   )r7   rR   rK   rU   r!   rU   ©rX   r>   rK   rU   r!   r"   )rY   r>   r!   r   r2   )rY   r>   ra   rb   r!   r   ©r!   r>   )r!   rk   )rY   r>   r!   ro   )r!   rs   )rX   r>   r!   r>   )r!   r    )ri   Ú
__module__Ú__qualname__Ú__doc__r/   r   r,   r6   rM   rQ   ÚstaticmethodrG   rH   rW   r`   r^   rj   rn   rr   r‚   r„   Úpropertyr[   r   © r0   r.   r   r      s¹  € € € € € ØnÐnð	ð 	ð 	ð 	ð ð"ð "ð "ñ „^ð"ðð ð ð ð 15Ø'+ð8ð 8ð 8ð 8ð 8ð:9ð 9ð 9ð 9ð" ð:ð :ð :ñ „\ð:ð
ð 
ð 
ð 
ðð ð ð ðð ð ð ð	uð 	uð 	uð 	uð 	uðFð Fð Fð Fð'ð 'ð 'ð 'ð#ð #ð #ð #ð	ð 	ð 	ð 	ð ð  ð  ð  ð ð"ð "ð "ñ „Xð"ð ðð ð ñ „Xðð ð r0   r   c                  óL   ‡ — e Zd ZdZdˆ fd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	ˆ xZ
S )ÚCoreConfigSetz*Configuration set for the core tox config.r   r   r   r   Úrootr   Úsrc_pathr!   r"   c                óÊ   •— || _         || _        t          ¦   «                              ||d ¬¦  «         d}|                      ddgt
          t          g ¦  «        |¬¦  «         d S )N)r   r   z(define environments to automatically runÚenv_listÚenvlist©r7   r9   r;   r=   )Ú_rootÚ	_src_pathÚsuperr/   rM   r   )r-   r   r   r’   r“   r=   rh   s         €r.   r/   zCoreConfigSet.__init__±   sb   ø€ ØˆŒ
Ø!ˆŒÝ‰Œ×Ò˜ w¸ÐÑ>Ô>Ð>Ø9ˆØ�Š˜j¨)Ð4½gÍwÐWYÉ{Ì{ÐaeˆÑfÔfÐfÐfÐfr0   r   r    c                ó>   — t          t          | d         dz  ¦  «        S )NÚtox_rootz.tox©r   r   ©r-   r   r   s      r.   Ú_default_work_dirzCoreConfigSet._default_work_dir¸   ó   € Ý•D˜$˜zÔ*¨VÑ3Ñ4Ô4Ð4r0   c                ó>   — t          t          | d         dz  ¦  «        S )NÚwork_dirz.tmpr�   rž   s      r.   Ú_default_temp_dirzCoreConfigSet._default_temp_dir»   r    r0   Úfolderc                ó@   — | j         j        j        r| j         j        n|S r2   )r&   Úoptionsr¢   )r-   r¤   s     r.   Ú_work_dir_post_processz$CoreConfigSet._work_dir_post_process¾   s   € Ø&*¤jÔ&8Ô&AÐMˆtŒzÔ"Ð"ÀvÐMr0   c                ól  — |                       dgd| j        ¬¦  «         |                      ddgt          | j        d¬¦  «         |                      dd	gt          | j        | j        d
¬¦  «         |                      dgt          | j        d¬¦  «         |                       ddt          j	        ¦  «         d S )NÚconfig_file_pathzpath to the configuration file)r7   r=   rN   rœ   Ú	toxinidirz:the root directory (where the configuration file is found)r—   r¢   Ú
toxworkdirzworking directory)r7   r9   r;   r?   r=   Útemp_dirz6a folder for temporary files (is not cleaned at start)Úhost_pythonzthe host python executable path)
rQ   r™   rM   r   r˜   rŸ   r§   r£   ÚsysÚ
executabler4   s    r.   r,   zCoreConfigSet.register_configÁ   sÜ   € Ø×ÒÐ 2Ð3Ð:ZÐbfÔbpÐÑqÔqÐqØ�ŠØ˜kÐ*ÝØ”JØMð	 	ñ 	
ô 	
ð 	
ð 	�ŠØ˜lÐ+ÝØÔ*ØÔ4Ø$ð 	ñ 	
ô 	
ð 	
ð 	�ŠØ�ÝØÔ*ØIð	 	ñ 	
ô 	
ð 	
ð 	×Ò˜-Ð)JÍCÌNÑ[Ô[Ð[Ð[Ð[r0   rX   r>   rK   rU   c                ó   — d S r2   r�   )r-   rX   rK   s      r.   rW   z CoreConfigSet._on_duplicate_confÙ   s   € Øˆr0   )
r   r   r   r   r’   r   r“   r   r!   r"   )r   r   r   r    r!   r   )r¤   r   r!   r   r‡   rˆ   )ri   rŠ   r‹   rŒ   r/   rŸ   r£   r§   r,   rW   Ú__classcell__©rh   s   @r.   r‘   r‘   ®   sµ   ø€ € € € € Ø4Ð4ðgð gð gð gð gð gð5ð 5ð 5ð 5ð5ð 5ð 5ð 5ðNð Nð Nð Nð\ð \ð \ð \ð0ð ð ð ð ð ð ð r0   r‘   c                  ó4   ‡ — e Zd ZdZdˆ fd
„Zdd„Zdd„Zˆ xZS )ÚEnvConfigSetz(Configuration set for a tox environment.r   r   r   r   r   r>   r!   r"   c                óf   •— t          ¦   «                              |||¦  «         t          | _        d S r2   )rš   r/   ÚdictÚdefault_set_env_loader)r-   r   r   r   rh   s       €r.   r/   zEnvConfigSet.__init__à   s-   ø€ Ý‰Œ×Ò˜˜w¨Ñ1Ô1Ð1ÝGKˆÔ#Ð#Ð#r0   c                óÀ   ‡ ‡— dˆ fd„}dˆˆ fd„}‰ j         j        d         Š‰                      d	d
gt          |t          d‰ j        ‰ j        ‰¦  «        d|¬¦  «         d S )NÚvaluesr   r!   c                óŒ   •— |                       ‰                     ¦   «         d¬¦  «         |                       ddid¬¦  «         | S )NF)ÚoverrideÚPYTHONIOENCODINGzutf-8T)r|   r·   )r¹   r-   s    €r.   Úset_env_post_processz:EnvConfigSet.register_config.<locals>.set_env_post_processå   sF   ø€ Ø�MŠM˜$×5Ò5Ñ7Ô7À%ˆMÑHÔHÐHØ�MŠMÐ-¨wÐ7À$ˆMÑGÔGÐGØˆMr0   ÚrawÚobjectc                ó„   •— t          | t          ¦  «        st          | ¦  «        ‚t          | ‰j        ‰j        ‰¦  «        S r2   )rT   r>   Ú	TypeErrorr   r[   r   )r¾   r’   r-   s    €€r.   Úset_env_factoryz5EnvConfigSet.register_config.<locals>.set_env_factoryê   s9   ø€ Ý˜c¥3Ñ'Ô'ð %Ý ‘n”nÐ$Ý˜#˜tœy¨$¬-¸Ñ>Ô>Ð>r0   rœ   Úset_envÚsetenvÚ zIenvironment variables to set when running commands in the tox environment)r7   r9   rA   r;   r=   r?   )r¹   r   r!   r   )r¾   r¿   r!   r   )r&   ÚcorerM   r   r[   r   )r-   r½   rÂ   r’   s   `  @r.   r,   zEnvConfigSet.register_configä   s£   øø€ ð	ð 	ð 	ð 	ð 	ð 	ð
	?ð 	?ð 	?ð 	?ð 	?ð 	?ð 	?ð
 ŒzŒ˜zÔ*ˆØ�ŠØ˜XÐ&ÝØ#Ý˜2˜tœy¨$¬-¸Ñ>Ô>Ø\Ø-ð 	ñ 	
ô 	
ð 	
ð 	
ð 	
r0   c                ó@   — | j         j        › d| j        ›d| j        ›d�S )Nz(name=z
, loaders=rg   )rh   ri   r%   r'   r4   s    r.   rj   zEnvConfigSet.__repr__ù   s*   € Ø”.Ô)Ð^Ð^°´Ð^Ð^ÈTÌ\Ð^Ð^Ð^Ð^r0   )r   r   r   r   r   r>   r!   r"   r‡   r‰   )ri   rŠ   r‹   rŒ   r/   r,   rj   r±   r²   s   @r.   r´   r´   Ý   sy   ø€ € € € € Ø2Ð2ðLð Lð Lð Lð Lð Lð
ð 
ð 
ð 
ð*_ð _ð _ð _ð _ð _ð _ð _r0   r´   )r   r‘   r´   )'Ú
__future__r   r®   Úabcr   r   Úpathlibr   Útypingr   r   r	   r
   r   r   r   r   r9   r   r   r   r   rÃ   r   Útypesr   Útox.config.loader.apir   Útox.config.mainr   Úloader.convertr   Úloader.sectionr   r   r   r‘   r´   Ú__all__r�   r0   r.   ú<module>rÒ      sÇ  ðØ "Ð "Ð "Ð "Ð "Ð "à 
€
€
€
Ø #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð Ð Ð Ø [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [à hÐ hÐ hÐ hÐ hÐ hÐ hÐ hÐ hÐ hÐ hÐ hØ Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð àð (Ø,Ð,Ð,Ð,Ð,Ð,Ø&Ð&Ð&Ð&Ð&Ð&à'Ð'Ð'Ð'Ð'Ð'Ø'Ð'Ð'Ð'Ð'Ð'à€GˆC�L„L€ðUð Uð Uð Uð U�ñ Uô Uð Uðp,ð ,ð ,ð ,ð ,�Iñ ,ô ,ð ,ð^_ð _ð _ð _ð _�9ñ _ô _ð _ð@€€€r0   