
    h/                     2   S SK r S SKrS SK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r\" \R                  " 5       S-  5      r " S	 S
5      rS rS\4S jrS\4S jrS rS rSS jrS rS rS rSS jr\S:X  a  \" 5         gg! \ a    SrS r NOf = f)    N)defaultdict   )	cythonizeextended_iglob   )is_package_dir)Optionsg      ?c                   ,    \ rS rSrS rS rS rS rSrg)	_FakePool   c                 (    [        X5       H  nM     g N)map)selffuncargs_s       P/var/www/fran/franai/venv/lib/python3.13/site-packages/Cython/Build/Cythonize.py	map_async_FakePool.map_async   s    TA !    c                     g r    r   s    r   close_FakePool.close       r   c                     g r   r   r   s    r   	terminate_FakePool.terminate   r   r   c                     g r   r   r   s    r   join_FakePool.join   r   r   r   N)	__name__
__module____qualname____firstlineno__r   r   r   r"   __static_attributes__r   r   r   r   r      s    r   r   c                     [         R                  R                  U 5      u  p[        U5      (       a<  [         R                  R                  U5      u  pU< SU< 3n[        U5      (       a  M<  X4$ )N/)ospathsplitr   )r,   base_dirpackage_pathparents       r   find_package_baser1   !   sY    WW]]40H

"
"77==2"(,7 
"
" !!r   returnc                     [        [        R                  R                  [	        U 5      5      n[        X!5      n[        [        UR                  5       5      UR                  5        g r   )
r   r+   r,   abspathr   _cython_compile_files_buildlistitemsparallel)path_patternoptions	all_pathsext_modules_by_basedirs       r   cython_compiler>   )   sE    BGGOO^L%ABI29F
4&,,./1A1ABr   c                 x   [        [        5      nU  GH  nUR                  (       a  Un[        R                  R                  U5      (       a  [        U5      (       aW  [        R                  R                  U5      n[        R                  R                  U5      (       d  ME  [        U5      (       a  MW  OS n[        R                  R                  U5      (       a#  [        R                  R                  USS5      /nOU/n[        U4UR                  UR                  UR                  UR                  UR                  UR                  UR                   UR"                  UR$                  S.	UR&                  D6nU(       d  GMs  UR(                  (       d  GM  X$   R+                  U5        GM     [-        U5      $ )Nz**z
*.{py,pyx})	nthreadsexclude_failuresexcludecompiler_directivescompile_time_envforcequietdepfilelanguage)r   r7   build_inplacer+   r,   isdirr   dirnamer"   r   r9   
keep_goingexcludes
directivesrD   rE   rF   rG   rH   r;   buildextenddict)r<   r;   ext_modules_to_buildr,   r.   pathsext_moduless          r   r5   r5   /   sI   &t,  HggmmH--1I1I77??84 ggmmH--1I1I H77==WW\\$l;<E FE%%$//$$ ' 2 2$55----OO%% oo ;7=== *11+>; > $%%r   c                    [        S U  5       5      nU(       d  g US:X  d  US:  a  [        U S   5        g  [        R                  " U5      n UR                  [        U  VVVs/ s H  u  pEU  H  odU/4PM	     M     snnn5        UR                  5         UR                  5         g ! [         a    [        5       n Nqf = fs  snnnf !   UR                  5         e = f)Nc              3   <   #    U  H  u  p[        U5      v   M     g 7fr   )len).0r   moduless      r   	<genexpr>_build.<locals>.<genexpr>U   s     >+JA3w<<+s   r   r   r   )
sumrun_distutilsmultiprocessingPoolOSErrorr   r   r   r"   r   )rT   r9   modcountpoolr.   rY   exts          r   r6   r6   T   s    >+>>H1}1k!n%##H-}7B'W7B"3(gsug{'W 	X 	

		  {'Ws/   B( C	 $C>	C	 (B?>B?C	 	Cc                     SSK Jn  U u  p#SS/n[        R
                  " 5       nS n U(       a=  [        R                  " U5        [        R                  " US9nUR                  SU/5        U" SUUS	9  U(       aZ  [        R                  " U5        U(       a<  [        R                  R                  U5      (       a  [        R                  " U5        g g g g ! [         a#     SSKJn   N! [         a    [        S5      ef = ff = f! U(       aZ  [        R                  " U5        U(       a<  [        R                  R                  U5      (       a  [        R                  " U5        f f f f = f)
Nr   )setupzL'distutils' is not available. Please install 'setuptools' for binary builds.	build_ext-i)dirz--build-tempzsetup.py)script_namescript_argsrT   )distutils.corere   ImportError
setuptoolsr+   getcwdchdirtempfilemkdtemprP   r,   rJ   shutilrmtree)r   re   r.   rT   rj   cwdtemp_dirs          r   r]   r]   k   s+   n( !H%K
))+CH(HHX''H5H9:"##	
 HHSMBGGMM(33h' 4x +  n	n( 	nlmm	nn* HHSMBGGMM(33h' 4x s*   C AD 
D!C))C??DA#E)c                   ^ SSK Jn  U" XX#SS9u  pVSSSSS	.n[        UR                  5       5       VV	s/ s H  u  pX4PM
     sn	nmU4S
 jn
UR	                  5         [        U5      S-  S:X  d   eUS   U[        U5      S-     US   pn[        U S[        U5       SU
" U5       SU
" U5       S35        XS-  :  a  [        SU
" U5       SU
" U5       S35        g g s  sn	nf )Nr   )cymeit	   )repeatg&.>gư>gMbP?g      ?)nsecusecmsecsecc                 R   > T H  u  pX:  d  M    O   [        S5      eX-  S SU 3$ )Nz"Timing is below nanoseconds: {t:f}z.3f )RuntimeError)tscaleunitscaless      r   format_timebenchmark.<locals>.format_time   s;    !KEz " CDD)S!4&))r   r   r   z loops, best of z: z per loop (median: )   z3The timings are likely unreliable. The worst time (z6) was more than four times slower than the best time (z).)Cython.Build.Inlinerw   reversedr8   sortrW   print)code
setup_codeimport_modulerN   rw   timingsnumberunitsr   r   r   fastestmedianslowestr   s                 @r   	benchmarkr      s   *T}QRSOG 4cBE/7/FG/Fum/FGF* LLNw<!q   &qz73w<13D+Ewr{WG	VH$S\N"[5I4JJ]^ijp^q]rrs
tu1*734 5**5g*>)?rC	D ! Hs   C c                     SSK Jn Jn  SSKJnJnJn  U " USS9nUR                  SSS	S
0 [        USS9  UR                  SSS	S0 [        USS9  UR                  SSSS0 [        USS9  UR                  SSSSS SS9  UR                  SSSSSS9  UR                  SSSSS S9  UR                  S!S"S#SS$S S%S9  UR                  S&S'SS(S)S*S+9  UR                  S,SS-S)S.S+9  UR                  S/S0S1S2S3/ S4S59  UR                  S6S7S8S9S S:S;9  UR                  S<S=S>S9S S?S;9  UR                  S@SASB[        S SCSD9  UR                  SESFSB[        S SGSD9  UR                  SHSISJSK[        [        SL[        =(       d    SM SN3SD9  UR                  SOSPSQS9S SRS;9  UR                  SSSTSUS9S SVS;9  UR                  SWSXS9S SYS;9  UR                  SZS[S\S9S S]S;9  UR                  S^S_S9S S`S;9  UR                  SaSbS9ScSd9  UR                  SeSfSg9  U$ )hNr   )ArgumentParserRawDescriptionHelpFormatterr   )ParseDirectivesActionParseOptionsActionParseCompileTimeEnvActiona  Environment variables:
  CYTHON_FORCE_REGEN: if set to 1, forces cythonize to regenerate the output files regardless
        of modification times and changes.
  CYTHON_CACHE_DIR: the base directory containing Cython's caches.
  Environment variables accepted by setuptools are supported to configure the C compiler and build:
  https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#compiler-and-linker-options)formatter_classepilogz-Xz--directivezNAME=VALUE,...rN   zset a compiler directive)metavardestdefaulttypeactionhelpz-Ez--compile-time-envrD   z'set a compile time environment variablez-sz--optionz
NAME=VALUEr;   zset a cythonize optionz-2language_levelstore_constz#use Python 2 syntax mode by default)r   r   constr   r   z-3   z#use Python 3 syntax mode by default)r   r   r   r   z--3strz=use Python 3 syntax mode by default (deprecated alias for -3)z-+z--cplusrH   zc++zCompile as C++ rather than Cz-az
--annotater   annotatez/Produce a colorized HTML version of the source.)r   r   r   r   z--annotate-fullcfullczZProduce a colorized HTML version of the source which includes entire generated C/C++-code.z-xz	--excludePATTERNrM   appendz2exclude certain file patterns from the compilation)r   r   r   r   r   z-bz--buildrO   
store_truez2build extension modules using distutils/setuptools)r   r   r   r   rg   z	--inplacerI   zHbuild extension modules in place using distutils/setuptools (implies -b)z--timeitr   
CODESTRINGzabuild in place, then compile+run CODESTRING as benchmark in first module's namespace (implies -i))r   r   r   r   r   z--setupbenchmark_setupz6use CODESTRING as pre-benchmark setup code for --benchz-jz
--parallelr9   Nz(run builds in N parallel jobs (default: r   r   z-fz--forcerE   zforce recompilationz-qz--quietrF   z"be less verbose during compilationz	--lenientlenientzBincrease Python compatibility by ignoring some compile time errorsz-kz--keep-goingrL   z8compile as much as possible, ignore compilation failuresz--no-docstringsno_docstringszstrip docstringsz-Mz	--depfilez produce depfiles for the sources)r   r   sources*)nargs)argparser   r   Compiler.CmdLiner   r   r   add_argumentstrintparallel_compiles)r   r   r   r   r   parsers         r   create_args_parserr      s3   Dgg3a	F m5E'#25  7 2<L-r6D  F j,$bs/3  5 #3MQR\`@  B
#3MQR@  B
'7UVZ  \
ijV[ei;  =
l=	XbL  N
*=V`I  J k9:%rO  Q iglTXO  Q
k^be  g 
lQT^b~  @
	(9<VYcgS  U lS(9EFWF\[\E]]^_  a iglTX0  2
iglTX?  A )LRV_  a
n<^bU  W
)^b-  /
k,Egh
	-Mr   c                     U R                  U5      u  p#UR                  nU H@  nUR                  S5      (       a  U R                  SU-   5        M/  UR	                  U5        MB     U?X$4$ )N-zunknown option )parse_known_argsr   
startswitherrorr   )r   r   r;   unknownr   options         r   parse_args_rawr      si    ..t4GooG S!!LL*612NN6"	 
 	r   c                 &   [        5       n[        X5      u  p UR                  b  SUl        OU (       d  UR	                  S5        UR                  (       a  SUl        [        c  SUl        UR                  (       a+  UR                  S;   d   eUR                  UR                  S'   UR                  (       a  S[        l        S[        l        UR                  (       a  UR                  [        l        UR                  (       a  S[        l        X 4$ )NTzno source files providedr   )r   r   3strr   F)r   r   r   rI   r   rO   r^   r9   r   r;   r   r	   error_on_unknown_nameserror_on_uninitializedr   r   
docstrings)r   r   r;   s      r   
parse_argsr      s    !F"60MG$ $/0%%777,3,B,B()).&).&"++"=r   c                 L   [        U 5      u  p/ nU H  n[        U5       Vs/ s H"  n[        R                  R	                  U5      PM$     nnU(       dF  SS Kn[        SR                  UR                  S   U5      UR                  S9  UR                  S5        UR                  U5        M     [        X15      nU(       a>  UR                  (       a-  [        [        UR!                  5       5      UR"                  5        UR$                  b  S =pU(       a(  UR'                  5       u  pU(       a  US   R(                  n
SS KnU	b  UR                  R+                  SU	5        [%        UR$                  UR,                  U
S9  U	b  UR                  R/                  U	5        g g g s  snf )Nr   z#{}: No such file or directory: '{}')filer   )r   )r   r   r+   r,   r4   sysr   formatargvstderrexitrP   r5   rO   r6   r7   r8   r9   r   popitemnameinsertr   remove)r   r;   rS   r<   r,   pexpanded_pathr   r=   r.   r   first_extensionss               r   mainr     sZ   %NGI5CD5IJ5I+5IJ7>>sxx{DQX[XbXbcHHQK'  39F'--t*0023W5E5EF$#''!)?)G)G)I&H 0 3 8 8HHOOAx(w66'	

 HHOOH%  ! % Ks   )F!__main__)NNNr   )r+   rr   rp   collectionsr   Dependenciesr   r   Utilsr   Compilerr	   r^   r   	cpu_countr   rl   r   r1   rQ   r>   r5   r6   r]   r   r   r   r   r   r$   r   r   r   <module>r      s    	   # 3 " O557#=> "CT C"& "&J.(<D<FR>"&J zF k	  Os   B	 	
BB