o
    Ô­jOc  ã                   @   s   d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl	Z	d dl
Z
ddlmZ d dlmZ eddƒZd‡d
d„Ze
jdd�dd„ ƒZe
jdd�dd„ ƒZe
jdd�dd„ ƒZe
jdd�dd„ ƒZe
jdd�dd„ ƒZe
jdd�dd„ ƒZdd„ Zdd„ Zdd„ Zd d!„ Zd"d#„ Zd$d%„ Ze
jj e	 !¡ d&kpŸej"d'kd(d)�d*d+„ ƒZ#e
jj e	 !¡ d&kp´ej"d'kd(d)�d,d-„ ƒZ$e
jj%d.d/„ ƒZ&d0d1„ Z'd2d3„ Z(d4d5„ Z)d6d7„ Z*d8d9„ Z+d:d;„ Z,d<d=„ Z-d>d?„ Z.d@dA„ Z/dBdC„ Z0dDdE„ Z1dFdG„ Z2dHdI„ Z3dJdK„ Z4e
jj%dLd)�dMdN„ ƒZ5dOdP„ Z6dQdR„ Z7dSdT„ Z8dUdV„ Z9dWdX„ Z:dYdZ„ Z;d[d\„ Z<d]d^„ Z=d_d`„ Z>e
jj%dLd)�dadb„ ƒZ?dcdd„ Z@dedf„ ZAdgdh„ ZBdidj„ ZCdkdl„ ZDdmdn„ ZEdodp„ ZFdqdr„ ZGdsdt„ ZHdudv„ ZIdwdx„ ZJdydz„ ZKd{d|„ ZLd}d~„ ZMdd€„ ZNd�d‚„ ZOdƒd„„ ZPd…d†„ ZQdS )ˆé    N)ÚPath)Ú
namedtupleé   )Úutil)ÚmainÚPPathsz(finp, f90inp, pyf, wrap77, wrap90, cmodfÚuntitledc              
   C   sR   t | ƒ}t| d¡| d¡| d¡| |› d�¡| |› d�¡| |› d�¡d�S )ax  Takes in a temporary file for testing and returns the expected output and input paths

    Here expected output is essentially one of any of the possible generated
    files.

    ..note::

         Since this does not actually run f2py, none of these are guaranteed to
         exist, and module names are typically incorrect

    Parameters
    ----------
    fname_inp : str
                The input filename
    mname : str, optional
                The name of the module, untitled by default

    Returns
    -------
    genp : NamedTuple PPaths
            The possible paths which are generated, not all of which exist
    z.fz.f90ú.pyfz-f2pywrappers.fz-f2pywrappers2.f90úmodule.c)ÚfinpÚf90inpÚpyfÚwrap77Úwrap90Úcmodf)r   r   Úwith_suffixÚ	with_name)Ú	fname_inpÚmnameÚbpath© r   úY/var/www/html/CropPilot/venv/lib/python3.10/site-packages/numpy/f2py/tests/test_f2py2e.pyÚget_io_paths   s   úr   Úsession)Úscopec                 C   ó2   t  dddd¡ ¡ }|  ¡ d }|j|dd� |S )ú'Generates a single f90 file for testingÚtestsÚsrcÚclizhiworld.f90z	hello.f90Úascii©Úencoding©r   ÚgetpathÚ	read_textÚgetbasetempÚ
write_text©Útmpdir_factoryÚfdatÚfnr   r   r   Úhello_world_f909   ó   r,   c                 C   ó2   t  dddd¡ ¡ }|  ¡ d }|j|dd� |S )z(F90 file for testing warnings in gh23598r   r   Úcrackfortranzgh23598Warn.f90r    r!   r#   r(   r   r   r   Úgh23598_warnB   r-   r0   c                 C   r.   )z8F90 file for testing disallowed CLI arguments in ghff819r   r   r   zgh_22819.pyfr    r!   r#   r(   r   r   r   Úgh22819_cliK   r-   r1   c                 C   r   )ú'Generates a single f77 file for testingr   r   r   zhi77.fzhello.fr    r!   r#   r(   r   r   r   Úhello_world_f77T   r-   r3   c                 C   r   )r2   r   r   Úreturn_realzfoo77.fzfoo.fr    r!   r#   r(   r   r   r   Úretreal_f77]   r-   r5   c                 C   s`   t  dddd¡ ¡ }t  dddd¡ ¡ }|  ¡ d }|  ¡ d }|j|dd	� |j|dd	� |S )
r   r   r   Úf2cmapzisoFortranEnvMap.f90z.f2py_f2cmapz
f2cmap.f90Úmapfiler    r!   r#   )r)   r*   r6   r+   Úfmapr   r   r   Ú
f2cmap_f90e   s   r9   c                 C   s    t |ƒ}| tdd|› � ¡ ¡ t |j¡�0 tƒ  dd„ |j d¡D ƒ}d|vs+J ‚d|vs1J ‚d|v s7J ‚d	|v s=J ‚	 W d  ƒ dS 1 sIw   Y  dS )zÝCheck that module names are handled correctly
    gh-22819
    Essentially, the -m name cannot be used to import the module, so the module
    named in the .pyf needs to be used instead

    CLI :: -m and a .pyf file
    Úargvúf2py -m blah c                 S   s   g | ]	}|  ¡ r|j‘qS r   )Úis_fileÚname)Ú.0Úitemr   r   r   Ú
<listcomp>}   s    z$test_gh22819_cli.<locals>.<listcomp>Ú*zblahmodule.czblah-f2pywrappers.fztest_22819-f2pywrappers.fztest_22819module.czIgnoring blahN)	r   ÚsetattrÚsysÚsplitr   Ú	switchdirÚparentÚf2pycliÚrglob)Úcapfdr1   ÚmonkeypatchÚipathÚ	gen_pathsr   r   r   Útest_gh22819_cliq   s   "ùrM   c              	   C   s˜   t |ƒ}| tdd|› d� ¡ ¡ t |j¡�+ tjt	dd�� t
ƒ  W d  ƒ n1 s-w   Y  W d  ƒ dS W d  ƒ dS 1 sEw   Y  dS )zBOnly one .pyf file allowed
    gh-22819
    CLI :: .pyf files
    r:   r;   z
 hello.pyfzOnly one .pyf file per call)ÚmatchN)r   rB   rC   rD   r   rE   rF   ÚpytestÚraisesÚ
ValueErrorrG   )rI   r1   rJ   rK   r   r   r   Útest_gh22819_many_pyf…   s   ÿÿ"ÿrR   c                 C   sz   t |dd�}|j}| tdd|› d� ¡ ¡ t |j¡� tƒ  |j	 
¡ }d|vs+J ‚W d   ƒ d S 1 s6w   Y  d S )NÚtest©r   r:   úf2py z -m testzintproductf2pywrap, intpr)r   r   rB   rC   rD   r   rE   rF   rG   r   r%   )rI   r0   rJ   ÚfoutlrK   Úwrapperr   r   r   Útest_gh23598_warn‘   s   þ
"ýrX   c                 C   s–   t |ƒ}t |ƒjd }| tdd|› d|› � ¡ ¡ t |j¡�! tƒ  |  	¡ \}}d|v s0J ‚t |› ƒ 
¡ s9J ‚W d  ƒ dS 1 sDw   Y  dS )zIEnsures that a signature file is generated via the CLI
    CLI :: -h
    r	   r:   zf2py -h ú úSaving signatures to fileN)r   ÚstemrB   rC   rD   r   rE   rF   rG   Ú
readouterrÚexists)rI   r,   rJ   rK   ÚopathÚoutÚ_r   r   r   Útest_gen_pyfž   s   "üra   c                 C   s|   t |ƒ}| tdd|› � ¡ ¡ t |j¡� tƒ  |  ¡ \}}d|v s&J ‚d|v s,J ‚W d  ƒ dS 1 s7w   Y  dS )zHEnsures that a signature file can be dumped to stdout
    CLI :: -h
    r:   zf2py -h stdout rZ   zfunction hi() ! in N©	r   rB   rC   rD   r   rE   rF   rG   r\   ©rI   r,   rJ   rK   r_   r`   r   r   r   Útest_gen_pyf_stdout­   s   "ürd   c              	   C   s¼   t |ƒ}| tdd|› � ¡ ¡ t |j¡�> t dƒjddd� t 	t
¡� tƒ  |  ¡ \}}d|v s5J ‚W d  ƒ n1 s?w   Y  W d  ƒ dS W d  ƒ dS 1 sWw   Y  dS )	zjEnsures that the CLI refuses to overwrite signature files
    CLI :: -h without --overwrite-signature
    r:   úf2py -h faker.pyf ú	faker.pyfú	Fake newsr    r!   z&Use --overwrite-signature to overwriteN)r   rB   rC   rD   r   rE   rF   r'   rO   rP   Ú
SystemExitrG   r\   )rI   r,   rJ   rK   r`   Úerrr   r   r   Útest_gen_pyf_no_overwriteº   s   ýþ"þrj   ÚLinux)é   é   zCompiler and 3.12 required)Úreasonc                 C   sp   t |ƒ}| tdd|› � ¡ ¡ t |j¡� tƒ  |  ¡ \}}d|v s&J ‚W d  ƒ dS 1 s1w   Y  dS )z@Check that modules are named correctly

    CLI :: defaults
    r:   zf2py --backend meson -c zuntitledmodule.cNrb   rc   r   r   r   Útest_untitled_cliÉ   s   "ýro   c              	   C   sN  d}t ||d�}|j}| tdd|› d|› � ¡ ¡ t |j¡� tƒ  |  	¡ \}}d|v s0J ‚W d  ƒ n1 s:w   Y  | tdd ¡ ¡ t |j¡� tƒ  |  	¡ \}}d	|v s^J ‚W d  ƒ n1 shw   Y  d
}| tdd|› d|› d� ¡ ¡ t |j¡� tƒ  |  	¡ \}}d|v s•J ‚W d  ƒ dS 1 s w   Y  dS )zqCheck that no distutils imports are performed on 3.12
    CLI :: --fcompiler --help-link --backend distutils
    ÚhirT   r:   rU   z -c --fcompiler=gfortran -m z%--fcompiler cannot be used with mesonNzf2py --help-linkzUse --dep for meson buildsÚhi2z -c -m z --backend distutilsz.Cannot use distutils backend with Python>=3.12)
r   r   rB   rC   rD   r   rE   rF   rG   r\   )rI   r,   rJ   ÚMNAMErV   rK   r_   r`   r   r   r   Ú!test_no_py312_distutils_fcompilerØ   s8   ÿý
ÿýÿ"ýrs   c                 C   sÀ   t |dd�}|j}d}d}| tdd|› d|› � ¡ ¡ t |j¡�4 tƒ  |  	¡ \}}| ¡ D ]}	d|	› d	�|v s<J ‚q0| ¡ D ]}
d
|
› d�|v sMJ ‚qAW d  ƒ dS 1 sYw   Y  dS )z9Tests that functions can be skipped
    CLI :: skip:
    rS   rT   út0 t4 t8 sd s8 s4útd s0r:   rU   z -m test skip: z=buildmodule: Could not found the body of interfaced routine "ú". Skipping.úConstructing wrapper function "ú"N©
r   r   rB   rC   rD   r   rE   rF   rG   r\   )rI   r5   rJ   rV   rK   ÚtoskipÚ	remainingr_   ri   ÚskeyÚrkeyr   r   r   Útest_f2py_skipø   s&   þ

ÿÿ"ùr~   c                 C   sÀ   t |dd�}|j}d}d}| tdd|› d|› � ¡ ¡ t |j¡�4 tƒ  |  	¡ \}}| ¡ D ]}	d|	› d	�|v s<J ‚q0| ¡ D ]}
d
|
› d�|v sMJ ‚qAW d  ƒ dS 1 sYw   Y  dS )z>Test that functions can be kept by only:
    CLI :: only:
    rS   rT   rt   ru   r:   rU   z -m test only: ú<buildmodule: Could not find the body of interfaced routine "rv   rw   rx   Nry   )rI   r5   rJ   rV   rK   rz   Útokeepr_   ri   r|   r}   r   r   r   Útest_f2py_only  s&   þ

ÿÿ"ùr�   c                 C   sØ   t |dd�}|j}d}t|ƒ}d}d}	| tdd|› d|	› d	|› d
|› � ¡ ¡ t |j¡�4 t	ƒ  |  
¡ \}
}| ¡ D ]}d|› d�|v sHJ ‚q<| ¡ D ]}d|› d�|
v sYJ ‚qMW d  ƒ dS 1 sew   Y  dS )zfTests that it is possible to return to file processing mode
    CLI :: :
    BUG: numpy-gh #20520
    rS   rT   rt   ztd s0 hiÚblahr:   rU   ú -m z only: z : r   rv   rw   rx   N)r   r   r   rB   rC   rD   r   rE   rF   rG   r\   )rI   r,   r5   rJ   rV   rK   rz   Úipath2r€   r   r_   ri   r|   r}   r   r   r   Útest_file_processing_switch'  s,   ý

ÿÿ"ùr…   c                 C   sŠ   d}t ||d�}|j}| tdd|› d|› � ¡ ¡ t |j¡� tƒ  W d  ƒ n1 s.w   Y  t	 
|j¡s;J ‚t	 
|j¡sCJ ‚dS )zHChecks the generation of files based on a module name
    CLI :: -m
    rp   rT   r:   rU   rƒ   N)r   r   rB   rC   rD   r   rE   rF   rG   r   r]   r   r   )rI   r,   rJ   rr   rV   rK   r   r   r   Útest_mod_gen_f77E  s   ÿr†   c              	   C   s¾   d}t ||d�}|j}| tdd|› d|› d� ¡ ¡ t |j¡�4 tƒ  t	dƒ 
¡ �}| ¡ }d|v s6J ‚W d	  ƒ n1 s@w   Y  W d	  ƒ d	S W d	  ƒ d	S 1 sXw   Y  d	S )
z�Check that pyf files are correctly generated with module structure
    CLI :: -m <name> -h pyf_file
    BUG: numpy-gh #20520
    rp   rT   r:   rU   rƒ   z
 -h hi.pyfzhi.pyfzpython module hiN)r   r   rB   rC   rD   r   rE   rF   rG   r   ÚopenÚread)rI   r3   rJ   rr   rV   rK   ÚhipyfÚpyfdatr   r   r   Útest_mod_gen_gh25263V  s    þþ"þr‹   c           	      C   s$  t |dd�}|j}t d¡}t d¡}| tdd|› d� ¡ ¡ t |j	¡�# t
ƒ  |  ¡ \}}| |¡dus9J ‚| |¡du sBJ ‚W d  ƒ n1 sLw   Y  | tdd|› d	� ¡ ¡ t |j	¡�$ t
ƒ  |  ¡ \}}| |¡du swJ ‚| |¡dus€J ‚W d  ƒ dS 1 s‹w   Y  dS )
zHLowers cases by flag or when -h is present

    CLI :: --[no-]lower
    rS   rT   zHI\(\)zhi\(\)r:   rU   z -m test --lowerNz -m test --no-lower)r   r   ÚreÚcompilerB   rC   rD   r   rE   rF   rG   r\   Úsearch©	rI   r3   rJ   rV   rK   ÚcapshiÚcapslor_   r`   r   r   r   Útest_lower_cmodf  s(   

üÿ"ür’   c           	   	   C   s4  t |dd�}|j}t d¡}t d¡}| tdd|› d|j› d� ¡ ¡ t 	|j
¡�# tƒ  |  ¡ \}}| |¡d	us=J ‚| |¡d	u sFJ ‚W d	  ƒ n1 sPw   Y  | tdd|› d|j› d
� ¡ ¡ t 	|j
¡�$ tƒ  |  ¡ \}}| |¡d	u sJ ‚| |¡d	usˆJ ‚W d	  ƒ d	S 1 s“w   Y  d	S )z^Lowers cases in signature files by flag or when -h is present

    CLI :: --[no-]lower -h
    rS   rT   z	Block: HIz	Block: hir:   rU   z -h z -m test --overwrite-signatureNz) -m test --overwrite-signature --no-lower)r   r   rŒ   r�   rB   rC   r   rD   r   rE   rF   rG   r\   rŽ   r�   r   r   r   Útest_lower_sig€  s6   

ýüü"ür“   c              
   C   sŒ   t |ƒ}d}d}| tdd|› d|› d|› � ¡ ¡ t |j¡� tƒ  |  ¡ \}}d|› d�|v s4J ‚W d	  ƒ d	S 1 s?w   Y  d	S )
zNEnsures that the build directory can be specified

    CLI :: --build-dir
    r‚   Útttmpr:   úf2py -m rY   z --build-dir zWrote C/API module "rx   Nrb   )rI   r,   rJ   rK   r   Úodirr_   r`   r   r   r   Útest_build_dir§  s   ÿ"ýr—   c                 C   s„   t |ƒ}| tdd|› d� ¡ ¡ t |j¡�! t dƒjddd� tƒ  |  	¡ \}}d|v s0J ‚W d	  ƒ d	S 1 s;w   Y  d	S )
zXEnsures that the build directory can be specified

    CLI :: --overwrite-signature
    r:   re   z --overwrite-signaturerf   rg   r    r!   rZ   N)
r   rB   rC   rD   r   rE   rF   r'   rG   r\   rc   r   r   r   Útest_overwrite¸  s   þ"ür˜   c              	   C   sÎ   t |ƒ}d}| tdd|› d|› d� ¡ ¡ t |j¡�A tƒ  |  ¡ \}}d|v s,J ‚t |› d�ƒ 	¡ �}d| 
¡ v s>J ‚W d	  ƒ n1 sHw   Y  W d	  ƒ d	S W d	  ƒ d	S 1 s`w   Y  d	S )
zJEnsures that TeX documentation is written out

    CLI :: --latex-doc
    r‚   r:   r•   rY   z --latex-docúDocumentation is saved to fileú
module.texú\documentclassN©r   rB   rC   rD   r   rE   rF   rG   r\   r‡   rˆ   ©rI   r,   rJ   rK   r   r_   r`   Úotexr   r   r   Útest_latexdocÉ  s   ÿÿü"ürŸ   c              	   C   ó|   t |ƒ}d}| tdd|› d|› d� ¡ ¡ t |j¡� tƒ  |  ¡ \}}d|vs,J ‚W d  ƒ dS 1 s7w   Y  dS )zMEnsures that TeX documentation is written out

    CLI :: --no-latex-doc
    r‚   r:   r•   rY   z --no-latex-docr™   Nrb   ©rI   r,   rJ   rK   r   r_   r`   r   r   r   Útest_nolatexdocÛ  ó   ÿ"ýr¢   c              	   C   sÐ   t |ƒ}d}| tdd|› d|› d� ¡ ¡ t |j¡�B tƒ  |  ¡ \}}d|v s,J ‚t d|› d�ƒ 	¡ �}d	| 
¡ vs?J ‚W d
  ƒ n1 sIw   Y  W d
  ƒ d
S W d
  ƒ d
S 1 saw   Y  d
S )zžEnsures that truncated documentation is written out

    TODO: Test to ensure this has no effect without --latex-doc
    CLI :: --latex-doc --short-latex
    r‚   r:   r•   rY   z --latex-doc --short-latexr™   ú./rš   r›   Nrœ   r�   r   r   r   Útest_shortlatexë  s"   ýÿü"ür¥   c              	   C   sÐ   t |ƒ}d}| tdd|› d|› d� ¡ ¡ t |j¡�B tƒ  |  ¡ \}}d|v s,J ‚t d|› d�ƒ 	¡ �}d	| 
¡ v s?J ‚W d
  ƒ n1 sIw   Y  W d
  ƒ d
S W d
  ƒ d
S 1 saw   Y  d
S )zIEnsures that RsT documentation is written out

    CLI :: --rest-doc
    r‚   r:   r•   rY   z --rest-docú#ReST Documentation is saved to filer¤   zmodule.restz.. -*- rest -*-Nrœ   )rI   r,   rJ   rK   r   r_   r`   Úorstr   r   r   Útest_restdoc  s   ÿÿü"ür¨   c              	   C   r    )zLEnsures that TeX documentation is written out

    CLI :: --no-rest-doc
    r‚   r:   r•   rY   z --no-rest-docr¦   Nrb   r¡   r   r   r   Útest_norestexdoc  r£   r©   c              	   C   s¸   t |ƒ}d}| tdd|› d|› d� ¡ ¡ t |j¡�6 tƒ  t d|› d�ƒ ¡ �}d| 	¡ v s3J ‚W d	  ƒ n1 s=w   Y  W d	  ƒ d	S W d	  ƒ d	S 1 sUw   Y  d	S )
zIEnsures that debugging wrappers are written

    CLI :: --debug-capi
    r‚   r:   r•   rY   z --debug-capir¤   r
   z#define DEBUGCFUNCSN©
r   rB   rC   rD   r   rE   rF   rG   r‡   rˆ   )rI   r,   rJ   rK   r   Úocmodr   r   r   Útest_debugcapi#  s   ÿÿþ"þr¬   zConsistently fails on CI.c              	   C   s¨   t | ƒ}d}| tdd|› d|› d� ¡ ¡ t |j¡�. tƒ  t d¡}t	j
|ddd	�}d
}t d¡}|j|ks;J ‚|j|ksBJ ‚W d  ƒ dS 1 sMw   Y  dS )zEEnsures that debugging wrappers work

    CLI :: --debug-capi -c
    r‚   r:   r•   rY   z -c --debug-capiz#python3 -c "import blah; blah.hi()"TúUTF-8©Úcapture_outputr"   ú Hello World
a   debug-capi:Python C/API function blah.hi()
debug-capi:float hi=:output,hidden,scalar
debug-capi:hi=0
debug-capi:Fortran subroutine `f2pywraphi(&hi)'
debug-capi:hi=0
debug-capi:Building return value.
debug-capi:Python C/API function blah.hi: successful.
debug-capi:Freeing memory.
        N)r   rB   rC   rD   r   rE   rF   rG   ÚshlexÚ
subprocessÚrunÚtextwrapÚdedentÚstdoutÚstderr)r,   rJ   rK   r   Úcmd_runÚroutÚeoutÚeerrr   r   r   Útest_debugcapi_bld3  s   ÿ


"ðr¼   c              	   C   sä   t |ƒ}d}| tdd|› d|› � ¡ ¡ t |j¡� tƒ  W d  ƒ n1 s)w   Y  |  ¡ \}}d|v s:J ‚| tdd|› d|› d� ¡ ¡ t |j¡� tƒ  |  ¡ \}}d|v s`J ‚W d  ƒ dS 1 skw   Y  dS )zoEnsures that fortran subroutine wrappers for F77 are included by default

    CLI :: --[no]-wrap-functions
    r‚   r:   r•   rY   Nú Fortran 77 wrappers are saved toz --wrap-functionsrb   r¡   r   r   r   Útest_wrapfunc_defQ  s    ÿÿ"ýr¾   c              	   C   r    )zeEnsures that fortran subroutine wrappers for F77 can be disabled

    CLI :: --no-wrap-functions
    r‚   r:   r•   rY   z --no-wrap-functionsr½   Nrb   r¡   r   r   r   Útest_nowrapfuncj  r£   r¿   c              	   C   sÈ   t |ƒ}d}| tdd|› d|› d� ¡ ¡ t |j¡�> tƒ  t d|› d�ƒ ¡ �}| 	¡ }d|v s5J ‚d	|v s;J ‚W d
  ƒ n1 sEw   Y  W d
  ƒ d
S W d
  ƒ d
S 1 s]w   Y  d
S )zcAdd to the include directories

    CLI :: -include
    TODO: Document this in the help string
    r‚   r:   r•   rY   z' -include<stdbool.h> -include<stdio.h> r¤   r
   z#include <stdbool.h>z#include <stdio.h>Nrª   )rI   r,   rJ   rK   r   r«   Úocmrr   r   r   Útest_inclheaderz  s$   üýþ"þrÁ   c                   C   ó   dS )z?Add to the include directories

    CLI :: --include-paths
    Nr   r   r   r   r   Útest_inclpath‘  ó   rÃ   c                   C   rÂ   )z;Add to the include directories

    CLI :: --help-link
    Nr   r   r   r   r   Ú
test_hlinkš  rÄ   rÅ   c                 C   s¢   t |ƒ}| tdd|› d� ¡ ¡ t |j¡�0 tƒ  |  ¡ \}}d|v s'J ‚d|v s-J ‚d|v s3J ‚d|v s9J ‚d|v s?J ‚W d	  ƒ d	S 1 sJw   Y  d	S )
zOCheck that Fortran-to-Python KIND specs can be passed

    CLI :: --f2cmap
    r:   r;   z --f2cmap mapfilez!Reading f2cmap from 'mapfile' ...z&Mapping "real(kind=real32)" to "float"z'Mapping "real(kind=real64)" to "double"z,Mapping "integer(kind=int64)" to "long_long"z0Successfully applied user defined f2cmap changesNrb   )rI   r9   rJ   rK   r_   r`   r   r   r   Útest_f2cmap£  s   "ùrÆ   c                 C   sv   t |ƒ}| tdd|› d� ¡ ¡ t |j¡� tƒ  |  ¡ \}}t	|ƒdks)J ‚W d  ƒ dS 1 s4w   Y  dS )z)Reduce verbosity

    CLI :: --quiet
    r:   r;   z --quietr   N)
r   rB   rC   rD   r   rE   rF   rG   r\   Úlenrc   r   r   r   Ú
test_quietµ  s   "ýrÈ   c                 C   sr   t |ƒ}| tdd|› d� ¡ ¡ t |j¡� tƒ  |  ¡ \}}d|v s'J ‚W d  ƒ dS 1 s2w   Y  dS )z-Increase verbosity

    CLI :: --verbose
    r:   r;   z
 --verboseÚanalyzelineNrb   rc   r   r   r   Útest_verboseÃ  s   "ýrÊ   c                 C   sn   |  tdd ¡ ¡ t t¡� tƒ  |  ¡ \}}ddl}|j	| 
¡ ks%J ‚W d  ƒ dS 1 s0w   Y  dS )z"Ensure version

    CLI :: -v
    r:   zf2py -vr   N)rB   rC   rD   rO   rP   rh   rG   r\   ÚnumpyÚ__version__Ústrip)rI   rJ   r_   r`   Únpr   r   r   Útest_versionÑ  s   "ürÏ   c                 C   s†   t | ƒ}| tdd|› d� ¡ ¡ t |j¡�" tƒ  t d¡}t	j
|ddd�}d}|j|ks1J ‚W d	  ƒ d	S 1 s<w   Y  d	S )
z
    CLI :: -c
    r:   r;   z -cz"python -c "import blah; blah.hi()"Tr­   r®   r°   N)r   rB   rC   rD   r   rE   rF   rG   r±   r²   r³   r¶   )r,   rJ   rK   r¸   r¹   rº   r   r   r   Útest_npdistopß  s   
"ûrÐ   c                   C   rÂ   )z
    CLI :: -c --fcompiler
    Nr   r   r   r   r   Útest_npd_fcompileró  ó   rÑ   c                   C   rÂ   )z
    CLI :: -c --compiler
    Nr   r   r   r   r   Útest_npd_compilerû  rÒ   rÓ   c                   C   rÂ   )z$
    CLI :: -c --help-fcompiler
    Nr   r   r   r   r   Útest_npd_help_fcompiler  rÒ   rÔ   c                   C   rÂ   )z
    CLI :: -c --f77exec
    Nr   r   r   r   r   Útest_npd_f77exec  rÒ   rÕ   c                   C   rÂ   )z
    CLI :: -c --f90exec
    Nr   r   r   r   r   Útest_npd_f90exec  rÒ   rÖ   c                   C   rÂ   )z
    CLI :: -c --f77flags
    Nr   r   r   r   r   Útest_npd_f77flags  rÒ   r×   c                   C   rÂ   )z
    CLI :: -c --f90flags
    Nr   r   r   r   r   Útest_npd_f90flags#  rÒ   rØ   c                   C   rÂ   )z
    CLI :: -c --opt
    Nr   r   r   r   r   Útest_npd_opt+  rÒ   rÙ   c                   C   rÂ   )z
    CLI :: -c --arch
    Nr   r   r   r   r   Útest_npd_arch3  rÒ   rÚ   c                   C   rÂ   )z
    CLI :: -c --noopt
    Nr   r   r   r   r   Útest_npd_noopt;  rÒ   rÛ   c                   C   rÂ   )z
    CLI :: -c --noarch
    Nr   r   r   r   r   Útest_npd_noarchC  rÒ   rÜ   c                   C   rÂ   )z
    CLI :: -c --debug
    Nr   r   r   r   r   Útest_npd_debugK  rÒ   rÝ   c                   C   rÂ   )z%
    CLI :: -c --link-<resource>
    Nr   r   r   r   r   Útest_npd_link_autoS  rÒ   rÞ   c                   C   rÂ   )z/
    CLI :: -c -L/path/to/lib/ -l<libname>
    Nr   r   r   r   r   Útest_npd_lib[  rÒ   rß   c                   C   rÂ   )z
    CLI :: -D<define>
    Nr   r   r   r   r   Útest_npd_definec  rÒ   rà   c                   C   rÂ   )z
    CLI :: -U<name>
    Nr   r   r   r   r   Útest_npd_undefinek  rÒ   rá   c                   C   rÂ   )z$
    CLI :: -I/path/to/include/
    Nr   r   r   r   r   Útest_npd_incls  rÒ   râ   c                   C   rÂ   )z8
    CLI :: <filename>.o <filename>.so <filename>.a
    Nr   r   r   r   r   Útest_npd_linker{  rÒ   rã   )r   )Rr´   rŒ   rC   r²   r±   Úpathlibr   Úcollectionsr   ÚplatformrO   Ú r   Únumpy.f2py.f2py2er   rG   r   r   Úfixturer,   r0   r1   r3   r5   r9   rM   rR   rX   ra   rd   rj   ÚmarkÚskipifÚsystemÚversion_inforo   rs   Úxfailr~   r�   r…   r†   r‹   r’   r“   r—   r˜   rŸ   r¢   r¥   r¨   r©   r¬   r¼   r¾   r¿   rÁ   rÃ   rÅ   rÆ   rÈ   rÊ   rÏ   rÐ   rÑ   rÓ   rÔ   rÕ   rÖ   r×   rØ   rÙ   rÚ   rÛ   rÜ   rÝ   rÞ   rß   rà   rá   râ   rã   r   r   r   r   Ú<module>   s    ( 


'










ÿ
 

'
		
