
    Ae                     X   d dl mZ d dlZd dlZd dlZd dlZej                  dd dk  sdej                  dd cxk  rdk  rFn nCej                  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 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 ej>                  Z ej@                  d      Z!d Z"ejF                  jI                  ejF                  jK                  ejF                  jM                  e'      ejF                  jP                  d            Z) G d de*      Z+ G d de*      Z,d Z-d Z.dKdZ/ G d de*      Z0 G d de*      Z1 G d d e*      Z2 G d! d"e3      Z4dLd#Z5d$ Z6dKd%Z ejn                  dMd'       Z8d( Z9dNd)Z: e3dOi d*d d+d d,dd-d d.dd/dd0dd1dd2d d3d d4d5d6dd7d d8d d9i d:i d;d&d<d&d=d>d?d>d@ddAd&dBd&dCddDddEddFddGddHddIddJd&Z;y# e$ r eZY w xY w)P    )absolute_importN   )r      )   r   )r   r   z8Sorry, Cython requires Python 2.6+ or 3.3+, found %d.%d
   )
basestring)Errors)EncodedString)PyrexScannerFileSourceDescriptor)
PyrexErrorCompileErrorerrorwarning)ModuleScope)Utils)Options)Versionz2[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$Includesc                       e Zd Zy)CompilationDataN)__name__
__module____qualname__     4lib/python3.12/site-packages/Cython/Compiler/Main.pyr   r   ,   s     	r   r   c                       e Zd ZdZdZ	 	 ddZd ZddZd Zd Z	d Z
	 	 ddZdd	Zd
 Zd Z	 d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 Zd Zy)ContextNc                 >   ddl m}m} d|j                  i| _        |j                  |       | _        | j                  | j                  d<   || _        t               | _	        || _
        || _        || _        i | _        i | _        || j                  |       d | _        y )Nr   )BuiltinCythonScope__builtin__cython) r!   r"   builtin_scopemodulescreate_cython_scopecython_scopeinclude_directoriessetfuture_directivescompiler_directivescppoptionspxds	_internedset_language_levelgdb_debug_outputwriter)selfr*   r-   r.   language_levelr/   r!   r"   s           r   __init__zContext.__init__J   s     	+%(=(=>';;DA!%!2!2X#6 !$#6 	%##N3&*#r   c                    ddl m}m}m}m} t               }|dk(  rd}n!t        |      }|dk\  r|j                  |       |dk\  r|j                  |||g       || _	        || _
        |dk\  r| j                  d   | j                  d<   y y )Nr   )print_functionunicode_literalsr   division3strr   r#   builtins)Futurer8   r9   r   r:   r+   intaddupdater5   r,   r'   )r4   levelr8   r9   r   r:   r,   s          r   r2   zContext.set_language_levelb   s    WWEF?EJEz!%%&67A:$$nox%PQ#!2A:'+||M'BDLL$ r   c                     t         ||f}	 | j                  |   S # t        $ r Y nw xY wt        |      }|r||_        || j                  |<   |S N)r
   r1   KeyErrorencoding)r4   valuerE   keys       r   intern_ustringzContext.intern_ustringr   s[    eX.	>>#&& 		e$%EN#ss    	&&c                     t        |      |f|z   }	 | j                  |   S # t        $ r Y nw xY w|| j                  |<   |S rC   )typer1   rD   )r4   rF   rG   s      r   intern_valuezContext.intern_value~   sN    E{E"S(	>>#&& 		#ss   ! 	--c                 P   ddl m} t        |t              rj|j                  dk(  r[t        ||t        j                               }t        || j                        }|j                  | |      }|j                  ||      }|S |j                  | ||      }|j                  ||      }|S )Nr   Pipelinepyx)r%   rN   
isinstancer   
_file_typeCompilationSourceosgetcwdcreate_default_resultobjr/   create_pyx_as_pxd_pipelinerun_pipelinecreate_pxd_pipeline)	r4   source_descscopemodule_namerN   sourceresult_sinkpipelineresults	            r   process_pxdzContext.process_pxd   s    k#78[=S=SW\=\&{KMF264<<HK::4MH**8V<F   33D%MH**8[AFr   c                 ,    t        j                  |      S rC   )r	   report_error)r4   excs     r   nonfatal_errorzContext.nonfatal_error   s    ""3''r   c           
         d}|rt        d|d|d|d|       d }d }|r%|r|j                  |      }	n|j                  }	|}d }n|}	t        j	                  |	      st        |xs |ddfd|z        |rE|rt        d       |j                  |      }|s%| j                  |	|      }|r|j                  |      }|s:|rt        d       |r|}	| }|	j                  d	      D ]  }
|j                  |
      } |rt        d
|z         |j                  sM|rt        d       |s|rt        d       | j                  |	||      }|rt        d|z         |s]|r[d|_
        | j                  |	d|      }|r|j                  d      rn-t        |d|	j                  d	t        j                         z         |rd|_
        	 |rt        d|z         |j                  d	t        j                         t        j"                  j%                  |      d   z   }|j                  |      s|}t'        ||      }| j)                  |||	      \  }}|r||\  }}||f| j*                  |<   |S |S # t
        $ r Y |S w xY w)Nr   z#Context.find_module: module_name = z, relative_to = z, pos = z, need_pxd = z'%s' is not a valid module namez...trying relative importz...trying absolute import.z...scope = %sz...pxd not loadedz...looking for pxd filesys_pathz......found %sT.pyz__init__.pyz'%s.pxd' not foundzContext.find_module: Parsing %sr   )printqualify_namequalified_namemodule_name_patternmatchr   lookup_submodulefind_pxd_filefind_submodulesplitpxd_file_loadedsearch_include_directoriesendswithr   replacerS   seppathsplitextr   r`   r0   )r4   r[   relative_toposneed_pxdabsolute_fallbackdebug_find_modulerZ   pxd_pathnamerl   namepackage_pathnamerel_pathrY   errr_   pxd_codenodes	pxd_scopes                     r   find_modulezContext.find_module   s    [#x9 : !,!9!9+!F "-!;!;#"(N"((8s9{Aq&9@;NP P  1200=E#11.#F'66{CE 12 !,E&,,S1 3,,T23 /E)*$$ )*$34  $11.#PX1Y$*\9:# -1E)'+'F'F~W\^a'b$',<,E,Em,Tc#7.:P:PQTVXV\V\:]#]^(,%(?,NO*223?"''BRBRS_B`abBccH'00:#/"6|X"NK"&"2"2;~"VKC!	17.]I.;Y-GDIIk* u $ s   =B"I# #	I0/I0c           	         | j                  |d||      }|f|j                  d      s|dv rPt        j                  j	                  t        j                  j                  t        j                  j                  t        j                  j                  t              t        j                  j                  d                  }t        j                  j                  |d      }| j                  j                  |       	 | j                  |d|      }| j                  j                          |rQ|}|j                  d      rt        |d|z  d       n-|d	v rt        |d
|d|d
d       n|dv rt        |d|z  d       |"t        j                  r| j!                  ||      S |S # | j                  j                          w xY w)N.pxdrg   python)stdlibstdiostlr   
Deprecatedz!'%s' is deprecated, use 'cpython'r   )r   r   'z' is deprecated, use 'libc.r   z$'%s' is deprecated, use 'libcpp.*.*')rt   
startswithrS   rx   abspathnormpathjoindirname__file__pardirr*   appendpopr   r   cimport_from_pyxfind_pyx_file)r4   rl   r{   rh   pxdstandard_include_pathdeprecated_include_pathr   s           r   rp   zContext.find_pxd_file   sy    --nfcT\-];))(3"&@@(*8H8HRWW__X%>PZ[9] )^%*,'',,7Ll*['((//0GH399.&RUVC,,002)Dx0%H4%OQRS!44DRV%WYZ[%%Kd%RTUV;733%%nc::
 ,,002s   ?F% %Gc                 (    | j                  |d|      S )Nz.pyx)rt   )r4   rl   r{   s      r   r   zContext.find_pyx_file  s     ..~vsKKr   c                 R    | j                  |d|d      }|st        |d|z         |S )Nr%   T)includez'%s' not found)rt   r   )r4   filenamer{   rx   s       r   find_include_filezContext.find_include_file  s:     ..xS7; / =#'(23r   c                     | j                   }|r|t        j                  z   }t        |t        gz         }t        |||||      S rC   )r*   sysrx   tupler   rt   )r4   rl   suffixr{   r   rh   include_dirss          r   rt   z"Context.search_include_directories   sK    //'#((2L\-B,CCD),*0#w@ 	@r   c                 ,    t        j                  |      S rC   )r   find_root_package_dir)r4   	file_paths     r   r   zContext.find_root_package_dir*  s    **955r   c                 @    t        j                  |t        |            S rC   )r   check_package_dirr   )r4   dirpackage_namess      r   r   zContext.check_package_dir-  s    &&sE-,@AAr   c                    t         j                  j                  |      syt        j                  |      }t        j
                  ||      ry|g}t        j                  |d      }t         j                  j                  |      rt        j
                  ||      ry| j                  |      D ]Q  \  }}|dk(  r| j                  ||      }n|dk(  r| j                  ||      }n7|s:t        j
                  ||      sQ y y)Nr   r   cimportr   r   )
rS   rx   existsr   modification_timefile_newer_thanreplace_suffixread_dependency_filerp   rt   )	r4   source_pathoutput_pathc_timer{   pxd_pathkindr   dep_paths	            r   c_file_out_of_datezContext.c_file_out_of_date0  s    ww~~k*((5  f5m''V<77>>(#(=(=h(O33K@ 	JD$y --dC8"::4EE11(FC	 r   c                 `    | j                  |      D cg c]  \  }}|dk(  r| c}}S c c}}w )Nr   )r   )r4   r   r   r   s       r   find_cimported_module_namesz#Context.find_cimported_module_namesE  s8    (,(A(A+(N (*$I%  ( 	( (s   *c                 ,    t        j                  |      S rC   )r   is_package_dir)r4   dir_paths     r   r   zContext.is_package_dirI  s    ##H--r   c                 N   t        j                  |d      }t        j                  j	                  |      rkt        |d      }|j                         D cg c]4  }d|j                         v r |j                         j                  dd      6 }}|j                          |S yc c}w )Nz.deprU r   r   )
r   r   rS   rx   r   open	readlinesstriprr   close)r4   r   r   flinechunkss         r   r   zContext.read_dependency_fileL  s    ''V<77>>(#Xt$A#$;;=0- zz|))#q1 0F 0 GGIM0s   9B"c                 :    | j                   j                  |d       S rC   )r'   get)r4   r   s     r   ro   zContext.lookup_submoduleX  s    ||d++r   c                 f    | j                  |      }|st        |d |       }|| j                  |<   |S )N)parent_modulecontext)ro   r   r'   )r4   r   rZ   s      r   rq   zContext.find_submodule\  s9    %%d+ $6E!&DLLr   c                 ^   t        |t              st        d      |j                  }| j                  |_        t
        j                  }	 t        j                  |      5 }ddl	m
} t        |||j                  ||       }	|j                  |	||      }
| j                  j                  r	 ddlm} |j                  |       d d d        t
        j                  |kD  r
t+               
S # t$        $ r t        d      w xY w# 1 sw Y   @xY w# t&        $ r}| j)                  ||      d }~ww xY w)N$Only file sources for code supportedr   )Parsing)source_encodingrZ   r   r   )ConcreteSyntaxTreezLFormal grammar can only be used with compiled Cython with an available pgen.)rP   r   RuntimeErrorr   r.   r	   
num_errorsr   open_source_filer%   r   r   rE   p_moduler/   formal_grammarParserr   ImportErrorUnicodeDecodeError_report_decode_errorr   )r4   rY   rZ   r   full_module_namesource_filenamer   r   r   streer   es                r   parsezContext.parsee  s(   +';<EFF%..HH	&&
	<''8 AA% K1::).$@''30@A<<..l? '//@A" z).  ' l*jl llA A " 	< ++K;;	<sI   
D A
D *C(0D D (C==D  D	D 	D,D''D,c                 ~   |j                   d   }|j                   d   }|j                   d   }d}dx}}t        j                  |j                  ddd      5 }	t	        |	d      D ].  \  }}
|t        |
      z  }||k\  s||t        |
      z
  z
  dz   } n d d d        t        |||fd	|d
|d      S # 1 sw Y   xY w)Nr   r   r   rz	iso8859-1r%   )rE   newlinezjDecoding error, missing or incorrect coding=<encoding-name> at top of source (cannot decode with encoding : ))argsior   r   	enumeratelenr   )r4   rY   rc   msgpositionrE   r   columnidxr   datas              r   r   zContext._report_decode_error  s    hhrl88A;88A;WW[))3bQ 	UV'1o 
ds4y (?%s4y9A=F		 k40PXZ]_` 	`	 	s   &B3>B33B<c                    t         j                  j                  |      \  }}t         j                  j                  |      \  }}d|v r|S |g}| j	                  |      rMt         j                  j                  |      \  }}	||k(  rn%|j                  |	       |}| j	                  |      rM|j                          dj                  |      S )Nrf   )rS   rx   rr   ry   r   r   reverser   )
r4   rx   r/   r   r   r[   _namesparentpackage_names
             r   extract_module_namezContext.extract_module_name  s     d+X))(3Q+!!#&#%77==#5 FL}LL&C !!#& 	xxr   c                     t        j                          |j                  r(t        j                  |j
                  d      x}|_        nd }t        j                  ||j                         y )Nz.lis)rx   echo_to_stderr)	r	   resetuse_listing_filer   r   main_source_filelisting_fileopen_listing_fileerrors_to_stderr)r4   r/   r_   rx   s       r   setup_errorszContext.setup_errors  sT    ##).)=)=f>U>UW])^^D6&D  d070H0H	Jr   c                    |j                   j                  }t        |t              st	        d      t        j                          t
        j                  |_        |j                  dkD  rd}|rS|j                  rF	 t        j                  |j                  t        j                  |j                               d |_        y y y # t        $ r Y w xY w)Nr   r   T)compilation_sourcerY   rP   r   r   r	   close_listing_filer   c_filer   castrate_filerS   statr   EnvironmentError)r4   r   r/   r_   rY   s        r   teardown_errorszContext.teardown_errors  s    //;;+';<EFF!!#"--q C6==##FMM277;;O;O3PQ !FM !3 $ s   ;=C 	CC)FNNrC   )NNr   T)T)FF)r   r   r   r)   r5   r6   r2   rH   rK   r`   rd   r   rp   r   r   rt   r   r   r   r   r   r   ro   rq   r   r   r   r  r
  r   r   r   r   r   ;   s     LNEJ.2+0C 

( MN&*WrBL
 <A@6B*(.
,:`$"J!r   r   c                 |   |j                   rd}nd}t        j                  | |      }|j                  rt        j
                  j                  ||j                        }t        j
                  j                  |      r=t        j
                  j                  |t        j
                  j                  |            S |S |S )Nz.cppz.c)	cplusr   r   output_filerS   rx   r   isdirbasename)r   cwdr/   c_suffixsuggested_file_nameout_paths         r   get_output_filenamer    s    }}..I77<<W%8%8977=="77<<"''*:*:;N*OPPO""r   c                     t               }| j                  j                  |_        | |_        | j                  }t        |j                  | j                  |      |_        |j                  |_        |S rC   )	CompilationResultrY   r   r   r  r  r  r  embedded_metadata)r  r/   r_   rY   s       r   rU   rU     sc     F0<<EEF 2F$00K'(<(<*..9FM&88FMr   c                     ddl m} t        j                  j	                  |       d   }|j                  |dd         ||j                         }t        j                         }t        j                  j                  |       }|xs |j                  | |      }t        j                  |       |j                  r7|j                  dt        j                        |z   }|j                  |      s| }n|}t!        ||      }	t#        |	||      } t%        | |      }
|j&                  t        j                  j	                  |
j(                        d   dz   }t        j                  j+                  |      r;t-        j.                  |dd      5 }d	|j1                  d
      v rd|_        d d d        |j3                         dk(  s|s|j5                  |||
      }n|j7                  |||
      }|j9                  ||
       |j;                  ||       \  }}|j=                  |||
       |^|j>                  rRddl m!}  ||      jE                  |
jF                        }t        jH                  |
j(                  |
jF                  |       |
S # 1 sw Y   xY w)Nr   rM   rf   r   z.htmlr   zUTF-8)rE   z<!-- Generated by Cythond   Tri   r   )create_dependency_tree)%r%   rN   rS   rx   ry   configure_language_defaultscreate_contextrT   r   r   r   $raise_error_if_module_name_forbidden'relative_path_in_code_position_commentsrv   rw   ru   r   rR   rU   annotater  r   r   r   readlowercreate_py_pipelinecreate_pyx_pipeliner  rW   r
  depfileBuild.Dependenciesr  all_dependenciesr   write_depfile)r\   r/   r   r   rN   
source_extr  abs_pathr   rY   r_   html_filename	html_filer^   r   enddatar  dependenciess                     r   rW   rW     s-   !!&)!,J''
127((* ))+Cwwv&H'W7+F+Fvw+W	../?@66#++C8:E  *H&x:K{,<cBF &fg6F((7:WD77>>-(g> ,).)..2EE'+G$,
 U"*..wH//&I&)((6:LCC&1
{w?-g6GGH_H_`FMM6+B+BLQM#, ,s   	JJc                       e Zd ZdZd Zy)rR   zk
    Contains the data necessary to start up a compilation pipeline for
    a single compilation unit.
    c                 .    || _         || _        || _        y rC   )rY   r   r  )r4   rY   r   r  s       r   r6   zCompilationSource.__init__  s    & 0r   Nr   r   r   __doc__r6   r   r   r   rR   rR     s    r   rR   c                   *    e Zd ZdZddZd Zd Zd Zy)CompilationOptionsz
    See default_options at the end of this module for a list of all possible
    options and CmdLine.usage and CmdLine.parse_command_line() for their
    meaning.
    Nc                    g | _         |rt        |t              r|j                  }nt        }t        |      }|j                  |       t        |      t        t              z
  }|j                  dg       |r2dt        |      dkD  rdndddj                  |      }t        |      t        j                         }t        |d         }t        |      t        |      z
  }|r2d	t        |      dkD  rdndd
dj                  |      }t        |      ||d<   |j                  dd      r|d   sdd l}	|	j!                  d       d|d<   d|v rd|vr	|d   |d<   n%|j                  d      s|j                  d      |d<   d|v rd|vr|d   |d<   |d   du r5t"        j$                  j                  t'        j(                         d      |d<   | j                  j                  |       y )Ninclude_pathzgot unknown compilation optionr   r   r%   z, please remove: z, r-   zgot unknown compiler directiver   
np_pythranFr  r   z%C++ mode forced when in Pythran mode!Tr5   r   cachecompiler)r5  rP   r3  __dict__default_optionsdictr@   r+   difference_updater   r   
ValueErrorr   get_directive_defaultsr   warningswarnrS   rx   r   get_cython_cache_dir)
r4   defaultskwr/   unknown_optionsmessagedirective_defaults
directivesunknown_directivesr?  s
             r   r6   zCompilationOptions.__init__#  s   ($67#,,&Hx.r g,_)==))>*:;?+a/R7		/*,G W%%$;;='"789
 _s3E/FF-.2:		,-/G W%%)3%&>>,.ww7GMMAB#GGz).>b.H(23C(DG$%-.(:(>(>?O(PG$%z).>b.H(23C(DG$%7t#!ww||E,F,F,H*UGGW%r   c                 f    |dk(  r,| j                   j                  d      d| j                   d<   y y y )NpybindingT)r-   r   )r4   source_extensions     r   r  z.CompilationOptions.configure_language_defaultsR  s;    t#''++I6>6:((3 ? $r   c                 r    t        | j                  | j                  | j                  | j                  |       S )N)r/   )r   r5  r-   r  r5   r4   s    r   r  z!CompilationOptions.create_contextW  s2    t(($*B*Bzz4#6#6F 	Fr   c                    i }| j                   j                         D ]  \  }}|dv r|dv r|dv r|dv r|dv r|dv r$|dv r)|dv r.|d	v r3|d
v r|||<   =|dv r|||<   G|dv r|||<   Q|dv r|||<   [|dgk(  r| j                  snt        d      |dgk(  r| j                  st        d      |||<    fd |      S )zi
        Return a string that contains all the options that are relevant for cache invalidation.
        )show_versionr  verbosequiet)r  
output_dir)
timestamps)r7  )r-   )r5  )working_path)create_extension)	build_dir)r   generate_pxir  annotate_coverage_xml)r   evaluate_tree_assertions)r  emit_linenumsc_line_in_traceback	gdb_debugr  )r  r5   compile_time_envr6  capi_reexport_cincludesz=capi_reexport_cincludes is not compatible with Cython cachingcommon_utility_include_dirzDcommon_utility_include_dir is not compatible with Cython caching yetc           
          t        | t              r=t        | j                         D cg c]  \  }}t	        |       |      f c}}      } t	        |       S c c}}w )z
            Recursively turn item into a string, turning dicts into lists with
            deterministic ordering.
            )rP   r;  sorteditemsrepr)itemrG   rF   to_fingerprints      r   rf  z:CompilationOptions.get_fingerprint.<locals>.to_fingerprint  sP    
 $%TXT^T^T`ajc5S	>%+@Aab: bs   A
)r9  rc  r_  NotImplementedErrorr`  )r4   r   rG   rF   rf  s       @r   get_fingerprintz"CompilationOptions.get_fingerprint[  sL   
 ----/ 9	"JCNN55&	!//(( (( ,, % aa "S	FF!S	  N  N!S	UU!S	233//-.mnn56622-.tuu "S	s9	"v	 d##r   rC   )r   r   r   r1  r6   r  r  rh  r   r   r   r3  r3    s    
-&^;
FK$r   r3  c                       e Zd ZdZd Zy)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
    c                 t    d | _         d | _        d | _        d | _        d | _        d | _        d | _        d | _        y rC   )r  h_filei_fileapi_filer   object_fileextension_filer   rN  s    r   r6   zCompilationResult.__init__  s>     " $r   Nr0  r   r   r   r  r    s    %r   r  c                       e Zd ZdZdZd Zy)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                 L    || |<   | xj                   |j                   z  c_         y rC   )r   )r4   r\   r_   s      r   r?   zCompilationResultSet.add  s    V6,,,r   N)r   r   r   r1  r   r?   r   r   r   rq  rq    s     J-r   rq  c                     t        | ||      S )z
    compile_single(source, options, full_module_name)

    Compile the given Pyrex implementation file and return a CompilationResult.
    Always compiles a single file; does not perform timestamp checking or
    recursion.
    )rW   )r\   r/   r   s      r   compile_singlert    s     )9::r   c                 |   |j                   rt        |       dkD  rt        d      | D cg c]!  }t        j                  j                  |      # } }t               }t               }|j                  }|j                  }d}t        j                         }| D ]  }||vs||j                         }t        |||      }	|j                  ||	      }
|r|
rQ|r"t        j                  j!                  d|z         t#        |||j                   |      }|j%                  ||       d}|j%                  |        |S c c}w )z
    compile_multiple(sources, options)

    Compiles the given sequence of Pyrex implementation files and returns
    a CompilationResultSet. Performs timestamp checking and/or recursion
    if these are specified in the options.
    r   z>Full module name can only be set for single source compilationNzCompiling %s
)r   r   )r[   r   r   rS   rx   r   r+   rq  rT  rQ  rT   r  r  r   r   stderrwriterW   r?   )sourcesr/   r\   	processedresultsrT  rQ  r   r  output_filenameout_of_dater_   s               r   compile_multipler}    s2    s7|a/ ; < 	< 6==6rwwv&=G=I"$G##JooGG
))+C ""!0021&#wGO!44V_MK;JJ$$%5%>?%fg7>7J7J.57 FF+ MM&!!"" N1 >s   &D9c                     t        dd|i|}t        | t              r|j                  st	        | ||      S 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.
    rB  r   )r3  rP   r   rT  rt  r}  )r\   r/   r   kwdss       r   compiler    sE     !<G<t<G&*%g.@.@fg/?@@00r   Fc                 :   |rs|d   }t        |t              st        d      |r.t        j                  j                  |j                        f| z   } n#t        j                  |j                        f| z   } |}|r||z  }|s.|j                  d      }t        |dd       }|d   }	|	|z   }
d|z   }| D ]  }t        j                  j                  ||      }t        j                  j                  |      r|c S |rIt        j                  |      }|bt        j                  j                  |
      }t        j                  j                  |      r|c S t        j                  j                  |	      }t        j                  j                  |      s|c S  y)a$  
    Search the list of include directories for the given file name.

    If a source file 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   rf   Nr   r6   )rP   r   r   rS   rx   r   r   r   r   rr   r   r   r   r   )dirsrl   r   r{   r   	file_descdotted_filenamer   r   r[   module_filenamepackage_filenamer   rx   package_dirs                  r   rt   rt     sj    F	)%9:EFFGGOOI$6$679D@D//	0B0BCELD$O6!$$S)eCRj)Bi%.%.  ww||G_577>>$K11'=IK&ww||KA77>>$'Kww||K$4677>>$'K  r   c                      t        d      S )Nr   )command_line)mainr   r   r   setuptools_mainr  O  s    q!!r   c                 6   t         j                  dd  }d}| rddlm}  ||      \  }}nt	        t
              }|}|j                  r&t         j                  j                  dt        z         |j                  dk7  rt        j                  |j                         	 t        ||      }|j                  dkD  rd}|rt        j$                  d       y y # t        t         f$ r7}t         j                  j                  t#        |      dz          d}Y d }~Zd }~ww xY w)Nr   r   )parse_command_linezCython version %s
r%   
)r   argvCmdLiner  r3  r:  rP  rv  rw  versionrU  rS   chdirr  r   r	  r   strexit)r  r   any_failuresr  r/   rx  r_   r   s           r   r  r  S  s    88AB<DL/-d3$_5

.89R
%%&'*q L   j) 

Q$'s   C D!-DDrP  r   r  r  r  r$  r  rY  rX  r_  rU  r%   rT  rQ  rR  r-   r  rZ  r[  r  Tr\  r5   r   r]  r^  r`  rS  rW  r7  rV  r[   r6  )NNrC   )F)r   r   )<
__future__r   rS   rer   r   version_inforv  rw  r   r  r#   r   r   r  r%   r	   StringEncodingr
   Scanningr   r   r   r   r   r   Symtabr   r   r   r   r  r  rm   rQ  rx   r   r   r   r   r   r   objectr   r   r  rU   rW   rR   r3  r  r;  rq  rt  r}  cached_functionrt   r  r  r:  r   r   r   <module>r     s  
 ' 	 	 
 	BQ& Fc.>.>r.B$KV$KJJPSXY\YiYijlklYmSnnoCHHQK&  ) 8 < <    
// bjj!VW 
RWW__X5N(*
)D E 	f 	@!f @!F# 0r I$ I$X% %4-4 - ;%P1" . .n">        	 
       !                  ! "  %# $ % & /3' ( ) * + , - . / 0 1 2 "&3 4 5 6 7 8 9 : ; < = > ? A  Js   H H)(H)