
    <>i                        S SK r S SKrS SKrS SKrS SKrS SKrS SKJs  J	r
  \ R                  R                  \ R                  R                  \5      5      r\ R                   R#                  SS5      r\ R&                  S:X  a  S/rO\ R&                  S:X  a  SS/rO/ rS	rS
 r\R.                  R0                  \R.                  R2                  S 5       5       r\R.                  R0                  \R.                  R2                  S 5       5       rg)    NPYARROW_TEST_LD_PATH posixz
-std=c++20ntz"-D_ENABLE_EXTENDED_ALIGNED_STORAGEz
/std:c++20a[  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,
    )
c                 p   [         R                  " / SQ5      nU R                  U5      S:X  d   e[        R                  " [
        SS9   U R                  S 5        S S S 5        [         R                  " S5      nU R                  U[         R                  " 5       5      nU[         R                  " S5      :X  d   e[        R                  " [        SS9   U R                  U[         R                  " [         R                  " 5       5      5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)N)         r
   znot an arraymatch{   123z<Unsupported cast from int64 to list using function cast_list)paarrayget_array_lengthpytestraises	TypeErrorscalarcast_scalarutf8NotImplementedErrorlist_int64)modarrscal	cast_scals       X/var/www/html/land-tabula/venv/lib/python3.13/site-packages/pyarrow/tests/test_cython.pycheck_cython_example_moduler    D   s    
((9
C$)))	y	7T" 
8 99S>Dbggi0I		%((((	*)
* 	bhhrxxz23
* 
* 
8	7
* 
*s   	D:D'
D$'
D5c           	      D   SSK nU R                  5          Sn[        R                  " [        R
                  R                  [        U5      [        R
                  R                  [        U 5      U5      5        [        R                  U[        [        S9n[        SS5       nUR                  U5        SSS5        [        R                   " 5       n["        R$                  " [&        R(                  SSS/US	9  [&        R
                  SS n[&        R
                  R+                  S[        U 5      5         [-        S
5      n[/        U5        U[&        l        S[0        R2                  " 5        S3nSn	[&        R4                  S:X  a  [7        [        S5      (       d  Su  pO[&        R4                  S:X  a  Su  pOSu  pU	(       aj  [&        R
                  nU[0        R2                  " 5       -  nXR9                  U	S5      /-  nU Vs/ s H  o(       d  M  UPM     nnW
R                  U5      XY'   ["        R$                  " [&        R(                  SU/["        R:                  US9  SSS5        g! , (       d  f       GN= f! U[&        l        f = fs  snf ! , (       d  f       g= f)z 
Basic test for the Cython API.
r   Nzpyarrow_cython_example.pyxpyx_filecompiler_optstest_ld_pathsetup.pyw	build_ext	--inplaceenvpyarrow_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
        win32add_dll_directory);PATHdarwin):DYLD_LIBRARY_PATH)r2   LD_LIBRARY_PATHr   z-c)stdoutr+   )cythonas_cwdshutilcopyfileospathjoinherestrsetup_templateformatr$   r%   openwrite	test_util get_modified_env_with_pythonpath
subprocess
check_callsys
executableinsert
__import__r    r   get_library_dirsplatformhasattrgetPIPE)tmpdirr6   r#   
setup_codefsubprocess_env	orig_pathr   codepath_vardelimpathsr;   s                r   test_cython_apirY   U   s    	/T84S[(;	= $**H9F8D + F
 *c"aGGJ #
 #CCE 	s~~z*K9"0	2
 HHQK	3v;'	!56C', CH //12 	3	& <<7"2233 #.\\X%6OE84OEHHER((**E((2677E&+4edtTeE4',zz%'8N$s~~tT:%/__"0	2I 
 #"& !CHL 5E 
sQ   BJ!I*3B J4I<
B9J
JJA
J*
I9	4J<J		J
Jc           	         U R                  5          Sn[        R                  " [        R                  R                  [        U5      [        R                  R                  [        U 5      U5      5        [        R                  U[        [        S9n[        SS5       nUR                  U5        S S S 5        [        R                  " 5       n[         R"                  " [$        R&                  SSS/US9  S S S 5        [$        R                  R)                  S[        U 5      5        [+        S	5      n/ S
Qn/ nUR-                  XgR.                  5        Xv:X  d   e[0        R2                  " [4        SS9   S nUR-                  Xh5        S S S 5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       g = f)Nz bound_function_visit_strings.pyxr"   r&   r'   r(   r)   r*   r   bound_function_visit_strings)abcwtfr   c                 &    U S:X  a  [        S5      eg )Nr]   r_   )
ValueError)ss    r   
raise_on_b&test_visit_strings.<locals>.raise_on_b   s    Cx ''     )r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   r$   r%   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   _visit_stringsappendr   r   ra   )	rP   r#   rQ   rR   rS   r   stringsvisitedrc   s	            r   test_visit_stringsrj      sN    
5T84S[(;	= $**H9F8D + F
 *c"aGGJ # #CCE 	s~~z*K9"0	2 
& HHOOAs6{#
3
4CGGw/	z	/	( 	7/ 
0	/' #" 
8 
0	/s1   BFF/AF0F0
F	F
F-0
F>)r:   r8   rE   rG   r   pyarrowr   pyarrow.tests.utiltestsutilrC   r;   dirnameabspath__file__r=   environrN   r%   namer$   r?   r    marknumpyr6   rY   rj    re   r   <module>rw      s   $ 
   
   & &	wwrwwx01zz~~4b977g!NMWW_9<HMM>4" M2  M2` "0  "0re   