σ 2ΔΘ[c@`sΠdZddlmZmZmZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZmZddlmZmZddlmZyddlmZWn!ek rddlmZnXdad „Zd „Z d „Z!d „Z"e"gggdd „ƒZ#e"gggddd„ƒZ$da%d„Z&d„Z'd„Z(d„Z)e"d„ƒZ*de+fd„ƒYZ,dS(sˆ Utility functions for - building and importing modules on test time, using a temporary location - detecting if compilers are present i(tdivisiontabsolute_importtprint_functionN(tasbytestasstr(tSkipTestttemppath(t import_module(tmd5(tnewcC`sltdk rhytjjtƒWntk r3nXytjtƒWntt fk r^nXdandS(N( t _module_dirtNonetsystpathtremovet ValueErrortshutiltrmtreetIOErrortOSError(((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pyt_cleanup&s  cC`sQtdkrMtjƒatjtƒttjkrMtjj dtƒqMntS(Ni( R R ttempfiletmkdtemptatexittregisterRR R tinsert(((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pytget_module_dir4s    cC`s|tƒ}x`tddƒD]O}d|}tjj||ƒ}|tjkrtjj|dƒ r|SqWtdƒ‚dS(Nii–˜s_test_ext_module_%ds.pys(Failed to create a temporary module name( RtrangetosR tjoinR tmodulestisfilet RuntimeError(tdtjtnametfn((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pytget_temp_module_name>s  &c`s(i‰‡‡fd†}ˆj|_|S(Nc`st||fƒ}|ˆkr[yˆ||Žˆ|R?R@tretsearchtbooltinttgroup(RHtscriptRWRMRNRORPtm((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pyt_get_compiler_status°s"  0!cC`s tƒdS(Ni(Re(((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pythas_c_compilerαscC`s tƒdS(Ni(Re(((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pythas_f77_compilerεscC`s tƒdS(Ni(Re(((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pythas_f90_compilerιscK`sddlm}ddlm}tƒ}g}xq|D]i}tjj|ƒsatd|ƒ‚ntjj |tjj |ƒƒ} t j || ƒ|j | ƒq6Wtj|ƒjddƒ}dtd|d ttjƒƒ} tjj |tƒd ƒ} |j | ƒt| d ƒ} | jt| ƒƒ| jƒtjƒ} z‹tj|ƒtj| d d g}tj|dtjdtjƒ}|j ƒ\}}|j!dkrΛtd|dt"|ƒfƒ‚nWdtj| ƒx|D]}tj#|ƒqγWXt$|ƒtj%|S(s6 Build a module via distutils and import it. i(t Configuration(tsetups%s is not a files s s`import os import sys sys.path = %(syspath)s def configuration(parent_name='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('', parent_name, top_path) %(config_code)s return config if __name__ == "__main__": from numpy.distutils.core import setup setup(configuration=configuration) t config_codeRYs.pytwbt build_exts-iR3R4s%Running distutils build failed: %s %siN(&tnumpy.distutils.misc_utilRitnumpy.distutils.coreRjRRR RR RR5RR6R7ttextwraptdedenttreplaceR]R&R R%RTRURtcloseR9R:R;R<R=R>R?R@RARRBt __import__R(RCRkRGR*RiRjR!RIR$RJRHRcRWRLRMRNRORP((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pytbuild_module_distutilsρs@  !"     !   tF2PyTestcB`sAeZdZdZgZgZgZdZdZ dZ d„Z RS(s.fc C`s΅tjdkrtdƒ‚n|jdk r1dStƒsItdƒ‚ng}|jrk|j|jƒn|jdk r|j |j ƒnt }t }x>|D]6}|j dƒrΎt }q |j dƒr t }q q W|rωtƒ rωtdƒ‚n|rtƒ rtdƒ‚n|jdk rit|jd|jd |jd |jd |j d |jƒ|_n|jdk r±t|jd|jd |jd |jd |jƒ|_ndS( Ntwin32s)Fails with MinGW64 Gfortran (Issue #9673)sNo C compiler availables.fs.f90s No Fortran 77 compiler availables No Fortran 90 compiler availableRDRERFRRRG(R tplatformRtmoduleR RftsourcestextendRHR7RRR\tendswithtTrueRgRhRXRDRERFRGRQ(tselftcodest needs_f77t needs_f90R$((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pyRjCs>      N( R1t __module__R RHRzRDRERFRRRyRGRj(((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pyRv9s(-t__doc__t __future__RRRRR R<RRRRpR^trandomtpytestt numpy.f2pytnumpyt numpy.compatRRt numpy.testingRRt importlibRthashlibRt ImportErrorR R R RRR%R2RQRXR[ReRfRgRhRutobjectRv(((s4/tmp/pip-build-fiC0ax/numpy/numpy/f2py/tests/util.pytsH              9  1   H