K iddlZddlZddlZddlZddlZddlZddlmcm Z ejjejjeZej j#ddZej&dk(rdgZnej&dk(rddgZngZd Zd Zej.j0ej.j2d Zej.j0ej.j2d Zy) NPYARROW_TEST_LD_PATHposixz -std=c++17ntz"-D_ENABLE_EXTENDED_ALIGNED_STORAGEz /std:c++17a[if 1: from setuptools import setup from Cython.Build import cythonize import numpy as np import pyarrow as pa ext_modules = cythonize({pyx_file!r}) compiler_opts = {compiler_opts!r} custom_ld_path = {test_ld_path!r} for ext in ext_modules: # XXX required for numpy/numpyconfig.h, # included from arrow/python/api.h ext.include_dirs.append(np.get_include()) ext.include_dirs.append(pa.get_include()) ext.libraries.extend(pa.get_libraries()) ext.library_dirs.extend(pa.get_library_dirs()) if custom_ld_path: ext.library_dirs.append(custom_ld_path) ext.extra_compile_args.extend(compiler_opts) print("Extension module:", ext, ext.include_dirs, ext.libraries, ext.library_dirs) setup( ext_modules=ext_modules, ) cTtjgd}|j|dk(sJtjt d5|jddddtj d}|j|tj}|tj dk(sJtjtd5|j|tjtjdddy#1swYxYw#1swYyxYw)N)r z not an arraymatch{123zDbggi0I  %( (( ( *) *4 bhhrxxz2344 ## 44s D8DDD'c ddl}|j5d}tjtj j t|tj j t||tj|tt}tdd5}|j|dddtj }t#j$t&j(dddg| t&j dd}t&j j+dt| t-d }t/||t&_d t1j2d }d} t&j4d k(rt7tds$d\} } nt&j4dk(rd\} } nd\} } | rct&j } | t1j2z } | |j9| dgz } | D cgc]} | s|  } }  j | || <t#j$t&j(d|gt"j:|dddy#1swYxYw#|t&_wxYwcc} w#1swYyxYw)z( Basic test for the Cython API. rNzpyarrow_cython_example.pyxpyx_file compiler_opts test_ld_pathsetup.pyw build_ext --inplaceenvpyarrow_cython_examplezif 1: import sys import os try: # Add dll directory was added on python 3.8 # and is required in order to find extra DLLs # only for win32 for dir in a*: os.add_dll_directory(dir) except AttributeError: pass mod = __import__('pyarrow_cython_example') arr = mod.make_null_array(5) assert mod.get_array_length(arr) == 5 assert arr.null_count == 5 win32add_dll_directory);PATHdarwin):DYLD_LIBRARY_PATH)r2LD_LIBRARY_PATHrz-c)stdoutr+)cythonas_cwdshutilcopyfileospathjoinherestrsetup_templateformatr$r%openwrite test_util get_modified_env_with_pythonpath subprocess check_callsys executableinsert __import__r rget_library_dirsplatformhasattrgetPIPE) tmpdirr6r# setup_codefsubprocess_env orig_pathrcodepath_vardelimpathsr;s rtest_cython_apirYUs/ F2/ T84 S[(; =$**H9F8D+F *c " a GGJ  #CCE s~~z*K9"0 2 HHQK  3v;' !56C ' , CH//12 3  & <<7 "223#.x \\X %6OE84OE8 HHE R((* *E n((267 7E&+4dtT4E4',zz%'8N8 $s~~tT:%/__"0 2IF2F2  &!CHL5EF2F2sQBJ#I5BJ7I+ B/J<I;I;A JI( #J+ I88JJ c r|j5d}tjtjj t |tjj t||tj|tt}tdd5}|j|dddtj}t!j"t$j&dddg|dddt$jj)dt|t+d }gd }g}|j-||j.||k(sJt1j2t4d 5d }|j-||dddy#1swYxYw#1swYxYw#1swYyxYw)Nz bound_function_visit_strings.pyxr"r&r'r(r)r*rbound_function_visit_strings)abcwtfr c$|dk(r tdy)Nr]r_) ValueError)ss r raise_on_bz&test_visit_strings..raise_on_bsCx '')r7r8r9r:r;r<r=r>r?r@r$r%rArBrCrDrErFrGrHrIrJ_visit_stringsappendrrra) rPr#rQrRrSrstringsvisitedrcs rtest_visit_stringsrisl 25 T84 S[(; =$**H9F8D+F *c " a GGJ  #CCE s~~z*K9"0 22&HHOOAs6{# 3 4CGGw/ g   z /0 ( 7J/ 00'  22800s1BF!F1AF!6F-F F!!F*-F6)r:r8rErGrpyarrowrpyarrow.tests.utiltestsutilrCr;dirnameabspath__file__r=environrNr%namer$r?r marknumpyr6rYrirdrrvs$  && wwrwwx01zz~~4b9 77g!NMWW_9<HMM> 4"M2M2`"0"0rd