
    (phZ                     (   S r SSKrSSKrSSKrSSKJr  SSKrSSKrSSK	J
r
  S r\R                  R                  SSS	/S
S/5      \R                  R                  SS9S 5       5       rS rS r\R                  R                  SSS/5      S 5       rg)z0See https://github.com/numpy/numpy/pull/11937.

    N)import_module   )utilc                      [         R                  " 5       (       d  [        R                  " S5        [         R                  " 5       (       d  [        R                  " S5        g g )NzNeeds C compilerzNeeds FORTRAN 77 compiler)r   has_c_compilerpytestskiphas_f77_compiler     Y/var/www/html/venv/lib/python3.13/site-packages/numpy/f2py/tests/test_compile_function.pysetup_moduler      s?      &'  ""/0 #r   
extra_argsz--nooptz--debugz--noopt --debug z$Imported module seems never deleted.)reasonc           	      `   Sn[         R                  " 5       n[         R                  " 5       n[        R                  " 5       n[        R
                  R                  U[        [        R                  " 5       5      S-   5      nUS 4 HK  n[         R                  " U5         [        R                  R                  UUU US9nUS:X  d   e S S S 5        MM     [        R                  S:w  a5  [!        U5      nUR#                  5       n	U	S:X  d   e[        R$                  U	 g g ! , (       d  f       M  = f)NzT
        integer function foo()
        foo = 10 + 5
        return
        end
    z.f)
modulenamer   	source_fnr   win32   )r   get_module_dirget_temp_module_nameosgetcwdpathjoinstruuiduuid4	switchdirnumpyf2pycompilesysplatformr   foomodules)
r   fsourcemoddirmodnamecwdtargetr   ret_valreturn_checkcalc_results
             r   test_f2py_init_compiler0      s    G   "F'')G
))+CWW\\&#djjl"3d":;F d^	
 ^^F#jj((4;4>3< ) >G a<< $# $" ||w %W-"&&(b    KK   $#s   )D
D-	c                  R    [         R                  R                  S5      n U S:X  d   eg )N   invalidr   )r!   r"   r#   )r-   s    r   test_f2py_init_compile_failurer3   O   s$     jj  ,Ga<<r   c                       [         R                  n S[         l        [        R                  R	                  S5      nUS:X  d   e U [         l        g ! W [         l        f = f)Nzdoes not existr2      )r$   
executabler!   r"   r#   )tempr-   s     r   test_f2py_init_compile_bad_cmdr8   V   sH    ~~) **$$Z0#~~s   AA Ar(   z'program test_f2py
end program test_f2pys'   program test_f2py
end program test_f2pyc                     [         R                  " U 5         [        R                  R	                  USSS9nUS:X  d   e S S S 5        g ! , (       d  f       g = f)Ntest_compile_from_stringsz.f90)r   	extensionr   )r   r    r!   r"   r#   )tmpdirr(   r-   s      r   r:   r:   h   sK     
	**$$W0K/5 % 7 !||	 
 		s   (A		
A)__doc__r$   r   r   	importlibr   r   
numpy.f2pyr!   r   r   r   markparametrizeleaks_referencesr0   r3   r8   r:   r   r   r   <module>rC      s     	  #   1 $i02CRHJ%KL1! MJ1!h$ 23r   