+
    KV-j$  ã                   óŠ   € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RItRR.tRRRRRRRR/R	 ltRR
 lt	R t
R tR tR tR tR tR# )zb
Build a c-extension module on-the-fly in tests.
See build_and_import_extensions for usage hints

NÚbuild_and_import_extensionÚcompile_extension_moduleÚprologueÚ Ú	build_dirÚinclude_dirsÚ	more_initc               ó”  € Vf   . pV\        W4      ,           pRpV'       g   \        P                  ! R4      pV'       d   VR,          pWu,          pVR,          p\        WV4      p\	        WWH4      p	^ RIp
V
P                  P                  W	4      pV
P                  P                  V4      pVP                  P                  V4       V# )a¢  
Build and imports a c-extension module `modname` from a list of function
fragments `functions`.


Parameters
----------
functions : list of fragments
    Each fragment is a sequence of func_name, calling convention, snippet.
prologue : string
    Code to precede the rest, usually extra ``#include`` or ``#define``
    macros.
build_dir : pathlib.Path
    Where to build the module, usually a temporary directory
include_dirs : list
    Extra directories to find include files when compiling
more_init : string
    Code to appear in the module PyMODINIT_FUNC

Returns
-------
out: module
    The module will have been loaded and is ready for use

Examples
--------
>>> functions = [("test_bytes", "METH_O", """
    if ( !PyBytesCheck(args)) {
        Py_RETURN_FALSE;
    }
    Py_RETURN_TRUE;
""")]
>>> mod = build_and_import_extension("testme", functions)
>>> assert not mod.test_bytes('abc')
>>> assert mod.test_bytes(b'abc')
Nz›
    PyObject *mod = PyModule_Create(&moduledef);
    #ifdef Py_GIL_DISABLED
    PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
    #endif
           Ú.z.#define INITERROR return NULL
                z
return mod;)Ú_make_methodsÚpathlibÚPathÚ_make_sourcer   Úimportlib.utilÚutilÚspec_from_file_locationÚmodule_from_specÚloaderÚexec_module)ÚmodnameÚ	functionsr   r   r   r   ÚbodyÚinitÚsource_stringÚmod_soÚ	importlibÚspecÚfoos   &&$$$$       Úp/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/numpy/testing/_private/extbuild.pyr   r      sº   € ðN ÒØˆØ”m IÓ7Õ7€Dð€D÷ Ü—L’L Ó%ˆ	ßØð õ 	ˆàÕˆØˆOÕ€DÜ  °Ó5€MÜ%Ø˜Ló9€FãØ�>‰>×1Ñ1°'ÓB€DØ
�.‰.×
)Ñ
)¨$Ó
/€CØ‡K�K×Ñ˜CÔ Ø€Jó    c                óî   € V P                  R4      R,          pW,          pVP                  RR7       \        W74      pT;'       g    . pT;'       g    . pT;'       g    . p\        W‡V,          W$VR7      # )a  
Build an extension module and return the filename of the resulting
native code file.

Parameters
----------
name : string
    name of the module, possibly including dots if it is a module inside a
    package.
builddir : pathlib.Path
    Where to build the module, usually a temporary directory
include_dirs : list
    Extra directories to find include files when compiling
libraries : list
    Libraries to link into the extension module
library_dirs: list
    Where to find the libraries, ``-L`` passed to the linker
r
   T©Úexist_ok)Úoutputfilenamer   Ú	librariesÚlibrary_dirséÿÿÿÿ)ÚsplitÚmkdirÚ_convert_str_to_fileÚ
_c_compile)	ÚnameÚbuilddirr   r   r$   r%   r   ÚdirnameÚcfiles	   &&&&&&   r   r   r   R   su   € ð* �j‰j˜‹o˜bÕ!€GØ�o€GØ‡M�M˜4€MÔ Ü  Ó8€EØ×%Ð% 2€LØ—�˜R€IØ×%Ð% 2€LäØ¨Õ/Ø!Ø!ô
ð 
r   c                ó¸   € VR,          pVP                  R4      ;_uu_ 4       pVP                  \        V 4      4       RRR4       V#   + '       g   i     T# ; i)zwHelper function to create a file ``source.c`` in `dirname` that contains
the string in `source`. Returns the file name
zsource.cÚwN)ÚopenÚwriteÚstr)Úsourcer-   ÚfilenameÚfs   &&  r   r)   r)   v   sG   € ð ˜Õ#€HØ	�‰�s×	Ô	˜qØ	�‰”�F“Ô÷ 
à€O÷ 
Ö	à€Oús   £AÁA	c           
     ó$  € . p. pV  FS  w  rEpV RV 2pRV9   d   RpMRpVP                  RV: RV: RV: R24       R	V V R
V R2p	VP                  V	4       KU  	  RP                  V4      RRRP                  V4      RV/,          ,           p
V
# )zäTurns the name, signature, code in functions into complete functions
and lists them in a methods_table. Then turns the methods_table into a
``PyMethodDef`` structure and returns the resulting code fragment ready
for compilation
Ú_ÚMETH_KEYWORDSz2(PyObject *self, PyObject *args, PyObject *kwargs)z (PyObject *self, PyObject *args)z{"z", (PyCFunction)z, z},z
        static PyObject* z
        {
        z
        }
        Ú
a6  
    static PyMethodDef methods[] = {
    %(methods)s
    { NULL }
    };
    static struct PyModuleDef moduledef = {
        PyModuleDef_HEAD_INIT,
        "%(modname)s",  /* m_name */
        NULL,           /* m_doc */
        -1,             /* m_size */
        methods,        /* m_methods */
    };
    Úmethodsr   )ÚappendÚjoin)r   r   Úmethods_tableÚcodesÚfuncnameÚflagsÚcodeÚ	cfuncnameÚ	signatureÚ	func_coder   s   &&         r   r   r   €   sÉ   € ð €MØ€EÛ!*Ñˆ˜Ø�i˜q  
Ð+ˆ	Ø˜eÔ#ØL‰Ià:ˆIØ×ÒÛ08»)ÃUÐKô	MðØ#˜ Y Kð 0	à	ˆð 	ðˆ	ð 	�‰�YÖñ "+ð  �9‰9�UÓð ð �d—i‘i Ó.°	¸7Ð
CõDõ D€Dð €Kr   c                ó$   € RRV RVRV/,          pV# )zFCombines the code fragments into source code ready to be compiled
    zn
    #include <Python.h>

    %(body)s

    PyMODINIT_FUNC
    PyInit_%(name)s(void) {
    %(init)s
    }
    r+   r   r   © )r+   r   r   rB   s   &&& r   r   r   ¨   s)   € ð	ð 	��f˜d F¨Dðõ€Dð €Kr   c           	      óÎ   € . p\         P                  R 8X  d   R.pVP                  R4       M,\         P                  P                  R4      '       d   . ROpM. p\	        WWeW#V4      # )Úwin32z/we4013z/DEBUGÚlinux)z-O0z-gz%-Werror=implicit-function-declarationz-fPIC)ÚsysÚplatformr<   Ú
startswithÚbuild)r.   r#   r   r$   r%   Ú
link_extraÚcompile_extras   &&&&&  r   r*   r*   º   sd   € à€JÜ
‡|�|�wÔØ"˜ˆØ×Ñ˜(Õ#Ü	�‰×	 Ñ	  ×	)Ò	)òK‰ð ˆäØØØ ó/ð /r   c                óŽ  € V P                   R,          p\        P                  ! VRR7       \        V P                   R,          R4      ;_uu_ 4       pV U	u. uF  p	RV	,           NK  	  p
p	VP	                  \
        P                  ! RVP                  R,           RV P                  R,           R	V R
V
 RV R24      4       RRR4       V P                   R,          p\        VR4      ;_uu_ 4       pVP	                  \
        P                  ! R\        P                   R24      4       RRR4       \        P                  R8X  d   \        P                  ! . ROVR7       M4\        P                  ! RRRRR\        P                  ! V4       2.VR7       VP                  R,          \        4       ,           p\        P                  ! RR.VR7       \        P                  ! \!        W|,          4      V P                   V,          4       V P                   V,          # u up	i   + '       g   i     ELg; i  + '       g   i     EL; i)zuse meson to buildrN   Tr!   zmeson.buildÚwtz-Lz“            project('foo', 'c')
            py = import('python').find_installation(pure: false)
            py.extension_module(
                'z',
                'z',
                c_args: z,
                link_args: z',
                include_directories: z,
            )
        Nz.mesonpy-native-file.iniz-            [binaries]
            python = 'z
'
        rI   ÚmesonÚsetupú--vsenvú..)Úcwdz--native-file=Úcompiler&   )rS   rT   z--buildtype=releaserU   rV   )ÚparentÚosÚmakedirsr1   r2   ÚtextwrapÚdedentÚpartsrK   Ú
executablerL   Ú
subprocessÚ
check_callÚfspathÚget_so_suffixÚrenamer3   )r.   r#   rP   rO   r   r$   r%   r   ÚfidÚdÚ	link_dirsÚnative_file_nameÚso_names   &&&&&&&      r   rN   rN   Ì   sî  € ð —‘˜wÕ&€IÜ‡K‚K�	 DÕ)Ü	ˆe�l‰l˜]Õ*¨D×	1Ô	1°SÙ'3Ó4¡| !�T˜A—X�X¡|ˆ	Ð4Ø�	‰	”(—/’/ð 'ð !×&Ñ& rÕ*Ð+ð ,Ø—+‘+˜b•/Ð"ð #Ø&˜ð (Ø%˜;ð '&Ø&2 ^ð 4	ð
#ó 
ô 
	÷ 
2ð —|‘|Ð&@Õ@ÐÜ	Ð ×	%Ô	%¨Ø�	‰	”(—/’/ð 'ä—~‘~Ð&ð '	ð#ó ô 	÷ 
&ô
 ‡|�|�wÔÜ×Òò 0ð #,ö	 ô 	×Ò˜w¨°Ø# ~´b·i²iÐ@PÓ6QÐ5RÐ%SðUà"+õ	 ð
 ×"Ñ" 2Õ&¬«Õ8€GÜ×Ò˜7 IÐ.°IÕ>Ü‡I‚IŒc�)Õ%Ó&¨¯©°wÕ(>Ô?Ø�<‰<˜'Õ!Ð!ùòC 5÷ 
2×	1Ð	1ú÷ 
&×	%Ð	%ús+   ÁHÁHÁ(AHÃ08H3ÈHÈH0	È3I	c                  óF   € \         P                  ! R 4      p V '       g   Q hV # )Ú
EXT_SUFFIX)Ú	sysconfigÚget_config_var)Úrets    r   rc   rc   ÷   s   € Ü
×
"Ò
" <Ó
0€Cß€Jˆ3Ø€Jr   )NN)Ú__doc__rZ   r   r`   rK   rl   r\   Ú__all__r   r   r)   r   r   r*   rN   rc   rG   r   r   Ú<module>rq      su   ðñó 
Û Û Û 
Û Û à'Ð)CÐ
D€ð>Ø(*ð>Ø6:ð>àð>à%'ô>ôB!
òHò%òPò$/ò$("ôVr   