
    -Phu              	          d dl Z d dlZd dlZd dlZej        dd         dk     rCej                            d eej        dd                   z              ej        d           ddl	m
Z
 ddlmZ ddlmZmZ dd	l
mZmZmZmZ dd
lmZ ddl	mZ ddl	mZ ddlmZmZ ddlmZ ddlmZmZmZm Z  d Z!d"                    e e!e          e e!e                     Z# ej$        d"                    e#                    Z#e j%        &                    e j%        '                    e j%        (                    e j%        (                    e)                    d                    Z* G d d          Z+d Z,d Z-d Z.d Z/d Z0 G d d          Z1 G d d          Z2 G d d e3          Z4d! Z5d+d"Z6d,d#Z7d-d$Z$ej8        d.d'            Z9ej8        d(             Z:d) Z;d/d*Z<dS )0    N   )      z0Sorry, Cython requires Python 3.8+, found %d.%d
   )Errors)EncodedString)PyrexScannerFileSourceDescriptor)
PyrexErrorCompileErrorerrorwarning)ModuleScope)Utils)Options)CompilationOptionsdefault_options)parse_command_line)unicode_start_ch_anyunicode_continuation_ch_anyunicode_start_ch_rangeunicode_continuation_ch_rangec           	          g }t          dt          |           d          D ]:}|                    d                    | |         | |dz                                 ;d                    |          S )Nr   r   z{}-{}r    )rangelenappendformatjoin)chrsoutis      T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/Cython/Compiler/Main.py_make_range_rer$   !   sg    
C1c$ii## 7 7

7>>$q'4!9556666773<<    z[{0}{1}][{0}{2}{1}{3}]*z{0}(\.{0})*$Includesc                      e Zd ZdZdZ	 	 d!dZed             Zed             Z	d Z
d"dZd Zd	 Zd#d
Zed             Zed             Z	 	 d$dZd%dZd%dZd&dZ	 d'dZd Zd Zd Zd Zd Zd Zd Zd#dZd Zd Z d Z!d Z"d  Z#dS )(ContextNFc                    ddl m}m} d|j        i| _        |                    |           | _        | j        | j        d<   || _        t                      | _	        || _
        || _        || _        i | _        i | _        i | _        ||                     |           | j
                            dd          | _        d | _        d S )Nr   )BuiltinCythonScope__builtin__cythonlegacy_implicit_noexceptF)r   r*   r+   builtin_scopemodulescreate_cython_scopecython_scopeinclude_directoriessetfuture_directivescompiler_directivescppoptionspxdsutility_pxds	_internedset_language_levelgetr.   gdb_debug_outputwriter)selfr3   r6   r7   language_levelr8   r*   r+   s           r#   __init__zContext.__init__B   s     	+*******%(=>';;DAA!%!2X#6 !$#6 	%##N333(,(@(D(DE_af(g(g%&*###r%   c                 J     | |j         |j        |j        |j        |          S )N)r8   )include_pathr6   cplusr@   )clsr8   s     r#   from_optionszContext.from_options]   s5    s7')D='"8'K K K 	Kr%   c                 ,    | j         r| j         j        nd S N)r8   shared_utility_qualified_namer?   s    r#   rI   z%Context.shared_utility_qualified_nameb   s    =A\St|99tSr%   c                    ddl m}m}m}m}m} t                      }|dk    rd}nt          |          }|dk    r|                    |||||g           || _	        || _
        |dk    r| j        d         | j        d<   d S d S )Nr   )print_functionunicode_literalsabsolute_importdivisiongenerator_stop3strr   r,   builtins)FuturerL   rM   rN   rO   rP   r4   intupdater@   r5   r0   )r?   levelrL   rM   rN   rO   rP   r5   s           r#   r<   zContext.set_language_levelf   s    ggggggggggggggEEF??EEJJEA::$$&6Yacq%rsss#!2A::'+|M'BDL$$$ :r%   c                     t           ||f}	 | j        |         S # t          $ r Y nw xY wt          |          }|r||_        || j        |<   |S rH   )r   r;   KeyErrorencoding)r?   valuerY   keys       r#   intern_ustringzContext.intern_ustringt   sm    eX.	>#&& 	 	 	D	e$$ 	&%EN#ss    
&&c                 N   ddl m} t          |t                    ro|j        dk    rdt          ||t          j                              }t          || j	                  }|
                    | |          }|                    ||          }n|j        rfddl m}	 |	                    |           }
|                    | ||          }|                    ||
|	j                  }|                    ||          }n-|                    | ||          }|                    ||          }|S )Nr   Pipelinepyx)ParseTreeTransforms)before)r   r_   
isinstancer
   
_file_typeCompilationSourceosgetcwdcreate_default_resultobjr8   create_pyx_as_pxd_pipelinerun_pipelinein_utility_codera   CnameDirectivesTransformcreate_pxd_pipelineinsert_into_pipelineInterpretCompilerDirectives)r?   source_descscopemodule_namer_   sourceresult_sinkpipelineresultra   	transforms              r#   process_pxdzContext.process_pxd   sC   k#788 	B[=SW\=\=\&{KMMF264<HHK::4MMH**8V<<FF( 
	B------+DDTJJI33D%MMH44)*F 5 H HH **8[AAFF33D%MMH**8[AAFr%   c                 *    t          j        |          S rH   )r   report_error)r?   excs     r#   nonfatal_errorzContext.nonfatal_error   s    "3'''r%   c                     |                     d          }|                                }d |D             }|dk    rRd}dD ]6}|                     ||d d |           }|r|                     |          } n7|                    ||f           |S )N.c                     g | ]}|d fS )T ).0ps     r#   
<listcomp>z1Context._split_qualified_name.<locals>.<listcomp>   s    HHHaD	HHHr%   rA   F).py.pyx)suffix
source_possource_file_pathsys_path)splitpopsearch_include_directories_is_init_filer   )r?   qualified_namerelative_importqualified_name_parts	last_part
is_packager   paths           r#   _split_qualified_namezContext._split_qualified_name   s    -33C88(,,..	HH3GHHH
"" J)  66"6dUYhwdw 7 y y !%!3!3D!9!9JE !''J(?@@@##r%   c                 L    | r!t           j                            |           dv ndS )N)z__init__.pyxz__init__.pyz__init__.pxdF)rf   r   basename)r   s    r#   r   zContext._is_init_file   s)    \`krw%%)XXXfkkr%   c                     |sd S t           j                            |          }d|v r@|t           j                            |          d         k    rt	          | d|z  d           d S d S d S )Nr~   r   ^Dotted filenames ('%s') are deprecated. Please use the normal Python package directory layout.r   rV   )rf   r   r   splitextr   )pospxd_pathnamer   pxd_filenames       r#   _check_pxd_filenamezContext._check_pxd_filename   s     	Fw''55.  ^rw7G7G7U7UVW7X%X%XC NP\]deg g g g g g ! %X%Xr%   r   Tc           
      <   d}|rt          d|d|d|d|           d }d }	|r$|r|                    |          }
n|j        }
|}d }n|}
t                              |
          st          |p|ddfd|z            |r|rt          d           |                    |          }|s^|                     |
||           }	|                     ||	|
           |	r,| 	                    |	          }|
                    ||	          }|sK|rt          d
           |r|}
| }|                     |
|          D ]\  }}|
                    ||	          }|rt          d|z             |j        s|rt          d           |	s|rt          d           |                     |
||o|           }	|                     ||	|
           |rt          d|	z             |	sv|rtd|_        |                     |
d||           }|r |                    t          j                  rn1t#          |d|
                    dt&          j                  z             |	rd|_        	 |rt          d|	z             |                    dt&          j                  t&          j                            |	          d         z   }|	                    |          s|	}t/          |	|          }|                     |||
          \  }}|r||\  }}||f| j        |<   n# t
          $ r Y nw xY w|S )Nr   z#Context.find_module: module_name = z, from_module = z, pos = z, need_pxd = z'%s' is not a valid module namez...trying relative importr   )
as_packagez...trying absolute import)r   z...scope = %sz...pxd not loadedz...looking for pxd filez......found %sTr   )r   r   r   z'%s.pxd' not foundr~   zContext.find_module: Parsing %sr   )printqualify_namer   module_name_patternmatchr   lookup_submodulefind_pxd_filer   r   find_submoduler   pxd_file_loadedr   endswithr   PACKAGE_FILESr   replacerf   sepr   r   r
   rx   r9   )r?   rr   from_moduler   need_pxdabsolute_fallbackr   debug_find_modulerq   r   r   r   namepackage_pathnamerel_pathrp   errrv   pxd_codenodes	pxd_scopes                       r#   find_modulezContext.find_module   s6     	:E[[[###xx9 : : :  
	) #!,!9!9+!F!F "-!;#"(N"((88 	Ps9{Aq&9@;NP P P  		[  3122200==E [#11.#TcPc1dd((lNKKK [!%!3!3L!A!AJ'66{z6ZZE 	J  31222  -!,E$($>$>~_n$>$o$o J J j,,Tj,II 	+/E)***$ %	  +)*** _$ 53444  $11.#PXPpap]p1qq((lNKKK$ ;*\9:::# 	_ 	_ -1E)'+'F'F&uSbOb (G (d (d$' _,<,E,EeFY,Z,Z _c#7.:P:PQTVXV\:]:]#]^^^ (,%( P?,NOOO*223??"'BRBRS_B`B`abBccH'00:: 0#/"6|X"N"NK"&"2"2;~"V"VKC "!	17.]I.;Y-GDIk**#   Ds   B0L 
LLc                     |                      |d|||          }|$t          j        r|                     |||          S |S )N.pxdr   r   r   r   r   )r   r   cimport_from_pyxfind_pyx_file)r?   r   r   r   r   pxds         r#   r   zContext.find_pxd_file  sX     --6cH_o . q q;73;%%ncH%MMM
r%   c                 6    |                      |d|||          S )Nr   r   )r   )r?   r   r   r   r   s        r#   r   zContext.find_pyx_file$  s0     ..6cH_o / q q 	qr%   c                 b    |                      ||d|          }|st          |d|z             |S )NT)r   includer   z'%s' not found)r   r   )r?   filenamer   r   r   s        r#   find_include_filezContext.find_include_file*  sM     ..dEU / W W 	4#'(2333r%   c                     | j         }|r|t          j        z   }t          |t          gz             }t          |||pd|||          S )Nr   )r3   sysr   tuplestandard_include_pathr   )r?   r   r   r   r   r   r   include_dirss           r#   r   z"Context.search_include_directories3  s[    / 	3'#(2L\-B,CCDD).&,B
GM]_ _ 	_r%   c                 *    t          j        |          S rH   )r   find_root_package_dir)r?   	file_paths     r#   r   zContext.find_root_package_dir=  s    *9555r%   c                 F    t          j        |t          |                    S rH   )r   check_package_dirr   )r?   dirpackage_namess      r#   r   zContext.check_package_dir@  s    &sE-,@,@AAAr%   c                    t           j                            |          sdS t          j        |          }t          j        ||          rdS t          j        |d          }t           j                            |          rt          j        ||          rdS |                     |          D ]\\  }}|dk    r|                     ||          }n|dk    r| 	                    ||          }nB|rt          j        ||          r dS ]dS )Nr   r   cimport)r   r   r   )
rf   r   existsr   modification_timefile_newer_thanreplace_suffixread_dependency_filer   r   )r?   source_pathoutput_pathc_timepxd_pathkindr   dep_paths           r#   c_file_out_of_datezContext.c_file_out_of_dateC  s    w~~k** 	1(55 f55 	1'V<<7>>(## 	(=h(O(O 	133K@@ 	 	JD$y  --d[-QQ""::4R]:^^ E1(FCC qqqr%   c                 @    d |                      |          D             S )Nc                 $    g | ]\  }}|d k    |S )r   r   )r   r   r   s      r#   r   z7Context.find_cimported_module_names.<locals>.<listcomp>X  s0     ( ( (*$I%% %%%r%   )r   )r?   r   s     r#   find_cimported_module_namesz#Context.find_cimported_module_namesW  s0    ( ((A(A+(N(N ( ( ( 	(r%   c                 *    t          j        |          S rH   )r   is_package_dir)r?   dir_paths     r#   r   zContext.is_package_dir[  s    #H---r%   c                     t          j        |d          }t          j                            |          r?t          |          5 }d d |D             D             }d d d            n# 1 swxY w Y   |S dS )Nz.depc                 B    g | ]}d |v |                     d d          S ) r   )r   )r   lines     r#   r   z0Context.read_dependency_file.<locals>.<listcomp>b  s7     , , ,#!Tkk  ::c1--)kkr%   c              3   >   K   | ]}|                                 V  d S rH   )strip)r   ls     r#   	<genexpr>z/Context.read_dependency_file.<locals>.<genexpr>c  s*      '='=a		'='='='='='=r%   r   )r   r   rf   r   r   open)r?   r   r   fchunkss        r#   r   zContext.read_dependency_file^  s    'V<<7>>(## 	h ,1, ,'='=1'='='=, , ,, , , , , , , , , , , , , , , M2s   A''A+.A+c                 8    | j                             |d           S rH   )r0   r=   )r?   r   s     r#   r   zContext.lookup_submodulei  s    |d+++r%   c                 n    |                      |          }|st          |d | |          }|| j        |<   |S )N)parent_modulecontextr   )r   r   r0   )r?   r   r   rq   s       r#   r   zContext.find_submodulem  sN    %%d++ 	' $M M ME!&DLr%   c                    t          |t                    st          d          | j        |_        t	          j                    }	 |                                5 }ddlm} t          |||j
        ||           }|                    |||          }	| j        j        r?	 ddlm}
 n# t           $ r t          d          w xY w|
                    |j                   d d d            n# 1 swxY w Y   n(# t$          $ r}|                     ||          d }~ww xY wt	          j                    |k    rt)                      |	S )N$Only file sources for code supportedr   )Parsing)source_encodingrq   r   r   )ConcreteSyntaxTreezLFormal grammar can only be used with compiled Cython with an available pgen.)rc   r
   RuntimeErrorr7   r   get_errors_countget_file_objectr   r   r	   rY   p_moduler8   formal_grammarParserr   ImportErrorr   UnicodeDecodeError_report_decode_errorr   )r?   rp   rq   r   full_module_name
num_errorsr   r   streer   es               r#   parsezContext.parsev  s   +';<< 	GEFFFH	,..
	<,,.. F!%%%%%% K1:).$@ @ @''30@AA<. Fl???????& l l l*jl l ll '//0DEEEF F F F F F F F F F F F F F F " 	< 	< 	< ++K;;;	<
 "$$z11.. sU   C3 AC'B$#C'$B>>C'C3 'C++C3 .C+/C3 3
D=DDc                 ~   |j         d         }|j         d         }|j         d         }d}dx}}t          |j        dd          5 }	t          |	d          D ]7\  }}
|t	          |
          z  }||k    r||t	          |
          z
  z
  dz   } n8d d d            n# 1 swxY w Y   t          |||fd|d	|d
          S )Nr   r   r   z	iso8859-1r   )rY   newlinezjDecoding error, missing or incorrect coding=<encoding-name> at top of source (cannot decode with encoding z: ))argsr   r   	enumerater   r   )r?   rp   r{   msgpositionrY   r   columnidxr   datas              r#   r   zContext._report_decode_error  s.   hrl8A;8A;+&bIII 	Q'1oo  
ds4yy (??%s4yy9A=FE #	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 k400PXPXPXZ]Z]Z]_` ` 	`s   A	BB!Bc                    t           j                            |          \  }}t           j                            |          \  }}d|v r|S |g}|                     |          rUt           j                            |          \  }}	||k    rn,|                    |	           |}|                     |          U|                                 d                    |          S Nr~   )rf   r   r   r   r   r   reverser   )
r?   r   r8   r   r   rr   _namesparentpackage_names
             r#   extract_module_namezContext.extract_module_name  s     d++X))(33Q+!!#&& 	#%7==#5#5 FL}}LL&&&C !!#&& 	 	xxr%   c                     t          j                     |j        r"t          j        |j        d          x}|_        nd }t          j        ||j                   d S )Nz.lis)r   echo_to_stderr)	r   init_threaduse_listing_filer   r   main_source_filelisting_fileopen_listing_fileerrors_to_stderr)r?   r8   rv   r   s       r#   setup_errorszContext.setup_errors  sa    # 	).)=f>UW])^)^^D6&&D d7;STTTTTTr%   c                    |j         j        }t          |t                    st	          d          t          j                     t          j                    |_        |j        dk    rd}|rS|j	        rN	 t          j        |j	        t          j        |j                             n# t          $ r Y nw xY wd |_	        d S d S d S )Nr   r   T)compilation_sourcerp   rc   r
   r   r   close_listing_filer   r  c_filer   castrate_filerf   statr   OSError)r?   r   r8   rv   rp   s        r#   teardown_errorszContext.teardown_errors  s    /;+';<< 	GEFFF!###"355q  C 	!6= 	!#FM27;;O3P3PQQQQ    FMMM	! 	! 	! 	!s   31B% %
B21B2)FNNrH   )F)NNr   TF)NTNNN)NNFFN)$__name__
__module____qualname__r2   r@   rA   classmethodrF   propertyrI   r<   r\   rx   r|   r   staticmethodr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r  r"  r*  r   r%   r#   r(   r(   3   s]        LNEJ.2+ + + +6 K K [K T T XTC C C
 
 
 
  (( ( ($ $ $ $& l l \l g g \g MN<AZ Z Z Zx   q q q q    rv_ _ _ _6 6 6B B B  (( ( (. . .	 	 	, , ,     8` ` `$  "U U U! ! ! ! !r%   r(   c                 \   |j         rd}nd}t          j        | |          }|j        rt          j                            ||j                  }t          j                            |          r=t          j                            |t          j                            |                    S |S |S )Nz.cppz.c)	rD   r   r   output_filerf   r   r   isdirr   )source_filenamecwdr8   c_suffixsuggested_file_nameout_paths         r#   get_output_filenamer:    s    } .II #7<<W%8997=="" 	7<<"'*:*:;N*O*OPPPO""r%   c                     t                      }| j        j        |_        | |_        | j        }t          |j        | j        |          |_        |j        |_        |S rH   )	CompilationResultrp   r   r  r$  r:  r6  r&  embedded_metadata)r$  r8   rv   rp   s       r#   rh   rh     sY      F0<EF 2F$0K'(<*.9 9FM&8FMr%   c                    t          j                    }t           j                            |           }|p|                    | |          }t          |          }t          j        |           |j        r;|	                    dt           j
                  |z   }|                    |          s| }n|}t          ||          }t          |||          S r  )rf   rg   r   abspathr  r   r   $raise_error_if_module_name_forbidden'relative_path_in_code_position_commentsr   r   r   r
   re   )	rs   
source_extr  r8   r   r6  abs_pathr   rp   s	            r#   setup_source_objectrD    s    
)++Cwv&&H'W7+F+Fvw+W+W$%566	./?@@@6 #++C88:E  ** 	H&x::K[*:C@@@r%   c                    t          j                    }t          | ||          }|                    ||          }|r{|                    ||           t           j                            |           d         }	|                    |	dd                     t          | |	|||          } t          | |          S t          | |||          }
|r|                    |||
           |
S )Nr   )rf   rg   r:  lookup_cacheload_from_cacher   r   configure_language_defaultsrD  rh   rj   store_to_cache)rs   r8   r  r   cachefingerprintr6  output_filenamecachedrB  rv   s              r#   run_cached_pipelinerN    s    
)++C)&#w??O==F 9ov666W%%f--a0
++JqrrN;;;$VZ9I7T[\\'888&'+;WEEF C_k6BBBMr%   c                    ddl m} |j        r"t          j                            d| z             t          j                            |           d         }t          j        	                    |           }|
                    |dd                     t          | ||||          } t          | |          }|j        t          j                            |j                  d         dz   }t          j                            |          rGt!          |d          5 }	d|	                    d	          v rd
|_        d d d            n# 1 swxY w Y   |                                dk    s|s|                    |||          }
n|                    |||          }
|                    ||           d| j        v r~dt          j                            t          j                            |                    d         v r:t1          | j        ddfdt          j                            |          z  d           t5          j        d|j        t4          j        j                  r!|j        st1          | j        ddfdd           |                    |
|           \  }}|                     |||           |P|j!        rIddl"m#}  ||          $                    |j%                  }tM          j'        |j        |j%        |           |S )Nr   r^   zCompiling %s
r   z.htmlzUTF-8)rY   z<!-- Generated by Cythond   Tr   r~   r   r   z[.]c(pp|[+][+]|xx)$z:Filename implies a c++ file but Cython is not in c++ mode.r   create_dependency_tree)(r   r_   verboser   stderrwriterf   r   r   r?  rH  rD  rh   annotater&  r   r   readlowercreate_py_pipelinecreate_pyx_pipeliner"  r  r   r   rp   research	RegexFlag
IGNORECASEr7   rj   r*  depfileBuild.DependenciesrR  all_dependenciesr  r   write_depfile)rs   r8   r  r   r_   rB  rC  rv   html_filename	html_fileru   r   enddatarR  dependenciess                  r#   rj   rj     s>    4
)F2333!!&))!,Jwv&&H''
122777 5EwPWXXF%fg66F((77:WD7>>-(( 	,mg666 ,)-1D1DDD'+G$, , , , , , , , , , , , , , ,
 U""*"..wHH//&II&)))
f%%%#1A1A"'BRBRS[B\B\1]1]^_1`*`*`#Q*JLNGL\L\]eLfLfgno	q 	q 	q 	q 
y&r|7NOO X_Xc #Q*L	 	 	 	 ((6::LCC&111
{w{??????--g66GGH_``FM6+BLQQQMs   EE
Ec                       e Zd ZdZd ZdS )re   zk
    Contains the data necessary to start up a compilation pipeline for
    a single compilation unit.
    c                 0    || _         || _        || _        d S rH   )rp   r  r6  )r?   rp   r  r6  s       r#   rA   zCompilationSource.__init__G  s    & 0r%   N)r,  r-  r.  __doc__rA   r   r%   r#   re   re   B  s-             r%   re   c                   <    e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZd ZdS )r<  af  
    Results from the Cython compiler:

    c_file           string or None   The generated C source file
    h_file           string or None   The generated C header file
    i_file           string or None   The generated .pxi file
    api_file         string or None   The generated C API .h file
    listing_file     string or None   File of error messages
    object_file      string or None   Result of compiling the C file
    extension_file   string or None   Result of linking the object file
    num_errors       integer          Number of compilation errors
    compilation_source CompilationSource
    Nr   c                 J    d | j         | j        | j        | j        fD             S )Nc                     g | ]}||S r   r   )r   source_files     r#   r   z@CompilationResult.get_generated_source_files.<locals>.<listcomp>g  s.     
 
 
'

 
 
r%   )r&  h_filei_fileapi_filerJ   s    r#   get_generated_source_filesz,CompilationResult.get_generated_source_filesf  s6    
 
,0KdkSWS`+a
 
 
 	
r%   )r,  r-  r.  ri  r&  rn  ro  rp  r  object_fileextension_filer  r  rq  r   r%   r#   r<  r<  M  s]          FFFHLKNJ
 
 
 
 
r%   r<  c                       e Zd ZdZdZd ZdS )CompilationResultSetz
    Results from compiling multiple Pyrex source files. A mapping
    from source file paths to CompilationResult instances. Also
    has the following attributes:

    num_errors   integer   Total number of compilation errors
    r   c                 :    || |<   | xj         |j         z  c_         d S rH   )r  )r?   rs   rv   s      r#   addzCompilationResultSet.addx  s"    V6,,r%   N)r,  r-  r.  ri  r  rw  r   r%   r#   ru  ru  m  s4          J- - - - -r%   ru  c           	          ddl m} ddlm} t                              |          } ||          }|                     ||                    |          | ||j        rdnd|j	                            S )Nr   rQ  )FingerprintFlagszc++c)
np_pythran)
r`  rR  Build.Cachery  r(   rF   transitive_fingerprintra  rD   r{  )rJ  rs   r8   rR  ry  r   rf  s          r#   get_fingerprintr~  }  s    ??????222222&&w//--g66++55f==w  $]3EE&1  
 
 	
r%   c                     |t                               |          }|r'|pt          || |          }t          | |||||          S t	          | |||          S )a  
    compile_single(source, options, full_module_name, cache, context, fingerprint)

    Compile the given Pyrex implementation file and return a CompilationResult.
    Always compiles a single file; does not perform timestamp checking or
    recursion.
    )r(   rF   r~  rN  rj   )rs   r8   r  rJ  r   rK  s         r#   compile_singler    sj     &&w// H!L_UFG%L%L"674DguVabbbFG-=wGGGr%   c                 8   t          |           dk    r|j        rt          d          d | D             } t                      }t	                      }|j        }d}t          j                    }| D ]}||vrt          |||          }	|t          
                    |          }|                    ||	          }
|r|
r1t          |||j        ||          }|                    ||           d}|                    |           |r|                                 |S )z
    compile_multiple(sources, options, cache)

    Compiles the given sequence of Pyrex implementation files and returns
    a CompilationResultSet. Performs timestamp checking, caching and/or recursion
    if these are specified in the options.
    r   z>Full module name can only be set for single source compilationc                 L    g | ]!}t           j                            |          "S r   )rf   r   r?  )r   rs   s     r#   r   z$compile_multiple.<locals>.<listcomp>  s&    ===6rwv&&===r%   N)r  rJ  r   )r   rr   r   r4   ru  
timestampsrf   rg   r:  r(   rF   r   r  rw  cleanup_cache)sourcesr8   rJ  	processedresultsr  r   r6  rs   rL  out_of_daterv   s               r#   compile_multipler    sF    7||aG/ ; < < 	< >=W===GI"$$G#JG
)++C " """1&#wGGO!..w77!44V_MMK ; ''J]ejt{|||FF+++ MM&!!! Nr%   c                 n   t          dd|i|}d}|j        r]|j        st          j        r'|j        rt
          j                            d           n#ddlm	} |j        du rdn|j        } ||          }t          | t                    r|j        st          | |||          S | g} t          | ||          S )a  
    compile(source [, options], [, <option> = <value>]...)

    Compile one or more Pyrex implementation files, with optional timestamp
    checking and recursing on dependencies.  The source argument may be a string
    or a sequence of strings.  If it is a string and no recursion or timestamp
    checking is requested, a CompilationResult is returned, otherwise a
    CompilationResultSet is returned.
    defaultsNz/Cache is ignored when annotations are enabled.
r   )CacheTr   )r   rJ  rV  r   rS  r   rT  rU  r|  r  rc   strr  r  r  )rs   r8   r  kwdsrJ  r  
cache_paths          r#   compiler    s     !<<G<t<<G E} & 	&w/ 	& U
  !STTT++++++!($!6!6GMJE*%%E&# ! 	L!&'3CUKKKFGU333r%   r   Fc                    |r5|s3|d         }t          |t                    st          d          |j        }|r>|r$t          j                            |          f| z   } nt          j        |          f| z   } |}|r||z  }| D ]E}t          j        	                    ||          }	t          j        
                    |	          r|	c S F|s|                    d          }
t          |
dd                   }|
d         }g }| D ]K}t          j        ||          \  }}|/|r|                    |           4t          |||          }	|	r|	c S L|D ]}t          |||          }	|	r|	c S dS )a)  
    Search the list of include directories for the given file name.

    If a source file path or position is given, first searches the directory
    containing that file.  Returns None if not found, but does not report an error.

    The 'include' option will disable package dereferencing.
    r   r   r~   Nr  )rc   r
   r   r   rf   r   dirnamer   r   r   r   r   r   r   r   search_module_in_dir)dirsr   r   r   r   r   	file_descdotted_filenamer  r   r  r   rr   namespace_dirspackage_diris_namespaces                   r#   r   r     s     .# .F	)%9:: 	GEFFF$- K 	KGOO$4557$>DD/0@AACdJD %O "6!  w||G_557>>$ 	KKK	  $$S))eCRCj))Bi  	  	 G(-(?(W(W%K& "))+666+KfMM  KKK * 	 	K'[&IID  4r%   c                     t          j        | ||          }|s6|r4t          j        t          j                            | |          d|          }|S )NrA   )r   find_versioned_filerf   r   r   )r  rr   r   r   s       r#   r  r    sV     $[+vFFD  eF e(k;)O)OQ[]cddKr%   c                  "    t          d          S )Nr   )command_line)mainr   r%   r#   setuptools_mainr  1  s    q!!!!r%   c                 $   t           j        dd          }d}| r	 t          |          \  }}n# t          $ rb}t	          d                    t           j        d         |j                  t           j                   t          j        d           Y d }~nd }~ww xY wt          t                    }|}|j        rt          j                     |j        dk    rt          j        |j                   	 |j        rddlm}  ||           d S t)          ||          }|j        dk    rd}nO# t,          t.          f$ r;}t           j                            t3          |          dz              d}Y d }~nd }~ww xY w|rt          j        d           d S d S )	Nr   r   z#{}: No such file or directory: '{}')filer   r   )generate_shared_module
)r   argvr   FileNotFoundErrorr   r   r   rT  exitr   r   show_versionr   print_versionworking_pathrf   chdirshared_c_file_pathBuild.SharedModuler  r  r  r)  r   rU  r  )r  r  any_failuresr8   r  r  r  rv   s           r#   r  r  5  s   8ABB<DL 	1$77GWW  	 	 	7>>sx{AJWW^a^hiiiiHQKKKKKKKK	 %_55 R
%&&&% 	CCCCCC""7+++F'**q  LZ    
Q$'''   s3   - 
BABB1D) D) )E5:1E00E5)NNNrH   r+  )r   NFN)r   )=rf   r[  r   ioversion_inforT  rU  r   r  r   r   StringEncodingr   Scanningr	   r
   r   r   r   r   Symtabr   r   r   r   r   CmdLiner   Lexiconr   r   r   r   r$   r   r   r  r   r?  r   r  __file__r   r(   r:  rh   rD  rN  rj   re   r<  dictru  r~  r  r  cached_functionr   r  r  r  r   r%   r#   <module>r     s   
			 				 



 				BQB&  JH55QTQabdcdbdQeKfKffgggCHQKKK       ) ) ) ) ) ) 8 8 8 8 8 8 8 8 < < < < < < < < < < < <                   8 8 8 8 8 8 8 8 ' ' ' ' ' 'M M M M M M M M M M M M   066..)?@@N0113 3  !bj!7!78K!L!LMM  GLL!:!:;;ZHHJ J W! W! W! W! W! W! W! W!t# # #   A A A$  (+ + +h       
 
 
 
 
 
 
 
@- - - - -4 - - - 
 
 
H H H H&" " " "J4 4 4 4B 7 7 7 7t   "" " "           r%   