
    n&ph                        S SK Jr  S SKJr  S SKrSSKJr   " S S5      rS\	S	\
S
\
SS4S jr " S S\
\5      r " S S\\5      r " S S\\5      rS H  r\" \\S5        M      " S S\\5      rS H  r\" \\S5        M      " S S\R(                  R*                  \5      r\" S5      rS\S\4S jr\
\\\\\\\0rS\S\4S jrS\S\4S jr\" 5       r\" 5       rg)     )wraps)TypeVarN   )SetuptoolsDeprecationWarningc                   (    \ rS rSr% SrSr\\S'   Srg)Static	   a8  
Wrapper for built-in object types that are allow setuptools to identify
static core metadata (in opposition to ``Dynamic``, as defined :pep:`643`).

The trick is to mark values with :class:`Static` when they come from
``pyproject.toml`` or ``setup.cfg``, so if any plugin overwrite the value
with a built-in, setuptools will be able to recognise the change.

We inherit from built-in classes, so that we don't need to change the existing
code base to deal with the new types.
We also should strive for immutability objects to avoid changes after the
initial parsing.
F	_mutated_ N)	__name__
__module____qualname____firstlineno____doc__r
   bool__annotations____static_attributes__r       E/var/www/html/venv/lib/python3.13/site-packages/setuptools/_static.pyr   r   	   s     Itr   r   targetmethodcopyingreturnc                    ^^ [        XS5      mTc  g[        T5      S[        4UU4S jj5       nSUl        [	        XU5        g)z
Because setuptools is very flexible we cannot fully prevent
plugins and user customizations from modifying static values that were
parsed from config files.
But we can attempt to block "in-place" mutations and identify when they
were done.
Nselfc                 ^   > SU l         [        R                  " SST S3SS9  T" U /UQ70 UD6$ )NTz/Direct modification of value will be disallowedz
            In an effort to implement PEP 643, direct/in-place changes of static values
            that come from configuration files are deprecated.
            If you need to modify this value, please first create a copy with z
            and make sure conform to all relevant standards when overriding setuptools
            functionality (https://packaging.python.org/en/latest/specifications/).
            )i  
   r   )due_date)r
   r   emit)r   argskwargsr   fns      r   _replacement+_prevent_modification.<locals>._replacement'   sS     $))=O PWi X $
	
 $((((r    )getattrr   r   r   setattr)r   r   r   r#   r"   s     ` @r   _prevent_modificationr(      sJ     
	&B	z
2Y)6 ) )" LFL)r   c                       \ rS rSrSrg)Str=   r   Nr   r   r   r   r   r   r   r   r*   r*   =       r   r*   c                       \ rS rSrSrg)TupleA   r   Nr,   r   r   r   r/   r/   A   r-   r   r/   c                       \ rS rSrSrSrg)ListE   a[  
:meta private:
>>> x = List([1, 2, 3])
>>> is_static(x)
True
>>> x += [0]  # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
SetuptoolsDeprecationWarning: Direct modification ...
>>> is_static(x)  # no longer static after modification
False
>>> y = list(x)
>>> y.clear()
>>> y
[]
>>> y == x
False
>>> is_static(List(y))
True
r   Nr   r   r   r   r   r   r   r   r   r2   r2   E   s    r   r2   )
__delitem____iadd____setitem__appendclearextendinsertremovereversepopz`list(value)`c                       \ rS rSrSrSrg)Dictl   a{  
:meta private:
>>> x = Dict({'a': 1, 'b': 2})
>>> is_static(x)
True
>>> x['c'] = 0  # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
SetuptoolsDeprecationWarning: Direct modification ...
>>> x._mutated_
True
>>> is_static(x)  # no longer static after modification
False
>>> y = dict(x)
>>> y.popitem()
('b', 2)
>>> y == x
False
>>> is_static(Dict(y))
True
r   Nr4   r   r   r   r@   r@   l   s    r   r@   )r5   __ior__r7   r9   r>   popitem
setdefaultupdatez`dict(value)`c                       \ rS rSrSrSrg)SpecifierSet   z>Not exactly a built-in type but useful for ``requires-python``r   Nr4   r   r   r   rG   rG      s    Hr   rG   Tvaluec                     U $ )z
>>> noop(42)
42
r   rJ   s    r   nooprM      s	    
 Lr   c                 T    [         R                  [        U 5      [        5      " U 5      $ )zO
>>> is_static(attempt_conversion("hello"))
True
>>> is_static(object())
False
)_CONVERSIONSgettyperM   rL   s    r   attempt_conversionrR      s      DK.u55r   c                 R    [        U [        5      =(       a    U R                  (       + $ )z
>>> is_static(a := Dict({'a': 1}))
True
>>> is_static(dict(a))
False
>>> is_static(b := List([1, 2, 3]))
True
>>> is_static(list(b))
False
)
isinstancer   r
   rL   s    r   	is_staticrU      s     eV$<U__)<<r   )	functoolsr   typingr   packaging.specifiers	packagingwarningsr   r   rQ   strr(   r*   tupler/   listr2   _methoddictr@   
specifiersrG   rI   rM   rO   rR   objectr   rU   
EMPTY_LIST
EMPTY_DICTr   r   r   <module>rd      s1      2 $*$ * *c *d *D	#v 		E6 	4 0G $94 0	G $9	I9''44f I CL a  S%dD$?6a 6A 6=V = = V
V
r   