
    vKgG                       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/highfloat_scraper/venv/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  [        U5         USU0S.n[        X5        S
S
S
5        U(       a+  [         R                  R                  U 5      n	[        XIX#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])r&   rC   )ospathabspathisfiler   r!   r+   _ToolsTypoInMetadataemit_ExperimentalConfigurationinclude_package_data
setdefault_ignore_errorsr-   dirnameexpand_configuration)
r   r   r?   r>   asdictproject_table
tool_tablesetuptools_tablesubsetroot_dirs
             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	,	-*\CS4TU" 
.
 77??8,#F6JQQM 
.	-s   'F66
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   rY   r?   r>   s       r    rS   rS      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)#r[      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&   dynamicrC   rD   )r6   rH   getcwdrY   r+   project_cfgr_   setuptools_cfgdynamic_cfgr?   _distset_referenced_files)selfr6   rY   r?   r>   s        r    __init___ConfigExpander.__init__   s      /BIIK!::i4''++Ir:$jj488rJ..229bA$8!
+.5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   rY   ra   r+   rd   )rg   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N)rQ   r?   )rg   	containerfield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      $ rq   )rb   r+   _expandcanonic_package_data)rg   rs   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{   rn   _EnsurePackagesDiscoveredra   rb   package_dir_expand_data_files_expand_cmdclass_expand_all_dynamicrf   updater6   )rg   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findrY   package-dirfill_package_dir )rb   r+   
isinstancelisttupledictrY   rP   rQ   r?   rx   find_packages)rg   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)rY   z
data-files)r   rx   canonic_data_filesrY   ru   rb   )rg   
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   rY   cmdclass)rY   r   rx   r   ru   rb   )rg   r   rY   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)r_   _obtainr   _obtain_entry_points_obtain_version_obtain_readme_obtain_classifiers_obtain_dependencies_obtain_optional_dependenciesitemsra   )	rg   r>   r   specialrs   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   C0C0?C5C5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   )rg   r>   rs   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   rQ   r?   rY   rf   r   rx   
read_files	read_attrr5   )rg   	specifier	directiver   r   rY   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.)rc   r   r   )rg   r>   rs   r   s       r    r   _ConfigExpander._obtain*  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   )r_   rc   rx   r   r   )rg   r>   r   s      r    r   _ConfigExpander._obtain_version4  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   )r_   rc   r   r+   r   )rg   r>   rc   s      r    r   _ConfigExpander._obtain_readme=  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rq   )r_   ).0rs   rg   s     r    	<genexpr>7_ConfigExpander._obtain_entry_points.<locals>.<genexpr>P  s     =fUDLL(fs   r   c                   > UT;   aF  TR                  U5      nU TR                  ;  a  [        [        R                  " X5      5      eUTU '   g g rq   )popr_   r   r   r4   )rs   groupvalueexpandedgroupsrg   s      r    _set_scripts:_ConfigExpander._obtain_entry_points.<locals>._set_scripts[  sH    

5),,_-D-DU-RSS"'	 rA   r   console_scriptsr   gui_scripts)rs   strr   r   )anyr   rx   entry_points)rg   r>   r   fieldsr   r   r   r   s   `     @@r    r   $_ConfigExpander._obtain_entry_pointsL  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   )r_   r   
splitlinesrg   r>   r   s      r    r   #_ConfigExpander._obtain_classifiersg  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   )r_   r   _parse_requirements_listr   s      r    r   $_ConfigExpander._obtain_dependenciesn  s1    T\\)LL~r:E/66rA   c                F   SU R                   ;  a  g SU R                  ;   ah  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.)r_   rc   r   r   r   r   r   r   )rg   r>   optional_dependencies_mapr   r   s        r    r   -_ConfigExpander._obtain_optional_dependenciesu  s    "$,,6"d&6&66(,(8(89P(Q%7>>>> )B(G(G(I	 )J$E /**HP!  )J	 	 	##D*AB	s   +B)	rd   rf   r6   r_   rc   r?   ra   rY   rb   NFN)
r6   r   rY   StrPath | Noner?   boolr>   Distribution | NonereturnNone)r   r   )rr   r   rs   r   rt   r
   )zpackage-data)r   Mapping[str, str])r>   r   r   r   )r>   r   rs   r   )r   r   r   r   )r>   r   rs   r   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__rh   rn   ru   r{   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r   rA   r    r[   r[      s     $(%*$(11 !1 #	1
 "1 
1"18
:"
PKG
)<*6G /@	)6rA   r[   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    rQ   rQ     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 rq   )superrh   _project_cfg_setuptools_cfg)rg   distributionra   rb   r   s       r    rh   "_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   )rd   r   rP   r   r   set_defaults_ignore_ext_modulesmetadatar0   r   r+   
py_modulesr   r   	__enter__)rg   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   rP   rd   r   r  r   __exit__)rg   exc_type	exc_value	tracebackr   s       r    r  "_EnsurePackagesDiscovered.__exit__  sW     	''
DJJ4G4GH''djj6K6KLwY??rA   )r   r   )r   r   ra   r   rb   r   r   r   )r   r   )r  ztype[BaseException] | Noner  zBaseException | Noner  zTracebackType | Noner   r   )	r   r   r   r   rh   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)rN   i  z``{subject}` in `pyproject.toml` is still *experimental* and likely to change in future releases.r   Nr   r   r   r   _SUMMARYr   r   rA   r    rN   rN     s    	3 rA   rN   c                      \ rS rSrSrSrg)rL   i  zNIgnoring [tools.setuptools] in pyproject.toml, did you mean [tool.setuptools]?r   Nr  r   rA   r    rL   rL     s
    X rA   rL   )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   rY   r   r?   r   r>   r   r   r   )r?   r   )3__doc__
__future__r   loggingrH   collections.abcr   
contextlibr   	functoolsr   typesr   typingr   r	   r
   _pathr   errorsr   r   warningsr   r)   r   rx   _apply_pyprojecttomlr   r   r   r=   typing_extensionsr   rl   r   	getLoggerr   r2   r!   r-   r@   r<   rS   r[   r   rQ   EnsurePackagesDiscoveredr   rN   rL   r   rA   r    <module>r%     sj  	 #  	 # %   / /  2 (  W W&,


H
%":0 "'	*
	*	* 	* 		* !& $	FFF F 	F
 FV  $!& $	RRR R 	R
 
R.Z Zz H H*@ @ @ *@Z!2 , rA   