
    hD                     (   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  S SKJ	r	  S SK
Jr  SSKJrJr  S SKJr   S SKrSS	KJr  SS
KJrJrJrJrJrJr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#  \" \RH                  RJ                  5      r&\" \5      r'\" \5      r(S4S jr)S r*S5S jr+S r,S r-\." 5       r/\." 5       r0\." 5       r1\2\3\3\3\0\0\0\0\3\0\0\3\0\/\1S.r4S r5 " S S5      r6\ Rn                  " \.\Rp                  " S\Rr                  5      Rt                  5      r;\ Rn                  " \.\Rp                  " S\Rr                  5      Rt                  5      r<\ Rn                  " \.\Rp                  " S\Rr                  5      Rt                  5      r=S6S\2S\24S jjr>\Rp                  " S\R~                  \Rr                  -  5      r@\Rp                  " S\R~                  \Rr                  -  5      rAS  rB\S! 5       rCS" rD\S# 5       rE\S$ 5       rF\S% 5       rG\S& 5       rH " S' S(5      rISqJS7S) jrKS* rL  S8S+ jrM  S9S, jrNS- rO\R                  R                  S.5      (       a  \R                  S.   rRS/ rSOS0 rS\S    S:S1 j5       rTS2 rUS3 rVg!   Sr GNS= f);    N)iglob)StringIO)relpath   )CacheFingerprintFlags)Iterable   )Utils)cached_functioncached_methodpath_existssafe_makedirscopy_file_to_dir_if_neweris_package_dirwrite_depfile)Errors)Context)Options)CompilationOptionsdefault_optionsget_directive_defaultsc                 (   U(       d  [         R                  " 5       nUS   [         R                  R                  :w  a  U[         R                  R                  -  nU  Vs/ s H&  nUR	                  U5      (       a  [        X!5      OUPM(     sn$ s  snf )N)osgetcwdpathsep
startswith_relpath)
file_pathsbaser   s      S/var/www/fran/franai/venv/lib/python3.13/site-packages/Cython/Build/Dependencies.py_make_relativer$       ss    yy{Bx277;;"$" %)OOD$9$9HT tC"$ $ $s   -Bc           	   #     #    SU ;   ae  [         R                  " SU 5      nU(       aG  UR                  5       u  p#nUR                  S5       H  n[	        X%-   U-   5       H  nUv   M	     M      g SU ;   d  [
        R                  S:X  a  SU ;   a  [        5       n[         R                  " S[
        R                  S:X  a  SOS	-  U S
5      u  pU(       a  [        U[
        R                  -   5      nOS/nU Ht  n
[	        [        X5      5       H  nXg;  d  M
  UR                  U5        Uv   M!     [	        [        U
SSU	5      5       H  nXg;  d  M
  UR                  U5        Uv   M!     Mv     g [        U 5       H  nUv   M	     g 7f)N{z(.*){([^}]+)}(.*),z**/\z**\z\*\*[%s]z/\\/r    *z**)rematchgroupssplitextended_iglobr   r   setr   	join_pathadd)patternmbeforeswitchaftercaser   seenfirstrestroots              r#   r0   r0   )   sE    
g~HH('2$%HHJ!FES)*6=5+@ADJ B *  266T>f.?uhh{4gSQSZ\]^%"&&.)EDED&y'<=#HHTNJ > 'ysD$'GH#HHTNJ I  'NDJ #s   DF6F5Fc              #   R   #    SnU  H	  nSnUv   M     U(       a  [        U5      eg 7f)NTF)
ValueError)it	error_msgemptyvalues       r#   nonemptyrD   J   s3     E  ## s   %'c                    [         c  [        S5      e [         R                  R                  SS9nU R
                  R                  US   5        U R                  R                  US   5        U R                  R                  US   5        U R                  R                  US   5        U R                  R                  US   5        U R                  R                  US	   5        U R                  R                  US
   5        SU l        S H  n U R                  R                  U5        M!     g ! [         a"    [         R                  R                  5       n GN*f = f! [         a     M`  f = f)NzBYou first need to install Pythran to use the np_pythran directive.T)pythoninclude_dirsextra_compile_argsextra_link_argsdefine_macrosundef_macroslibrary_dirs	librariesc++)z-fwhole-programz-fvisibility=hidden)pythranRuntimeErrorconfigmake_extension	TypeErrorrG   extendrH   rI   rJ   rK   rL   rM   languageremover?   )extpythran_ext
bad_options      r#   update_pythran_extensionrZ   S   sD   _``6nn3343@ K78!!+.B"CD{+<=>[9:K78K78MM[12CL A
	""))*5 A  6nn3356   		s#   D0 E0(EE
E-,E-c                   ^ [        U 5      S:  a  U S   S:X  a  U S   S:X  a  U SS n SnOSn[        U 5      u  n mU4S	 jnU R                  U5       Vs/ s H!  o3R                  5       (       d  M  U" U5      PM#     sn$ s  snf )
z
>>> parse_list("")
[]
>>> parse_list("a")
['a']
>>> parse_list("a b c")
['a', 'b', 'c']
>>> parse_list("[a, b, c]")
['a', 'b', 'c']
>>> parse_list('a " " b')
['a', ' ', 'b']
>>> parse_list('[a, ",a", "a,", ",", ]')
['a', ',a', 'a,', ',']
r
   r   [r   ]r   r'    c                 J   > U R                  5       n U S   S;   a  TU SS    $ U $ )Nr   z'"r   r   strip)literalliteralss    r#   unquoteparse_list.<locals>.unquote   s0    --/1:GAbM**N    )lenstrip_string_literalsr/   ra   )s	delimiterrd   itemrc   s       @r#   
parse_listrl   l   s}     1v{qts{qu|aG		'*KAx '(ggi&8I&8dJJLMGDM&8IIIs   A?0A?)namesourcesrJ   rK   rM   rL   runtime_library_dirsrG   extra_objectsrH   rI   export_symbolsdependsrU   
np_pythranc                     U S:X  a  gU S:X  a  gSS K nUR                  S[        S9  U R                  5       n U S;   a  gU S	;   a  g[	        S
U < 35      e)NTrueTFalseFr   z1The 'np_python' option requires 'True' or 'False')category)yyesttrueon1)nnoffalseoff0zinvalid truth value )warningswarnDeprecationWarninglowerr?   )valr   s     r#   _legacy_strtoboolr      s\    
f}	MMEPbMc
))+C
22	5	5S:;;rf   c                   0    \ rS rSrSS jrS rS rS rSrg)	DistutilsInfo   Nc           
      v  ^ 0 U l         UGbg  [        U[        5      (       a  [        U5      OUnU GH=  mTR	                  5       mT(       d  M  TS   S:w  a    g TSS  R	                  5       m[        U4S jS 5       S 5      nUc  MV  T[        U5      S  R                  S5       Vs/ s H  oUR                  5       PM     snu  pgn[        R                  US 5      n	TR                  S5      (       a  U	c  M  U	[        [        4;   aF  [        U5      nUS:X  a5  U V
s/ s H(  n
SU
;   a  [        U
R!                  SS5      5      OU
S 4PM*     nn
U	["        L a  [%        U5      nXR                   U'   GM@     g Ub9  [         H.  nUS	;   a  M  ['        X&S 5      nU(       d  M   XR                   U'   M0     g g s  snf s  sn
f )
Nr   #r   c              3   X   >#    U  H  nTR                  U5      (       d  M  Uv   M!     g 7fN)r   ).0klines     r#   	<genexpr>)DistutilsInfo.__init__.<locals>.<genexpr>   s!     W(@1DOOTUDVQQ(@s   *	*)z
distutils:cython:=r   rJ   )rm   rn   rs   )values
isinstancestrr   lstripnextrg   	partitionra   distutils_settingsgetr   listtransitive_listrl   tupler/   bool_orr   getattr)selfsourceexnsource_lineskindri   key_rC   typemacror   s              @r#   __init__DistutilsInfo.__init__   s   /9&#/F/F8F+FL${{}7c>ABx(W(@WY]^#8<SYZ8H8R8RSV8W$X8W1WWY8W$XMCE-11#t<Dy11dlHo66 *5 1/1 38%927 ),u &+5;;sA+>%?;@$-&H27 " %9 w 1% 8',KK$) %* _)::$/5',KK$ *  %Y%9s   &F1/F6c                    Uc  U $ UR                   R                  5        H  u  p#[        U   nU[        L a  X R                   ;  a  X0R                   U'   M6  U[        L aT  X R                   ;   a5  U R                   U   S S  nU H  nXe;  d  M
  UR                  U5        M     UnX0R                   U'   M  U[        L d  M  U R                   R                  US5      U-  U R                   U'   M     U $ NF)r   itemsr   transitive_strr   appendr   r   )r   otherr   rC   r   allvs          r#   mergeDistutilsInfo.merge   s    =K,,,,.JC%c*D~%#[[*@#(C (++%++c*1-C"<JJqM #  E#(C #';;??3#>#FC  / rf   c                 P   Uc  U $ [        5       nU R                  R                  5        Hx  u  p4[        U   nU[        [
        4;   aC  / nU H8  nXq;   a  X   n[        U[        5      (       a  Xg-  nM'  UR                  U5        M:     UnO	XA;   a  X   nXBR                  U'   Mz     U$ r   )r   r   r   r   r   r   r   r   )r   aliasesresolvedr   rC   r   new_value_listr   s           r#   subsDistutilsInfo.subs   s    ?K ?++++-JC%c*Do..!#A|#J!!T**&+&--a0  '##NE#(OOC  .  rf   c                     U R                   R                  5        HA  u  p#[        U   nU[        [        4;   a  [        X5      [        U5      -   n[        XU5        MC     g r   )r   r   r   r   r   r   setattr)r   	extensionr   rC   r   s        r#   applyDistutilsInfo.apply   sO    ++++-JC%c*Do..	/$u+=IE*	 .rf   )r   NN)	__name__
__module____qualname____firstlineno__r   r   r   r   __static_attributes__ rf   r#   r   r      s    -B(,+rf   r   z]
    (?P<comment> [#] ) |
    (?P<brace> [{}] ) |
    (?P<fstring> f )? (?P<quote> '+ | "+ )
z`
    (?P<escape> [\\]+ ) (?P<escaped_quote> ['"] ) |
    (?P<fstring> f )? (?P<quote> '+ | "+ )
z
    (?P<braces> [{]+ | [}]+ ) |
    (?P<escape> [\\]+ ) (?P<escaped_quote> ['"] ) |
    (?P<fstring> f )? (?P<quote> '+ | "+ )
codeprefixc                 t  ^ ^^^^^^^^ / m0 mSm[         mUUUU4S jmS[        S[        R                  S[        R                  S[        R                  4UU UU4S jjmSS[        R                  S[        R                  S[        R                  4UU UUUU4S	 jjjmT" S5        S
R                  T5      T4$ )z
Normalizes every string literal to be of the form '__Pyx_Lxxx',
returning the normalized code and a mapping of labels to
string literals.
r   c                 J   > TS-  mT T S3nU TU'   TR                  U5        g )Nr   r   )r   )rb   labelcounterrc   new_coder   s     r#   append_new_label/strip_string_literals.<locals>.append_new_label%  s1    1(7)1%!rf   
quote_typestart
is_fstringreturnc                   > UnU(       a  [         O[        nUS:w  Ga$  U" TU5      nUc  T" TUS  5        Sn U$ UR                  5       nUS   (       a'  [        US   5      S-  S:X  a  US   U S   :X  a  US-  nOU(       a\  US   (       aR  [        US   5      S-  S:X  a  M  US   S   S:X  a.  XS-
  :  a  T" TXS-
   5        TR	                  S5        T	" US	S
9=pO[US   R                  U 5      (       aB  UR                  S5      nX1:  a
  T" TX 5        TR	                  U 5        U[        U 5      -  n U$ US:w  a  GM$  U$ )Nr   escaper
   r   escaped_quoter   bracesr&   T
in_fstringquote)_FIND_FSTRING_TOKEN_FIND_STRING_TOKENendrg   r   r   r   )
r   r   r   charpos
find_tokentokenr   r   r   
parse_codes
         r#   parse_string+strip_string_literals.<locals>.parse_string,  s`   %*,6(<N
mtW-E} ef.8 7 iikGXuX'!+q0U?5KzZ[}5\qLGhuX'!+q0?2&#-qy((eai)@AOOC(&0T&JJEw**:66++g.?$T%%:;
+3z?*E mD rf   r   c                 (  > U nUS:w  Ga  T" TU5      nUc  T	R                  TU S  5        Sn U$ UR                  5       =p$US   (       a  US   n[        U5      S:  a  US [        U5      S-   nU(       aR  [        U5      S:w  aC  [        U5      S:  a  U[        U5      S-
  -  nUS S nT	R                  TX 5        T" XTUS   S9=pOUS   (       aC  T	R                  TX 5        TR                  S	U5      nT" TXBS:w  a  UOS  5        US:X  a   U$ Un OrU(       ak  US
   (       aa  US
   S:X  a*  UR	                  5       S-   =p$T	R                  TX 5         U$ UR	                  5       S-   nT	R                  TX 5        T
" USS9=pUS:w  a  GM  U$ )Nr   r      r
      fstring)r   comment
brace}r   Tr   )r   r   rg   findr   )r   r   r   r   r   r   r   r   r   r   r   r   s         r#   r   )strip_string_literals.<locals>.parse_codeU  s   %* mtW-E}UV-F E "IIK'GW~gu:?!/3u:>2ESZ1_5zA~s5zA~- %bq	OODO4&25%PYJZ&[[Ey!U0))D#. c"}G$!OPb=   g>S($)KKMA$55GOODO4 	  ++-!+COODO4&0&FFEM mP rf   r*   F)_FIND_TOKENr   cython
Py_ssize_tbintjoin)	r   r   r   r   r   rc   r   r   r   s	   ``@@@@@@@r#   rh   rh     s     HH!"GJ ' 'V->-> 'FKK '\b\m\m ' 'R-&++ - -QWQbQb - -^ qM778h&&rf   a  (?:^ [ \t\f]* from     [ \t\f]+ cython\.cimports\.([\w.]+) [ \t\f]+ c?import ) |(?:^ [ \t\f]* from     [ \t\f]+ ([\w.]+) [ \t\f]+ cimport ) |(?:^ [ \t\f]* c?import [ \t\f]+ cython\.cimports\.([\w.]+) ) |(?:^ [ \t\f]* cimport  [ \t\f]+ ([\w.]+ (?:[ \t\f]* , [ \t\f]* [\w.]+)*) ) |(?:^ [ \t\f]* cdef     [ \t\f]+ extern [ \t\f]+ from [ \t\f]+ ['\"] ([^'\"]+) ['\"] ) |(?:^ [ \t\f]* include  [ \t\f]+ ['\"] ([^'\"]+) ['\"] )zf(?:^ [ \t\f]+ \( ([\w., \t\f]*) \) [ \t\f]* [#\n]) |(?:^ [ \t\f]+    ([\w., \t\f]*)    [ \t\f]* [#\n])c                 x    [        [        R                  R                  U 5      [	        [        U5      5      5      $ r   )normalize_existing0r   r   dirnamer   r1   )	base_path	rel_pathss     r#   normalize_existingr     s%    rwwy95Y;PQQrf   c                 L   / nSnU H  n[         R                  R                  U5      (       a  UR                  U5        M:  [	        X5      n[        U5      (       a2  UR                  [         R                  R                  U5      5        U nM  UR                  U5        M     X#4$ )a  
Given some base directory ``base_dir`` and a list of path names
``rel_paths``, normalize each relative path name ``rel`` by
replacing it by ``os.path.join(base, rel)`` if that file exists.

Return a couple ``(normalized, needed_base)`` where ``normalized``
if the list of normalized file names and ``needed_base`` is
``base_dir`` if we actually needed ``base_dir``. If no paths were
changed (for example, if all paths were already absolute), then
``needed_base`` is ``None``.
N)r   r   isabsr   r2   r   normpath)base_dirr   
normalizedneeded_baserelr   s         r#   r   r     s     JK77==c"'tbgg..t45"Kc"  $$rf   c                 t    [        U5      n/ nU  H$  n[        X15      nUc  M  UR                  U5        M&     U$ r   )r   resolve_dependr   )rr   rG   r   dependr   s        r#   resolve_dependsr	    s>    &LHf3OOD!  Orf   c                     U S   S:X  a
  U S   S:X  a  g U H?  n[        X 5      n[        U5      (       d  M   [        R                  R	                  U5      s  $    g )Nr   <r   >)r2   r   r   r   r  )r  rG   dirr   s       r#   r  r    sU    ayCF2J#-%t77##D))  rf   c                    [         R                  R                  [         R                  R                  [	        U 5      5      5      nX:w  a<  [        U5      (       a,  [        U5      [         R                  R                  U5      4-   $ g)Nr   )r   r   r   abspathr   r   packagebasename)filenamer  s     r#   r  r    sX    
''//"''//#h-8
9C
>#..s|rww//4666rf   c                     [         R                  R                  [         R                  R                  U 5      5      S   nSR	                  [        U 5      U4-   5      $ )Nr   .)r   r   splitextr  r   r  )r  modules     r#   fully_qualified_namer    sE    WWbgg..x89!<F88GH%	122rf   c                 n  ^ [         R                  " U SS9 nUR                  5       nS S S 5        [        W5      n[	        U5      u  p$UR                  SS5      R                  SS5      n/ n/ n/ n[        R                  U5       GH  nUR                  5       u  n	mppU	(       a  U	mU
(       a  U
nT(       a  UR                  T5        [        R                  X(R                  5       S9nU(       aJ  UR                  5       u  nnU=(       d    UnUR                  U4S jUR                  S5       5       5        M  M  U(       a)  UR                  S	 UR                  S5       5       5        M  U(       a  UR                  XL   5        GM  UR                  XM   5        GM     XVXs4$ ! , (       d  f       GN= f)
Nignore)error_handlingz\
r^   	)posc              3   d   >#    U  H%  nS R                  TUR                  5       5      v   M'     g7f)z{}.{}N)formatra   )r   ri   cimport_froms     r#   r   %parse_dependencies.<locals>.<genexpr>  s-       @)>A !(|QWWY G G)>s   -0r'   c              3   @   #    U  H  oR                  5       v   M     g 7fr   r`   )r   xs     r#   r   r     s     G/F!GGII/Fs   )r   open_source_filereadr   rh   replacedependency_regexfinditerr.   r   dependency_after_from_regexsearchr   rT   r/   )source_filenamefhr   distutils_inforc   cimportsincludesexternsr5   pycimports_frompycimports_listcimport_listexternincludem_after_from	multilineone_line
subimportsr  s                     @r#   parse_dependenciesr9    sx   
 
			IR 
J"6*N,V4F^^FC(00s;F HHG&&v.XYX`X`XbUf*L*LOOL)6==f%%'=RL&2&9&9&;#	8&2(
  @)3)9)9#)> @ @  OOG|/A/A#/FGGNN8+,OOH-.+ /, w66A 
J	Is   F%%
F4c                       \ rS rSrSS jrS r\S 5       r\S 5       rS r	S r
S r\SS
 j5       r\S 5       r\S 5       rS r\S 5       rS rS rS rSS jrS rS rSrg	)DependencyTreei  c                 *    Xl         X l        0 U l        g r   )contextquiet_transitive_cache)r   r=  r>  s      r#   r   DependencyTree.__init__  s    
!#rf   c                 v    [        U5      (       a  [        R                  R                  U5      n[	        U5      $ r   )r   r   r   r  r9  )r   r*  s     r#   r9  !DependencyTree.parse_dependencies  s,    '' gg..?O!/22rf   c                 6   [        5       nU R                  U5      S    H  n[        [        R                  R                  U5      U5      n[        U5      (       d  U R                  R                  X1S9nU(       as  S[        R                  R                  -   U;   a  [        R                  R                  U5      nUR                  U5        UR                  U R                  U5      5        M  U R                  (       a  M  [        SU< SU< S35        M     U$ )Nr   source_file_pathr  zUnable to locate 'z' referenced from '')r1   r9  r2   r   r   r   r   r=  find_include_filer   r  r3   updateincluded_filesr>  print)r   r  r   r4  include_paths        r#   rI  DependencyTree.included_files  s     e..x8;G$RWW__X%>HL|,,#||==g=a$4#%77#3#3L#AL%

4..|<=ZZZhPWXY < 
rf   c                    U R                  U5      S S u  p#n[        U5      n[        U5      n[        5       nU R                  U5       HJ  nU R                  U5      u  pxn	UR	                  U5        UR	                  U5        UR	                  U	5        ML     [        X5      u  pJU
(       a  UR                  U
5        [        U5      XE4$ )Nr   )r9  r1   rI  cimports_externs_incdirsrH  r   r3   r   )r   r  r-  r.  r/  incdirsr4  included_cimportsincluded_externsincluded_incdirsincdirs              r#   rN  'DependencyTree.cimports_externs_incdirs#  s     '+&=&=h&G&K#Gx=g,%**84GDHDaDabiDjA1AOO-.NN+,NN+,	 5
 -X?KKX00rf   c                 *    U R                  U5      S   $ Nr   )rN  r   r  s     r#   r-  DependencyTree.cimports5  s    ,,X6q99rf   c                     [        U5      $ r   )r  rW  s     r#   r  DependencyTree.package8  s    x  rf   c                     [        U5      $ r   )r  rW  s     r#   r  #DependencyTree.fully_qualified_name;  s    #H--rf   Nc                 (   US   S:H  nU(       a  U(       d  [        S5      eUb  UR                  S5      nU(       a  UR                  S5        [        U R	                  U5      5      nU(       a?  US   (       d5   UR                  5         UR                  S5        U(       a  US   (       d  M5  SR                  XT-   5      nU R                  R                  XbS9nU(       a  U$ U(       a  g U R                  R                  XS9$ ! [
         a     g f = f)Nr   r  zNew relative imports.rD  )	NotImplementedErrorr/   popr   r  
IndexErrorr   r=  find_pxd_file)r   r  r  is_relativemodule_pathpackage_pathrelativepxds           r#   find_pxdDependencyTree.find_pxd>  s    Qi3&x%&=>> ,,s+K"X 67Lk!n  $$& " k!nn xx :;H,,,,X,QC
||))&)LL "   s   :D 
DDc                 >   [         R                  R                  U5      u  p#US;   a  [        US-   5      (       a  US-   /nO/ nU R	                  U5       H;  nUS S S:X  d  US:X  a  M  U R                  XQ5      nUc  M*  UR                  U5        M=     [        U5      $ )N.pyx.pyz.pxd   zcython.r   )r   r   r  r   r-  rg  r   r   )r   r  filename_rootfilename_extpxd_listr  pxd_files          r#   cimported_filesDependencyTree.cimported_filesV  s    &(gg&6&6x&@#?*{=6;Q/R/R%./HH mmH-FbqzY&&H*<}}V6H#) . Xrf   c                     U1nUR                  U R                  U5      5        UR                  U R                  U5      5        U$ r   )rH  rr  rI  )r   r  all_depss      r#   immediate_dependencies%DependencyTree.immediate_dependenciesg  s<    :,,X67++H56rf   c                 V    U R                  XR                  [        R                  5      $ r   )transitive_mergerv  r1   unionrW  s     r#   all_dependenciesDependencyTree.all_dependenciesn  s    $$X/J/JCIIVVrf   c                 @    [         R                  R                  U5      $ r   )r   r   getmtimerW  s     r#   	timestampDependencyTree.timestampq  s    ww))rf   c                 (    U R                  U5      U4$ r   )r  rW  s     r#   extract_timestamp DependencyTree.extract_timestampu  s    ~~h'11rf   c                 ~    [        U R                  U5       Vs/ s H  o R                  U5      PM     sn5      $ s  snf r   )maxr{  r  )r   r  r   s      r#   newest_dependency DependencyTree.newest_dependencyx  s5    t7L7LX7VW7V!**1-7VWXXWs   :c                    U R                  U5      S   nUR                  nU R                  U5      u  pEn[        R                  " 5       nU(       aI  [        XW5      nSU;   a*  [        [        US   5      R                  U5      5      US'   O[        U5      US'   U(       aI  [        UR                  S/ 5      5      n[        Xg5       H  n	X;  d  M
  UR                  U	5        M     XS'   U$ )Nr   rr   rG   )r9  r   rN  r   r   r$   r   r1   rz  r   r   )
r   r  infokwdsr-  r/  rO  basedirrG   incs
             r#   distutils_info0DependencyTree.distutils_info0{  s    &&x03{{%)%B%B8%L"7))+$W6GD "&s4	?';'A'A''J"KY"&w-Y  <=L%g7* '', 8 $0 rf   c                     U R                  XR                  [        R                  5      R	                  U5      R                  U5      $ r   )ry  r  r   r   r   )r   r  r   r"   s       r#   r,  DependencyTree.distutils_info  s5    %%h0D0DmFYFYZT']U4[	rf   c                      U R                   X#4   nU R                  XX40 U R                  5      S   $ ! [         a    0 =o@R                   X#4'    N>f = frV  )r?  KeyErrortransitive_merge_helperrr  )r   nodeextractr   r:   s        r#   ry  DependencyTree.transitive_merge  sn    	?))'.9D ++5D,@,@BBCE 	E  	?<>>D))'.9	?s   3 AAc           	      
   X;   a  XA   S 4$ U" U5      nX;   a  Xq4$  [        U5      XQ'   S nU" U5       H3  n	U R                  XX4XV5      u  pUb  Ub  XX   X[   :  a  OUnU" Xz5      nM5     X:X  a  S nUc  XtU'   Xx4XQ	 $ ! XQ	 f = fr   )rg   r  )r   r  r  r   r:   stackoutgoingdepsloopr   sub_depssub_loops               r#   r  &DependencyTree.transitive_merge_helper  s    <:t##t}=:	e*EKD %)%A%A$QV^c%n"''EK%/,I'T, ' ||!T
:s   AA> >B)r?  r=  r>  r   r   r   )r   r   r   r   r   r9  r   rI  rN  r-  r  r  rg  rr  rv  r{  r  r  r  r  r,  ry  r  r   r   rf   r#   r;  r;    s    $
3
  " 1 1":!. M M.     W * *2Y,
Erf   r;  c                 v    [         c-  U c!  [        S/[        5       [        [        5      S9n [        XS9q [         $ )Nr  )optionsr>  )	_dep_treer   r   r   r   r;  )ctxr>  s     r#   create_dependency_treer    s:    ;3%!7!9"4_"EGC"34	rf   c                 (   SU;   aH  UR                  S/ 5      S/-   n[        US   U5      n[        [        X0R                  -   5      5      US'   U R
                  nU" S0 UD6n[        U S5      (       a  U R                  Ul        [        XS   S9nXV4$ )Nrr   rG   r  py_limited_apirm   )	distutilsmodule_namer   )	r   r	  sortedr1   rr   	__class__hasattrr  dict)templater  rG   rr   rz   rW   metadatas          r#   default_create_extensionr    s    Dxx3se;!$y/<@ W/?/?%?!@AYA
)d)Cx)**%44dV=H?rf   c                    Ub  [        SR                  U5      5        Uc  / nU c  / 0 4$ [        U [        5      (       d  [        U [        5      (       d  U /n SSKJn  S[        R                  ;   a<  U[        R                  S   R                  [        R                  S   R                  4nOU4nU  V	s1 s H!  n	[        X5      (       d  M  U	R                  iM#     n
n	[        X$S9nUR                  n[        5       n[        U[        5      (       d  U/nU H?  nUR                  [!        ["        R$                  R&                  [)        U5      5      5        MA     / n0 nUR*                  R,                  =(       d    [.        n[        5       nU  GH  n[        U[        5      (       a  UnU" U/ 5      nSnS nUnGO[        X5      (       GaK  UR0                   Vs/ s H-  n["        R$                  R3                  U5      S   S	;   d  M+  UPM/     nnU(       a3  US   n[5        U5      S:  a  [        S
UR                  < SU< S35        OU(       a  UR                  U:X  a  U" U[7        UUR0                  =(       d6    UR9                  S["        R:                  5      UR<                  S:X  a  SOS-   /UR<                  S95      u  n	nSU	l        S U	l        URA                  U	5        GMZ  URA                  U5        GMn  UnUR                  n[C        US9nS nO>[        S[E        U5      < S[G        U5      < SURH                  < 35      n[K        U5      e[M        [O        [)        U5      5      SU-  5       GH2  n["        R$                  R'                  U5      U;   a  M)  URQ                  U5      nSU;   a	  UU
;   a  MH  O	U(       a  Un[R        RT                  " U5        UU;  d  Mp   URW                  UUU5      RX                  nUb1  URX                  R]                  5        H  u  nn UU;  d  M  U UU'   M     UUS'   U/UR0                   V	s/ s H  oU:w  d  M
  U	PM     sn	-   n!SU;   a%  US    H  n"U"U!;  d  M  U!RA                  U"5        M     U!US'   U(       a  SU;  a  UUS'   UR_                  SS5      n#U" UU5      u  n	n$U#=(       d    [a        U	SS5      U	l        Xl        U	R>                  (       a  [c        U	5        URA                  U	5        U$UU'   UU	R0                  ;  ao  ["        R$                  R3                  U5      S   U	R<                  S:X  a  SOS-   n% U	R0                  Re                  U%5        U	R0                  Ri                  SU5        URk                  U5        GM5     GM!     UU4$ s  sn	f s  snf ! [Z         a    U(       a   GM_  e f = fs  sn	f ! [f         a    [        SU-  5         N~f = f)NzWarning: passing language={0!r} to cythonize() is deprecated. Instead, put "# distutils: language={0}" in your .pyx or .pxd file(s)r   )	Extension
setuptoolszsetuptools.extensionr  r+   r   )rl  rk  z6Warning: Multiple cython sources found for extension 'z': z
See https://cython.readthedocs.io/en/latest/src/userguide/sharing_declarations.html for sharing declarations among Cython files.r  rN   .cpp.c)rm   rn   rU   F)r   z6pattern is not of type str nor subclass of Extension (z) but of type z and class z'%s' doesn't match any filesrm   rn   rU   rs   z@Warning: Cython source file not found in sources list, adding %s)6rJ  r  r   r   r	   distutils.extensionr  sysmodules
_Extensionrm   r  shared_utility_qualified_namer1   r   rH  mapr   r   r  r0   r  create_extensionr  rn   r  rg   r  r%  r   rU   rs   r   r   reprr   r  rS   rD   r  r  r   $raise_error_if_module_name_forbiddenr,  r   	Exceptionr   r_  r   rZ   rV   r?   insertr3   )&patternsexcluder  r   r>  rU   exclude_failuresr  extension_classesr5   explicit_modulesr  r  
to_excluder4   module_listmodule_metadatar  r:   filepatternr  rm   r"   ext_languageri   cython_sourcesr   msgfiler  r  r   rC   rn   r   rs   r  target_files&                                         r#   create_extension_listr    s    VV\V\]eVf	h2v	Hc	"	"*Xx*H*H:-s{{" KK./::KK%//
 'L(0U1Jq4TU!#3D$'$E$E!Jgt$$)#bggoo~g/FGH  KO {{33O7O5Dgs##!K "-HDD#L33)0 LA!#!1!1!!4Q!7?!J  N L,Q/~&*LSLLZhj k /7<<C`3`'6#OO ~5==c266JX_XhXhlqXqfw{|0~$--	2 1  %26/""1% ""7+H==D X.DL8<Y8<W8?8I8IK LC C. VN;$?@B`cnBnoDwwt$
233D9Kd{"22 3"66{C$&..tWdCJJD
 #&*kk&7&7&9
Ud?(-DI ':  +V&x/?/?#T/?!CSA/?#TT$"&y/!0#NN62 #2 #*YJd$:'3D$!XXlE:
 /x>8)LWQe-L2O/<<,Q/""1% 08,qyy("$''"2"24"8";W\I\vbf"gKi		((5 II$$Q-y pW P ''u V4Ld ! '  $U< & i`cgghisH   4V4V4*V9V9%V>	W
W
W>WWW87W8c	                   ^6 Uc  / nSU	;  a  S/U	S'   SU	;   a  [        U	S   5        U	R                  SS5      n
[        c  SnO[        S10 U	D6nSUl        SUl        Uc"  [        R                  R                  S5      S:H  n[        S10 U	D6n[        S10 U	D6nSUl        [        R                  " U5      nUn	UR                  n[        U UUUUUUS	9u  n n[        U 5        [        XS
9n[        U	SS5      m6U	R                   (       a[  U	R"                  (       dJ  [$        R"                  (       d5  U	R                   SL a  SOU	R                   n['        U[        U	SS5      5      nOSn[        R(                  " 5       4U64S jjnU64S jn[*        R,                  " [.        5      n/ nU  GH  nT6(       a  UR0                   H  nU" U5        M     UR2                   Vs/ s H-  n[        R4                  R7                  U5      S   S;   d  M+  UPM/     nn[9        U5      S:X  a  UR:                  nOSn[        USS5      n[        USS5      nU(       a  Un	OUR<                  S:X  a  Un	OUn	/ nUR2                   GH  n[        R4                  R7                  U5      u  n n!U!S;   Ga  U UR<                  S:X  d  U(       a  SOS-   n"U" U"5      n"U
(       a  UR?                  U5      n#[A        U"UU#5        [B        RD                  " U"5      (       a   [        R4                  RG                  U"5      n$OSn$U$URI                  U5      :  a  URI                  U5      Unn%Sn&O+URK                  U5      u  n%nSUURM                  U5      ;   -
  n&U(       d  U$U%:  a  U(       dl  U(       de  UU:X  a#  [O        S[B        RP                  " U5      -  5        O<[O        S[B        RP                  " U5      < S[B        RP                  " U5      < S35        U(       dI  U(       aB  URS                  UUR?                  U5      U	[U        UR<                  =(       d    SUU5      5      n'OSn'URW                  U&UU"U'UX(       + UR                  UR:                  5      UU4
5        UU"   RW                  U5        OU(       a  UR:                  U:X  a  U" U5      n"[        U	U"SS9n([B        RX                  " U"5      (       d  [O        SUR:                   S U" S!35        ObU(       d  [B        RD                  " U"5      (       d.  SS"K-J.n)  U(       d  [O        S#UR:                   S!35        U)" U(5        OUn"T6(       a  U" U5        URW                  U"5        GM     UUl        GM     UR_                  5         [9        U5      n*S$[9        [a        U*5      5      U*4-  Rb                  n+[e        US5       V,V-s/ s H  u  n,n-U-SS U+" U,5      U4-   PM     nn,n-U*S::  a  SnU(       a%  SSK3n.U.Ri                  5       S%:X  a  [O        S&5        SnU(       a  SSK3n.U.Rk                  U[l        S'9n/ U/Ro                  [p        USS(9n0U/Rs                  5         U0Ru                  5       (       d)   U0R                  S)5        U0Ru                  5       (       d  M)  U/R}                  5         OU H  n1[        U16   M     U(       Ga-  [        5       n2UR                  5        H  u  n"n3[        R4                  R                  U"5      (       d  U2R                  U35        M=  [        R4                  R                  U"5      S*:  d  Mb  [        U"S+S,S-9n4 U4R                  [9        S.5      5      S.:X  a  U2R                  U35        U4Rs                  5         M     U2(       a[  U2 H  n5U R                  U55        M     [O        S/S0R}                  [        U2 V5s/ s H  n5U5R:                  PM     sn55      5      -  5        U(       a  UR                  5         [        R                  R                  5         U $ s  snf s  sn-n,f ! U.Rv                   a     GNf = f! [x         a    U/R{                  5         e f = f! U4Rs                  5         f = fs  sn5f )2a  
Compile a set of source modules into C/C++ files and return a list of distutils
Extension objects for them.

:param module_list: As module list, pass either a glob pattern, a list of glob
                    patterns or a list of Extension objects.  The latter
                    allows you to configure the extensions separately
                    through the normal distutils options.
                    You can also pass Extension objects that have
                    glob patterns as their sources. Then, cythonize
                    will resolve the pattern and create a
                    copy of the Extension for every matching file.

:param exclude: When passing glob patterns as ``module_list``, you can exclude certain
                module names explicitly by passing them into the ``exclude`` option.

:param nthreads: The number of concurrent builds for parallel compilation
                 (requires the ``multiprocessing`` module).

:param aliases: If you want to use compiler directives like ``# distutils: ...`` but
                can only know at compile time (when running the ``setup.py``) which values
                to use, you can use aliases and pass a dictionary mapping those aliases
                to Python strings when calling :func:`cythonize`. As an example, say you
                want to use the compiler
                directive ``# distutils: include_dirs = ../static_libs/include/``
                but this path isn't always fixed and you want to find it when running
                the ``setup.py``. You can then do ``# distutils: include_dirs = MY_HEADERS``,
                find the value of ``MY_HEADERS`` in the ``setup.py``, put it in a python
                variable called ``foo`` as a string, and then call
                ``cythonize(..., aliases={'MY_HEADERS': foo})``.

:param quiet: If True, Cython won't print error, warning, or status messages during the
              compilation.

:param force: Forces the recompilation of the Cython modules, even if the timestamps
              don't indicate that a recompilation is necessary.

:param language: To globally enable C++ mode, you can pass ``language='c++'``. Otherwise, this
                 will be determined at a per-file level based on compiler directives.  This
                 affects only modules found based on file names.  Extension instances passed
                 into :func:`cythonize` will not be changed. It is recommended to rather
                 use the compiler directive ``# distutils: language = c++`` than this option.

:param exclude_failures: For a broad 'try to compile' mode that ignores compilation
                         failures and simply excludes the failed extensions,
                         pass ``exclude_failures=True``. Note that this only
                         really makes sense for compiling ``.py`` files which can also
                         be used without compilation.

:param show_all_warnings: By default, not all Cython warnings are printed.
                          Set to true to show all warnings.

:param annotate: If ``True``, will produce a HTML file for each of the ``.pyx`` or ``.py``
                 files compiled. The HTML file gives an indication
                 of how much Python interaction there is in
                 each of the source code lines, compared to plain C code.
                 It also allows you to see the C/C++ code
                 generated for each line of Cython code. This report is invaluable when
                 optimizing a function for speed,
                 and for determining when to :ref:`release the GIL <nogil>`:
                 in general, a ``nogil`` block may contain only "white" code.
                 See examples in :ref:`determining_where_to_add_types` or
                 :ref:`primes`.


:param annotate-fullc: If ``True`` will produce a colorized HTML version of
                       the source which includes entire generated C/C++-code.


:param compiler_directives: Allow to set compiler directives in the ``setup.py`` like this:
                            ``compiler_directives={'embedsignature': True}``.
                            See :ref:`compiler-directives`.

:param depfile: produce depfiles for the sources if True.
:param cache: If ``True`` the cache enabled with default path. If the value is a path to a directory,
              then the directory is used to cache generated ``.c``/``.cpp`` files. By default cache is disabled.
              See :ref:`cython-cache`.
NrK  r  common_utility_include_dirdepfileTCYTHON_FORCE_REGENr}   )r  r  r>  r  rU   r   r  	build_dir
cache_sizec           	      8  > [         R                  R                  U 5      n[         R                  R                  U 5      (       a  Un UR	                  U5      (       a>  [        T[         R                  R                  [        X5      5      5      n[        X#5        g g r   )	r   r   r  r   r   r2   r   r    copy_once_if_newer)filepathr=   filepath_absmod_dirr  s       r#   copy_to_build_dir$cythonize.<locals>.copy_to_build_dir  sm    wwx077==""#H""4((	 "0H IKG|5	 )rf   c                   > T(       d  U $ [         R                  R                  U 5      (       aE  [         R                  R                  U 5      S   n U R	                  [         R
                  S5      S   n [         R                  R                  TU 5      n [         R                  R                  U 5      n[        U5        U $ )Nr   )	r   r   r   
splitdriver/   r   r   r   safe_makedirs_once)c_filer  r  s     r#   file_in_build_dir$cythonize.<locals>.file_in_build_dir  s    M77==  WW''/2F\\"&&!,Q/Fi0ggoof%3rf   r   rj  rs   Fr  rN   r  r  r   r   r
   z Compiling %s because it changed.z
Compiling z because it depends on c)shared_c_file_pathr  zHWarning: Shared module source file is not a Cython file - not creating 'z' as 'rF  )generate_shared_modulezGenerating shared module 'z[{0:%d}/%d] spawnzBDisabling parallel cythonization for "spawn" process start method.)initializer)	chunksizei    rz	iso8859-1)encodingz#error zFailed compilations: %sz, r   )Mr   r_  rO   r   cplusrs   r   environr   r   from_optionsr  r  fix_windows_unicode_modulesr  r   cacheannotater   r   r   collectionsdefaultdictr   rr   rn   r   r  rg   rm   rU   r{  r   r   file_generated_by_this_cythonr~  r  r  rv  rJ  decode_filenametransitive_fingerprintr   r   is_cython_generated_fileSharedModuler  sortr   r  	enumeratemultiprocessingget_start_methodPool_init_multiprocessing_helper	map_asynccythonize_one_helperclosereadyTimeoutErrorKeyboardInterrupt	terminater   cythonize_oner1   r   existsrH  getsizeopenr$  rV   r  cleanup_cacher  stdoutflush)7r  r  nthreadsr   r>  forcerU   r  show_all_warningsr  r  pythran_options	c_optionscpp_optionsr  r  r  r  
cache_pathr  r  r  modules_by_cfile
to_compiler5   depr   
cy_sourcesfull_module_namers   r  new_sourcesr"   rW   r  dependenciesc_timestampdep_timestamppriorityfingerprintmodule_optionsr  Nbuild_progress_indicatoritaskr  poolresultargsfailed_modulesr  r   r  r  s7                                                         @r#   	cythonizer'  j  s   ` W$#&%#w.g:;<kk)T*G,7w7 $%)"}

34;"-W-I$/w/KT1B


y
)CG$'$E$E!#8)$ K  ,!#3Dd3I}}g..'2B2B
 %]]d2T
j''<"FG)+ 6	 #..t4Jyy!#& ! "#?!*vww'*o=  	 ? z?a vv  $Qe4
 $4e<%GZZ5 !GGiiF((0ID#o%1::+>*RVW +62 #'#8#8#@L!&&,? 66v>>"$''"2"26":K"$K !77)-)?3M H)-)?)?)G&M3 C4+F+Fv+N$NOHK-7 !S=!"DuG\G\]cGd"de! % 5 5f = % 5 5c :#  !U&+&B&B &(=(=f(Ew 01BsNT^ _'
 '+%% &&+u!57J7J1667R(*;'= > !(//2.166=Z3Z*62!3VZ"\55f==defekekdllrsyrzz{|}%"E"Ef"M"MD  :166(!DE*>:%f-v&C  F  	{ ~ OOJA !/#c!f+q1A AII !Q//GAt 	QR,Q/77/  
 	Av++-8VWH##"> $ @
	^^$8*PQ^RFJJLllnnJJu% llnn 			D4   /557OFG77>>&))%%g.(3.{;vvc)n-:&--g6GGI  8 (""6* )+dii*8@:*8.@: 9; /< < =  JJ{?@4 '33   	NN	( GGI@:sT   *`4`4`9:a >`? a /a5b
?aa aa a25bc                 "   [         R                  S:w  a  g [         R                  S:  a  g S nU  H\  nUR                  R	                  5       (       a  M$  U" SUR                  R                  SS5      S   -   UR                  5      Ul        M^     g )Nwin32)r      r
   c                    ^   " U 4S jS[         5      nU" U5      nU(       a  UR                  U 4S jU 5       5        U$ )Nc                   "   > \ rS rSrU 4S jrSrg)Vfix_windows_unicode_modules.<locals>.make_filtered_list.<locals>.FilteredExportSymbolsi  c                 F   > UT:H  =(       d    [         R                  X5      $ r   )r   __contains__)r   r   ignored_symbols     r#   r/  cfix_windows_unicode_modules.<locals>.make_filtered_list.<locals>.FilteredExportSymbols.__contains__  s    n,L0A0A$0LLrf   r   N)r   r   r   r   r/  r   )r0  s   r#   FilteredExportSymbolsr-    s    M Mrf   r2  c              3   6   >#    U  H  oT:w  d  M
  Uv   M     g 7fr   r   )r   rm   r0  s     r#   r   Jfix_windows_unicode_modules.<locals>.make_filtered_list.<locals>.<genexpr>  s      X+$AW+s   		)r   rT   )r0  old_entriesr2  filtered_lists   `   r#   make_filtered_list7fix_windows_unicode_modules.<locals>.make_filtered_list  s:    	MD 	M .k:   X+ XXrf   PyInit_r  r   r   )r  platformversion_inform   isasciirsplitrq   )r  r7  r5   s      r#   r  r    s{     ||w
9$ 66>>-c1-b11
 rf   XML_RESULTSc                    ^  U 4S jnU$ )Nc            	        > [         R                   " 5       nSn  T" U 6   [         R                   " 5       U-
  n[        U S   5      nSU-   nSU-
  nU(       a  SnOSn[        [        R                  R                  [        US-   5      S	5      nUR                  S
R                  5       [        5       -  5        UR                  5         g !   Sn N= f! [         R                   " 5       U-
  n[        U S   5      nSU-   nSU-
  nU(       a  SnOSn[        [        R                  R                  [        US-   5      S	5      nUR                  S
R                  5       [        5       -  5        UR                  5         f = f)NTFr   z
cythonize.r   r*   failurez.xmlwaQ  
                    <?xml version="1.0" ?>
                    <testsuite name="%(name)s" errors="0" failures="%(failures)s" tests="1" time="%(t)s">
                    <testcase classname="%(name)s" name="cythonize">
                    %(failure_item)s
                    </testcase>
                    </testsuite>
                )timer  r  r   r   r   compile_result_dirwritera   localsr   )	r%  rz   successr  rm   failuresfailure_itemoutputfuncs	           r#   with_record#record_results.<locals>.with_record  sI   		AG$$K IIK!O-d1g6#f,w;#%L#,Lbggll+=tf}MsS  EGfh' ( )$#GIIK!O-d1g6#f,w;#%L#,Lbggll+=tf}MsS  EGfh' ( s   C CC B)E:r   )rK  rL  s   ` r#   record_resultsrN    s    	6 rf   c                     U $ r   r   )rK  s    r#   rN  rN    s    rf   c                    SSK JnJn  SSKJnJn  U(       dZ  U
(       a/  U(       a(  U
R                  X5      (       a  [        U	 SU  S35        O$[        U	 S[        R                  " U 5       35        Uc  [        U5      nXl        Xdl        [        R                  nU(       a  S[        l        Sn U" XXzUS9nUR                  S:  a  S	nU(       a  U[        l        U(       aL  U(       a	  U" S U 5      e[.        R0                  R3                  U5      (       a  [.        R4                  " U5        g g g ! [         U4 aB  n["        R$                  R'                  S
U-  5        S	nSS KnUR+                  5          S nANS nAf[,         a!    U(       a  e SS KnUR+                  5         S	n Nf = f! U(       a  U[        l        f f = f)Nr
   )compile_singler   )CompileError
PyrexErrorzFound compiled z	 in cachezCythonizing r   )r  r  r  r   z%s
)Compiler.MainrQ  r   Compiler.ErrorsrR  rS  lookup_cacherJ  r   r  r   output_fileembedded_metadatar   LEVEL
num_errorsOSErrorr  stderrrE  	traceback	print_excr  r   r   r  rV   )pyx_filer  r  r>  r  raise_on_failurerX  r  r  progressr  rQ  r   rR  rS  old_warning_levelany_failuresr$  er]  s                       r#   r  r    ss    @:[U%7%7%L%LXJohZyABXJl5+@+@+J*KLM$_5  1L-DToz{q L ,FLtX..WW^^F##IIf $ ! Z  

!$  ,FL s6   1D1 1F(=8E:5F+ :+F(%F+ 'F((F+ +G c                 Z    SS K n [        U 6 $ ! [         a    UR                  5         e f = frV  )r]  r  r  r^  )r5   r]  s     r#   r  r    s3    a   s    *c                  X    SS K n U R                  U R                  U R                  5        g rV  )signalSIGINTSIG_IGN)rg  s    r#   r  r  %  s    
MM&--0rf   r   )zexpected non-empty iterator)__Pyx_Lr   )NNNFNF)Nr   NFNNFF)	NFNTNNFr*   N)Wr   r  r   r,   r  rC  globr   ior   os.pathr   r    r   r   collections.abcr	   rO   r*   r   r   r   r   r   r   r   r   Compilerr   rT  r   r   Compiler.Optionsr   r   r   r   r   r2   r  r  r$   r0   rD   rZ   rl   objectr   r   r   r   r   r   r   r   declarecompileVERBOSEr)  r   r   r   rh   	MULTILINEr&  r(  r   r   r	  r  r  r  r9  r;  r  r  r  r  r'  r  r  r   rD  rN  r  r  r  r   rf   r#   <module>rv     s     	     ' * $ M M M  #   BGGLL)	$%>? $]3 $B$2J< (
(     ++++ ++ +*# &<$R+ R+j nnVRZZ 1 ZZ	& 	 ^^FBJJ 8 ZZ-  
 nnVRZZ 9 ZZ	. 	 k' k'S k'b ::? LL2::  !jj:LL2:: R % %6     3 3
 $7 $7Np pf 	 ae+0Q(j fj8=xv	
> ::>>-  M2<
 9=;?;@%)	/ /d1m(Gs   J
 
J