
    Ki4                    0   S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	J
r
JrJr  S SKJrJr  S SKrSSKJrJr  SSKJr  SSKJrJrJrJr  SS	KJrJrJrJr  SS
K J!r!J"r"  \" SSS9r#SS/S.r$SS jr%SS jr&SS jr'SS jr(SS jr) " S S5      r*g)    )annotationsN)IteratorMappingSequence)AnyTypeVar   )_ctxenv)tomllib)BuildBackendExceptionBuildExceptionBuildSystemTableValidationErrorTypoWarning)ConfigSettingsDistributionStrPathSubprocessRunner)check_dependencyparse_wheel_filename_TProjectBuilderProjectBuilder)boundz setuptools.build_meta:__legacy__zsetuptools >= 40.8.0)build-backendrequiresc                    U  HO  n[         R                  " S X5      R                  5       S:  d  M.  [        R                  " SU SU S3[
        SS9  MQ     g )Ng?zFound 'z#' in pyproject.toml, did you mean 'z'?   )
stacklevel)difflibSequenceMatcherratiowarningswarnr   )
dictionaryexpectedobjs      P/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/build/_builder.py
_find_typor(   '   sO    ""47==?3FMM#A(2N     c                   [         R                  R                  U 5      (       d  SU  S3n[        U5      e[         R                  R	                  U S5      n[         R                  R	                  U S5      n[         R                  R                  U5      (       d6  [         R                  R                  U5      (       d  SU  S3n[        U5      eg g )NzSource z is not a directorypyproject.tomlzsetup.pyzF does not appear to be a Python project: no pyproject.toml or setup.py)ospathisdirr   joinexists)
source_dirmsgpyproject_tomlsetup_pys       r'   _validate_source_directoryr5   1   s    77==$$
|#67S!!WW\\*.>?Nww||J
3H77>>.))"''..2J2J
|#ijS!! 3K)r)   c                    [        U S5       n[        R                  " UR                  5       R	                  5       5      sS S S 5        $ ! , (       d  f       g = f! [
         a    0 s $ [         a-  nUR                   SUR                   S3n[        U5      S eS nAf[        R                   a  nSU  SU S3n[        U5      S eS nAff = f)Nrbz: 'z' zFailed to parse z:  )openr   loadsreaddecodeFileNotFoundErrorPermissionErrorstrerrorfilenamer   TOMLDecodeError)r-   fer2   s       r'   _read_pyproject_tomlrD   <   s    
,$==!23  	 ,C

|2.S!t+"" , b1-S!t+,sF   A 2A
 	A 

AA A C)	C2(BC1CCc                   SU ;  a  [        U S5        [        $ [        U S   5      nSU;  a  [        US5        Sn[        U5      e[	        US   [
        5      (       a  [        S US    5       5      (       d  Sn[        U5      eSU;  a  [        US5        [        S   US'   O%[	        US   [        5      (       d  Sn[        U5      eSU;   a?  [	        US   [
        5      (       a  [        S	 US    5       5      (       d  S
n[        U5      eUR                  5       1 Sk-
  nU(       a  SSR                  U5       3n[        U5      eU$ )Nzbuild-systemr   z!`requires` is a required propertyc              3  B   #    U  H  n[        U[        5      v   M     g 7fN
isinstancestr.0is     r'   	<genexpr>,_parse_build_system_table.<locals>.<genexpr>X   s      I$Bq
1c$B   z&`requires` must be an array of stringsr   z `build-backend` must be a stringbackend-pathc              3  B   #    U  H  n[        U[        5      v   M     g 7frG   rH   rK   s     r'   rN   rO   i   s     R/Q!:a%%/QrP   z*`backend-path` must be an array of strings>   r   rQ   r   zUnknown properties: z, )
r(   _DEFAULT_BACKENDdictr   rI   listallrJ   keysr/   )r3   build_system_tabler2   unknown_propss       r'   _parse_build_system_tablerZ   J   sc    ^+>>2n^<= ++%z21-c22*:6==S I$6z$BI F F 7-c2200%7 /?.O?+*?;SAA0-c22++).94@@R/A./QRRR:-c22&++-0]]M$TYY}%=$>?-c22r)   c                0   ^ ^  S       SUU 4S jjjnU$ )Nc                b   > T" X0 TR                   " 5       =(       d    0 EU=(       d    0 E5        g rG   )make_extra_environ)cmdcwdextra_environr   runners      r'   _invoke_wrapped_runner7_wrap_subprocess_runner.<locals>._invoke_wrapped_runnerw   s.     	sVS335;VATRTVWr)   NN)r^   zSequence[str]r_   
str | Noner`   zMapping[str, str] | NonereturnNone )ra   r   rb   s   `` r'   _wrap_subprocess_runnerri   v   s>    ^bXX!+XC[X	X X
 "!r)   c                     \ rS rSrSr\R                  \R                  4       SS jjr	\
\R                  4         SS jj5       r\SS j5       r\SS j5       r\SS j5       r S     SS	 jjr S     SS
 jjr S       SS jjr  S         SS jjrSS jr S         SS jjr\R.                  SS j5       rSrg)r      z
The PEP 517 consumer API.
c                   [         R                  R                  U5      U l        [	        U5        X l        X0l        [         R                  R                  US5      n[        [        U5      5      U l
        U R                  S   U l        [        R                  " U R                  U R                  U R                  R                  S5      U R
                  U R                  S9U l        g)a  
:param source_dir: The source directory
:param python_executable: The python executable where the backend lives
:param runner: Runner for backend subprocesses

The ``runner``, if provided, must accept the following arguments:

- ``cmd``: a list of strings representing the command and arguments to
  execute, as would be passed to e.g. 'subprocess.check_call'.
- ``cwd``: a string representing the working directory that must be
  used for the subprocess. Corresponds to the provided source_dir.
- ``extra_environ``: a dict mapping environment variable names to values
  which must be set for the subprocess execution.

The default runner simply calls the backend hooks in a subprocess, writing backend output
to stdout/stderr.
r+   r   rQ   )backend_pathpython_executablera   N)r,   r-   abspath_source_dirr5   _python_executable_runnerr/   rZ   rD   _build_system_backendpyproject_hooksBuildBackendHookCallerget_hook)selfr1   rn   ra   pyproject_toml_paths        r'   __init__ProjectBuilder.__init__   s    . !#
 ;":."3 ggll:7GH67KL_7`a**?;$;;MM++//?"55<<

r)   c                8    U " UUR                   [        X15      S9$ )N)r1   rn   ra   )rn   ri   )clsr   r1   ra   s       r'   from_isolated_env ProjectBuilder.from_isolated_env   s%     !!33*67
 	
r)   c                    U R                   $ )zProject source directory.)rp   ry   s    r'   r1   ProjectBuilder.source_dir   s     r)   c                    U R                   $ )z3
The Python executable used to invoke the backend.
)rq   r   s    r'   rn    ProjectBuilder.python_executable   s    
 &&&r)   c                2    [        U R                  S   5      $ )z
The dependencies defined in the ``pyproject.toml``'s
``build-system.requires`` field or the default build dependencies
if ``pyproject.toml`` is missing or ``build-system`` is undefined.
r   )setrs   r   s    r'   build_system_requires$ProjectBuilder.build_system_requires   s     4%%j122r)   Nc                    [         R                  " SU S35        SU 3n[        U R                  U5      nU R	                  U5         [        U" U5      5      sSSS5        $ ! , (       d  f       g= f)a  
Return the dependencies defined by the backend in addition to
:attr:`build_system_requires` for a given distribution.

:param distribution: Distribution to get the dependencies of
    (``sdist`` or ``wheel``)
:param config_settings: Config settings for the build backend
zGetting build dependencies for ...get_requires_for_build_N)r
   loggetattrrx   _handle_backendr   )ry   distributionconfig_settings	hook_nameget_requiress        r'   get_requires_for_build%ProjectBuilder.get_requires_for_build   s]     	2<.DE-l^<	tzz95!!),|O45 -,,s   A""
A0c                    U R                  X5      R                  U R                  5      nU VVs1 s H  n[        U5        H  oUiM     M     snn$ s  snnf )aa  
Return the dependencies which are not satisfied from the combined set of
:attr:`build_system_requires` and :meth:`get_requires_for_build` for a given
distribution.

:param distribution: Distribution to check (``sdist`` or ``wheel``)
:param config_settings: Config settings for the build backend
:returns: Set of variable-length unmet dependency tuples
)r   unionr   r   )ry   r   r   dependenciesdus         r'   check_dependencies!ProjectBuilder.check_dependencies   sM     22<QWWX\XrXrs'E<a1A!1DA1D<EEEs   Ac                    [         R                  " SU S35         U R                  SU 3UUSS9$ ! [         a4  n[	        UR
                  [        R                  5      (       a   SnAge SnAff = f)a"  
Prepare metadata for a distribution.

:param distribution: Distribution to build (must be ``wheel``)
:param output_directory: Directory to put the prepared metadata in
:param config_settings: Config settings for the build backend
:returns: The full path to the prepared metadata directory
zGetting metadata for r   prepare_metadata_for_build_F)_allow_fallbackN)r
   r   _call_backendr   rI   	exceptionru   HookMissing)ry   r   output_directoryr   r   s        r'   prepareProjectBuilder.prepare   s{     	(c:;
	%%-l^<  %	 &   % 	)--/J/JKK	s   1 
A/)A*)A**A/c                v    [         R                  " SU S35        Uc  0 OSU0nU R                  " SU 3X#40 UD6$ )a  
Build a distribution.

:param distribution: Distribution to build (``sdist`` or ``wheel``)
:param output_directory: Directory to put the built distribution in
:param config_settings: Config settings for the build backend
:param metadata_directory: If provided, should be the return value of a
    previous ``prepare`` call on the same ``distribution`` kind
:returns: The full path to the built distribution
z	Building r   metadata_directorybuild_)r
   r   r   )ry   r   r   r   r   kwargss         r'   buildProjectBuilder.build  sM    " 	9\N#./)18LN`7a!!F<."9;Kg`fggr)   c                  ^ U R                  SU5      nUb  U$ U R                  SU5      n[        [        R                  R                  U5      5      nU(       d  Sn[        U5      eUS    SUS    S3nU S3m[        R                  " U5       nUR                  UU4S	 jUR                  5        5       5        SSS5        [        R                  R                  X5      $ ! , (       d  f       N-= f)
aO  
Generate the metadata directory of a distribution and return its path.

If the backend does not support the ``prepare_metadata_for_build_wheel``
hook, a wheel will be built and the metadata will be extracted from it.

:param output_directory: Directory to put the metadata distribution in
:returns: The path of the metadata directory
wheelNzInvalid wheelr   -versionz
.dist-info/c              3  V   >#    U  H  oR                  T5      (       d  M  Uv   M      g 7frG   )
startswith)rL   membermember_prefixs     r'   rN   /ProjectBuilder.metadata_path.<locals>.<genexpr>?  s     WlF6G6G6Vls   )	))r   r   r   r,   r-   basename
ValueErrorzipfileZipFile
extractallnamelistr/   )	ry   r   metadatar   matchr2   distinfowr   s	           @r'   metadata_pathProjectBuilder.metadata_path%  s     <<)9:O 

7$45$RWW%5%5e%<=!CS/!N+,AeI.>-?zJ#*A__U#qLL WajjlW $
 ww||,77 $#s   +C""
C0c                   [         R                  R                  U5      n[        U R                  U5      n[         R                  R                  U5      (       a6  [         R                  R                  U5      (       d  SU S3n[        U5      eO[         R                  " U5        U R                  U5         U" X#40 UD6nS S S 5        [         R                  R                  UW5      $ ! , (       d  f       N.= f)NzBuild path 'z' exists and is not a directory)r,   r-   ro   r   rx   r0   r.   r   makedirsr   r/   )ry   r   outdirr   r   callbackr2   r   s           r'   r   ProjectBuilder._call_backendC  s     (4::y177>>&!!77==(($VH,KL$S)) ) KK!!),$VGGH - ww||FH-- -,s   7
C))
C7c              #  P  #     S v   g ! [         R                   a4  n[        USU R                   S3[        R
                  " 5       5      S eS nAf[        R                   a  n[        USU 35      S eS nAf[         a#  n[        U[        R
                  " 5       S9S eS nAff = f7f)Nz	Backend 'z' is not available.z0Backend subprocess exited when trying to invoke )exc_info)	ru   BackendUnavailabler   rt   sysr   
subprocessCalledProcessError	Exception)ry   hookr   s      r'   r   ProjectBuilder._handle_backendV  s     	V11 	'DMM?*=> 	
 ,, 	x'	5efjek3lmsww 	V'	CLLNKQUU	Vs<   B&	 B&B#/AB##A33B# BB##B&)rt   rs   rx   rq   rr   rp   )r1   r   rn   rJ   ra   r   rf   rg   )
r~   ztype[_TProjectBuilder]r   env.IsolatedEnvr1   r   ra   r   rf   r   )rf   rJ   )rf   set[str]rG   )r   r   r   ConfigSettings | Nonerf   r   )r   r   r   r   rf   zset[tuple[str, ...]])r   r   r   r   r   r   rf   re   rd   )
r   r   r   r   r   r   r   re   rf   rJ   )r   r   rf   rJ   )
r   rJ   r   r   r   r   r   r   rf   rJ   )r   rJ   rf   zIterator[None])__name__
__module____qualname____firstlineno____doc__r   
executableru   default_subprocess_runnerr{   classmethodr   propertyr1   rn   r   r   r   r   r   r   r   
contextlibcontextmanagerr   __static_attributes__rh   r)   r'   r   r      s    "%#2#L#L	(
(
 (
 !	(

 
(
T 
 $3#L#L	

#



 

 !	


 


 

     ' ' 3 3 266"6 /6 
	6. 26F"F /F 
	F* 26	" " /	
 
> 26)-h"h "h /	h
 'h 
h*8> Y]..&-.@U.hk.	.& V Vr)   )r$   zMapping[str, str]r%   rJ   rf   rg   )r1   r   rf   rg   )r-   r   rf   Mapping[str, Any])r3   r   rf   r   )ra   r   r   r   rf   r   )+
__future__r   r   r   r,   r   r   r"   r   collections.abcr   r   r   typingr   r   ru    r
   r   _compatr   _exceptionsr   r   r   r   _typesr   r   r   r   _utilr   r   r   rS   r(   r5   rD   rZ   ri   r   rh   r)   r'   <module>r      s    #   	  
   7 7      L K 9 -5EF  8'( ",)X"dV dVr)   