
    'ibI                       S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJrJrJr  S	S
KJr  S	SKJrJr  S	SKJr  SSKJr  SSKJrJrJr  \(       a  SSK J!r!  SSK"J#r#  \RH                  " \%5      r&S!S jr'S"S jr( S#       S$S jjr)   S%         S&S jjr*   S'         S(S jjr+ " S S5      r,S r-\S)S j5       r. " S S\R^                  5      r0 " S S\5      r1 " S S \5      r2g)*ac  
Load setuptools configuration from ``pyproject.toml`` files.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.

To read project metadata, consider using
``build.util.project_wheel_metadata`` (https://pypi.org/project/build/).
For simple scenarios, you can also try parsing the file directly
with the help of ``tomllib`` or ``tomli``.
    )annotationsN)Mapping)contextmanager)partial)TracebackType)TYPE_CHECKINGAnyCallable   )StrPath)	FileErrorInvalidConfigError)SetuptoolsWarning   )expand)_PREVIOUSLY_DEFINED_MissingDynamicapply)SelfDistributionc                ~    SSK Jn  [        U S5       nUR                  U5      sS S S 5        $ ! , (       d  f       g = f)Nr   )tomllibrb)compat.py310r   openload)filepathr   files      ^/var/www/surfInsights/venv3-11/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py	load_filer!   $   s)    &	h	||D! 
		s   .
<c                   SSK Jn  UR                  R                  S5      n[	        US5      (       a  UR                  5          UR                  U 5      $ ! UR                   a  nSUR                   3nUR                  R                  S5      S:w  a4  [        R                  U5        [        R                  UR                  5        SUR                   S	3n[        U S
U 35      S eS nAff = f)Nr   )_validate_pyprojectztrove-classifier_disable_downloadzconfiguration error: `projectzinvalid pyproject.toml config: .
) r#   FORMAT_FUNCTIONSgethasattrr$   validateValidationErrorsummarynamestrip_loggerdebugdetails
ValueError)configr   	validatortrove_classifierexr/   errors          r    r-   r-   +   s    2 11556HI!455**,
:!!&))$$ :)"**677==*MM'"MM"**%1"''!<E7"WI./T9:s   A C-%BC((C-c                4    [        USX 5      n[        XU5      $ )z]Apply the configuration from a ``pyproject.toml`` file into an existing
distribution object.
T)read_configuration_apply)distr   ignore_option_errorsr6   s       r    apply_configurationr@   @   s       $0DKF$))    c                  ^ [         R                  R                  U 5      n [         R                  R                  U 5      (       d  [	        SU < S35      e[        U 5      =(       d    0 nUR                  S0 5      nUR                  S0 5      nUR                  S0 5      nU(       a  U(       d	  U(       d  0 $ SUR                  S0 5      ;   a  [        R                  5         SU;   a  [        R                  SS	9  U(       a*  UR                  b  UR                  SUR                  5        OUR                  SS5        XdS'   XvS'   SU;   a  [        R                  SS	9  SnXUR                  S/ 5      4m[        U4S jU 5       5      (       a  [        S5      e[        U5         USU0S.n	[        X5        S
S
S
5        U(       a+  [         R                  R!                  U 5      n
[#        XJX#5      $ U$ ! , (       d  f       NB= f)a  Read given configuration file and returns options from it as a dict.

:param str|unicode filepath: Path to configuration file in the ``pyproject.toml``
    format.

:param bool expand: Whether to expand directives and other computed values
    (i.e. post-process the given configuration)

:param bool ignore_option_errors: Whether to silently ignore
    options, values of which could not be resolved (e.g. due to exceptions
    in directives such as file:, attr:, etc.).
    If False exceptions are propagated as expected.

:param Distribution|None: Distribution object to which the configuration refers.
    If not given a dummy object will be created and discarded after the
    configuration is read. This is used for auto-discovery of packages and in the
    case a dynamic configuration (e.g. ``attr`` or ``cmdclass``) is expanded.
    When ``expand=False`` this object is simply ignored.

:rtype: dict
zConfiguration file z does not exist.r&   tool
setuptoolstools	distutilsz[tool.distutils])subjectNzinclude-package-dataTzext-modulesz[tool.setuptools.ext-modules])zimport-nameszimport-namespacesdynamicc              3  @   >#    U  H  nT  H	  o!U;   v   M     M     g 7fN ).0fieldplaceplacess      r    	<genexpr>%read_configuration.<locals>.<genexpr>   s     
Bve6%E>6>v   zSetuptools does not support `import-names` and `import-namespaces` in `pyproject.toml` yet. If your are interested in this feature,  please consider submitting a contribution via pull requests.)r&   rC   )ospathabspathisfiler   r!   r+   _ToolsTypoInMetadataemit_ExperimentalConfigurationinclude_package_data
setdefaultanyNotImplementedError_ignore_errorsr-   dirnameexpand_configuration)r   r   r?   r>   asdictproject_table
tool_tablesetuptools_tablefieldssubsetroot_dirrO   s              @r    r<   r<   L   s   6 wwx(H77>>(##-h\9IJKKx &BFJJy"-MFB'J!~~lB7-+;	vzz'2..!!#j "''0B'C ))5##$:D<U<UV##$:DA6N/|(("''0O'P2F..y"=>F

Bv
BBB!L
 	
 
,	-*\CS4TU" 
.
 77??8,#F6JQQM 
.	-s   "G11
G?c                6    [        XX#5      R                  5       $ )a  Given a configuration with unresolved fields (e.g. dynamic, cmdclass, ...)
find their final values.

:param dict config: Dict containing the configuration for the distribution
:param str root_dir: Top-level directory for the distribution/project
    (the same directory where ``pyproject.toml`` is place)
:param bool ignore_option_errors: see :func:`read_configuration`
:param Distribution|None: Distribution object to which the configuration refers.
    If not given a dummy object will be created and discarded after the
    configuration is read. Used in the case a dynamic configuration
    (e.g. ``attr`` or ``cmdclass``).

:rtype: dict
)_ConfigExpanderr   )r6   rg   r?   r>   s       r    r`   r`      s    ( 6-AHOOQQrA   c                      \ rS rSr   S         SS jjrSS jrSS jrSS jrS rS r	S	 r
SS
 jrSS jrSS jr    SS jrSS jrSS jrS S jr      S!S jrS"S jrS"S jrS"S jrSrg)#ri      Nc                   Xl         U=(       d    [        R                  " 5       U l        UR	                  S0 5      U l        U R
                  R	                  S/ 5      U l        UR	                  S0 5      R	                  S0 5      U l        U R                  R	                  S0 5      U l        X0l	        X@l
        [        [           " 5       U l        g )Nr&   rH   rC   rD   )r6   rS   getcwdrg   r+   project_cfgrH   setuptools_cfgdynamic_cfgr?   _distsetstr_referenced_files)selfr6   rg   r?   r>   s        r    __init___ConfigExpander.__init__   s      /BIIK!::i4''++Ir:$jj488rJ..229bA$8!
!$SrA   c                    SSK Jn  U R                  U R                  R	                  SS 5      S.nU R
                  =(       d    U" U5      $ )Nr   r   r0   )src_rootr0   )setuptools.distr   rg   rn   r+   rq   )ru   r   attrss      r    _ensure_dist_ConfigExpander._ensure_dist   s;    0!]]D4D4D4H4HQU4VWzz0\%00rA   c                    X!;   a+  [        U R                  5         U" X   5      X'   S S S 5        g g ! , (       d  f       g = frJ   )r^   r?   )ru   	containerrM   fns       r    _process_field_ConfigExpander._process_field   s:     9 9:#%i&6#7	  ;: ::s	   2
A c                f    U R                   R                  U0 5      n[        R                  " U5      $ rJ   )ro   r+   _expandcanonic_package_data)ru   rM   package_datas      r    _canonic_package_data%_ConfigExpander._canonic_package_data   s+    **..ub9++L99rA   c                   U R                  5         U R                  5         U R                  S5        U R                  5       n[        XR                  U R
                  5      nU nUR                  nU R                  5         U R                  U5        U R                  X5        S S S 5        UR                  R                  U R                  5        U R                  $ ! , (       d  f       N?= f)Nzexclude-package-data)_expand_packagesr   r|   _EnsurePackagesDiscoveredrn   ro   package_dir_expand_data_files_expand_cmdclass_expand_all_dynamicrt   updater6   )ru   r>   ctxensure_discoveredr   s        r    r   _ConfigExpander.expand   s    ""$""#9:   "'.>.>@S@ST%+77K##%!!+.$$T7	  	%%d&<&<={{ Ss   $?C
C*c                   U R                   R                  S5      nUb  [        U[        [        45      (       a  g UR                  S5      n[        U[
        5      (       ap  U R                  US'   U R                   R                  S0 5      US'   [        U R                  5         [        R                  " S0 UD6U R                   S'   S S S 5        g g ! , (       d  f       g = f)Npackagesfindrg   package-dirfill_package_dirrK   )ro   r+   
isinstancelisttupledictrg   r[   r^   r?   r   find_packages)ru   r   r   s      r    r    _ConfigExpander._expand_packages   s    &&**:6z(T5MBB||F#dD!!#}}D'+':':'E'EmUW'XD#$ 9 9:292G2G2O$2O##J/ ;: " ;:s   $$C
C c                    [        [        R                  U R                  S9nU R	                  U R
                  SU5        g )N)rg   z
data-files)r   r   canonic_data_filesrg   r   ro   )ru   
data_filess     r    r   "_ConfigExpander._expand_data_files   s0    W77$--P
D//zJrA   c                    U R                   n[        [        R                  XS9nU R	                  U R
                  SU5        g )N)r   rg   cmdclass)rg   r   r   r   r   ro   )ru   r   rg   r   s       r    r    _ConfigExpander._expand_cmdclass   s5    ==7++XD//XFrA   c           
        SnU R                    Vs0 s H  nXC;  d  M
  X@R                  XU5      _M     nnUR                  U R                  X5      =(       d    0 U R	                  X5      U R                  U5      U R                  U5      U R                  U5      U R                  U5      S9  UR                  5        VVs0 s H  u  pgUc  M
  Xg_M     nnnU R                  R                  U5        g s  snf s  snnf )N)versionreadmeentry-pointsscriptsgui-scriptsclassifiersdependenciesoptional-dependencies)r   r   r   r   optional_dependencies)rH   _obtainr   _obtain_entry_points_obtain_version_obtain_readme_obtain_classifiers_obtain_dependencies_obtain_optional_dependenciesitemsrn   )	ru   r>   r   specialrM   obtained_dynamickvupdatess	            r    r   #_ConfigExpander._expand_all_dynamic   s    	
 
%# :E<<[99% 	 

 	%%d8>B((;&&t,0062248"&"D"DT"J 	  	
 %5$:$:$<N$<DA414$<N(!
 Os   	C2C2 	C7C7c                p    [         U   " U5      nUc$  U R                  (       d  SU< S3n[        U5      eg g )Nz#No configuration found for dynamic z.
Some dynamic fields need to be specified via `tool.setuptools.dynamic`
others must be specified via the equivalent attribute in `setup.py`.)r   r?   r   )ru   r>   rM   previousmsgs        r    _ensure_previously_set&_ConfigExpander._ensure_previously_set  sL    &u-d3D$=$=5eY ?Y Y 
 %S)) %>rA   c                   SSK Jn  [        U R                  5         U R                  nSU;   aG  U R
                  R                  U" US   5      5        [        R                  " US   U5      sS S S 5        $ SU;   a#  [        R                  " US   X55      sS S S 5        $ [        SU SU< 35      e! , (       d  f       g = f)Nr   )always_iterabler   attrz	invalid `z`: )more_itertoolsr   r^   r?   rg   rt   r   r   
read_files	read_attrr5   )ru   	specifier	directiver   r   rg   s         r    _expand_directive!_ConfigExpander._expand_directive$  s     	3D556}}H"&&--oi>O.PQ)))F*;XF	 76
 "((6):KR 76 y3ymDEE 76 s   AB16B1B11
B?c                    X R                   ;   a#  U R                  SU 3U R                   U   U5      $ U R                  X5        g )Nztool.setuptools.dynamic.)rp   r   r   )ru   r>   rM   r   s       r    r   _ConfigExpander._obtain3  sO    $$$))*5'2  ' 
 	##D0rA   c                    SU R                   ;   a7  SU R                  ;   a'  [        R                  " U R	                  USU5      5      $ g )Nr   )rH   rp   r   r   r   )ru   r>   r   s      r    r   _ConfigExpander._obtain_version=  sA    $d6F6F)F??T9k:  rA   c                    SU R                   ;  a  g U R                  nSU;   a)  U R                  US0 5      US   R                  SS5      S.$ U R	                  US5        g )Nr   content-typez
text/x-rst)textr   )rH   rp   r   r+   r   )ru   r>   rp   s      r    r   _ConfigExpander._obtain_readmeF  sj    4<<'&&{" T8R8 +H 5 9 9., W  	##D(3rA   c                   ^ ^^ Sn[        U 4S jU 5       5      (       d  g T R                  USU5      nUc  g [        R                  " U5      mST0mS	UUU 4S jjnU" SS5        U" SS5        T$ )
N)r   r   r   c              3  @   >#    U  H  oTR                   ;   v   M     g 7frJ   )rH   )rL   rM   ru   s     r    rP   7_ConfigExpander._obtain_entry_points.<locals>.<genexpr>Y  s     =fUDLL(frR   r   c                   > UT;   aF  TR                  U5      nU TR                  ;  a  [        [        R                  " X5      5      eUTU '   g g rJ   )poprH   r   r   r4   )rM   groupvalueexpandedgroupsru   s      r    _set_scripts:_ConfigExpander._obtain_entry_points.<locals>._set_scriptsd  sH    

5),,_-D-DU-RSS"'	 rA   r   console_scriptsr   gui_scripts)rM   rs   r   rs   )r\   r   r   entry_points)ru   r>   r   re   r   r   r   r   s   `     @@r    r   $_ConfigExpander._obtain_entry_pointsU  sx     <=f===||D.+><%%d+/=v.F	( 	( 	Y 12]M2rA   c                x    SU R                   ;   a*  U R                  US0 5      nU(       a  UR                  5       $ g )Nr   )rH   r   
splitlinesru   r>   r   s      r    r   #_ConfigExpander._obtain_classifiersp  s5    DLL(LL}b9E''))rA   c                n    SU R                   ;   a%  U R                  US0 5      nU(       a  [        U5      $ g )Nr   )rH   r   _parse_requirements_listr   s      r    r   $_ConfigExpander._obtain_dependenciesw  s1    T\\)LL~r:E/66rA   c                H   SU R                   ;  a  g SU R                  ;   ai  U R                  S   n[        U[        5      (       d   eUR	                  5        VVs0 s H%  u  p4U[        U R                  SU 3U0 5      5      _M'     snn$ U R                  US5        g s  snnf )Nr   z.tool.setuptools.dynamic.optional-dependencies.)rH   rp   r   r   r   r   r   r   )ru   r>   optional_dependencies_mapr   r   s        r    r   -_ConfigExpander._obtain_optional_dependencies~  s    "$,,6"d&6&66(,(8(89P(Q%7>>>> )B(G(G(I	 )J$E /**HP!  )J	 	 	##D*AB	s   ,B)	rq   rt   r6   rH   rp   r?   rn   rg   ro   NFN)
r6   r   rg   StrPath | Noner?   boolr>   Distribution | NonereturnNone)r   r   )r   r   rM   rs   r   r
   )zpackage-data)r   Mapping[str, str])r>   r   r   r   )r>   r   rM   rs   )r   rs   r   r   )r>   r   rM   rs   r   r   )r>   r   r   zdict[str, str] | None)r>   r   r   r   r   z dict[str, dict[str, Any]] | None)r>   r   )__name__
__module____qualname____firstlineno__rv   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__rK   rA   r    ri   ri      s     $(%*$(,, !, #	,
 ", 
,"18
:"
PKG
)<*6G /@	)6rA   ri   c                    U R                  5        Vs/ s HB  nUR                  5       (       d  M  UR                  5       R                  S5      (       a  M@  UPMD     sn$ s  snf )N#)r   r1   
startswith)r   lines     r    r   r     sT     $$&&D::< 	 $

 7 7 < 	&  s   A"AAc              #     #    U (       d  S v   g  S v   g ! [          a9  n[        R                  SUR                  R                   SU 35         S nAg S nAff = f7f)Nzignored error: z - )	Exceptionr2   r3   	__class__r   )r?   r9   s     r    r^   r^     sO     H H(=(='>c"FGGHs*   A A
A/AAAAc                  l   ^  \ rS rSr        SU 4S jjrSU 4S jjr        SU 4S jjrSrU =r$ )	r   i  c                <   > [         TU ]  U5        X l        X0l        g rJ   )superrv   _project_cfg_setuptools_cfg)ru   distributionrn   ro   r   s       r    rv   "_EnsurePackagesDiscovered.__init__  s     	&'-rA   c                  > U R                   U R                  p!UR                  S0 5      nUR                  UR                  =(       d    0 5        X1l        UR
                  R                  5         UR                  R                  c*  U R                  R                  S5      UR                  l        UR                  c  UR                  S5      Ul        UR                  c  UR                  S5      Ul        [        TU ]9  5       $ )zWhen entering the context, the values of ``packages``, ``py_modules`` and
``package_dir`` that are missing in ``dist`` are copied from ``setuptools_cfg``.
r   r0   
py-modulesr   )rq   r  r[   r   r   set_defaults_ignore_ext_modulesmetadatar0   r  r+   
py_modulesr   r  	__enter__)ru   r>   cfgr   r   s       r    r  #_EnsurePackagesDiscovered.__enter__  s     JJ 4 4c&)nn]B&G4++1r2&--/ ==%!%!2!2!6!6v!>DMM??"!ggl3DO== GGJ/DMw ""rA   c                   > U R                   R                  SU R                  R                  5        U R                   R                  SU R                  R                  5        [
        TU ]  XU5      $ )zWhen exiting the context, if values of ``packages``, ``py_modules`` and
``package_dir`` are missing in ``setuptools_cfg``, copy from ``dist``.
r   r	  )r  r[   rq   r   r  r  __exit__)ru   exc_type	exc_value	tracebackr   s       r    r  "_EnsurePackagesDiscovered.__exit__  sW     	''
DJJ4G4GH''djj6K6KLwY??rA   )r  r  )r  r   rn   r   ro   r   r   r   )r   r   )r  ztype[BaseException] | Noner  zBaseException | Noner  zTracebackType | Noner   r   )	r   r   r   r   rv   r  r  r   __classcell__)r   s   @r    r   r     sc    .(.7;.MQ.	.#,@,@ (@ (	@
 
@ @rA   r   c                      \ rS rSrSrSrg)rY   i  z``{subject}` in `pyproject.toml` is still *experimental* and likely to change in future releases.rK   Nr   r   r   r   _SUMMARYr   rK   rA   r    rY   rY     s    	3 rA   rY   c                      \ rS rSrSrSrg)rW   i  zNIgnoring [tools.setuptools] in pyproject.toml, did you mean [tool.setuptools]?rK   Nr  rK   rA   r    rW   rW     s
    X rA   rW   )r   r   r   r   )r6   r   r   r   r   r   )F)r>   r   r   r   r?   r   r   r   )TFN)
r   r   r   r   r?   r   r>   r   r   zdict[str, Any]r   )
r6   r   rg   r   r?   r   r>   r   r   r   )r?   r   )3__doc__
__future__r   loggingrS   collections.abcr   
contextlibr   	functoolsr   typesr   typingr   r	   r
   _pathr   errorsr   r   warningsr   r)   r   r   _apply_pyprojecttomlr   r   r   r=   typing_extensionsr   rz   r   	getLoggerr   r2   r!   r-   r@   r<   r`   ri   r   r^   EnsurePackagesDiscoveredr   rY   rW   rK   rA   r    <module>r+     sj  	 #  	 # %   / /  2 (  W W&,


H
%":0 "'	*
	*	* 	* 		* !& $	OOO O 	O
 Oh  $!& $	RRR R 	R
 
R.Z Zz H H*@ @ @ *@Z!2 , rA   