
    Bpj                        S r SSKrSSKrSSKrSSKrSSKrSSKr\R                  " SS9S   S   S   r\R                  R                  r\R                  \l        \R                  /\l        S r\R"                  R%                  S	5      R'                  S
5      r\R"                  R+                  \5       r\R.                  " \R1                  5       5      rSSS5        S rg! , (       d  f       N= f)a  
Regression test for the cython_optimize binary interface.

The __pyx_capi__ dict of each module contains PyCapsule objects whose
*name* string encodes the C-level function signature that Cython checks
at import time when another module does ``cimport``.  Any change to
those strings is a binary incompatibility that breaks every downstream
package (e.g., scikit-learn, statsmodels) compiled against the previous release,
without any compile-time warning.

The expected signatures are stored in cython_abi_signatures.json.
The test fails if:
  * an existing name disappears, or
  * an existing name's signature string changes.
Adding new names is explicitly allowed (it is not a break).
    Ndicts)modezBuild Dependenciesblaszcython blas ilp64c                     0 nU R                   R                  5        H(  u  p#[        U5      nUc  M  UR                  S5      X'   M*     U$ )z@Return {name: signature} for every entry in module.__pyx_capi__.zutf-8)__pyx_capi__items_get_capsule_namedecode)moduleresultnamecapsuleraws        `/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/scipy/optimize/tests/test_cython_abi.py_extract_capir   0   sH    F,,224(?::g.FL 5 M    zscipy.optimize.testszcython_abi_signatures.jsonc            
         [         S   n [        R                  " S5      n[        U5      n/ nU R	                  5        HO  u  pEXB;  a  UR                  SU< SU< S35        M&  X$   U:w  d  M0  UR                  SU< SU< SX$   < 35        MQ     U(       a7  SR                  U5      n[        R                  " S	[        U5       S
U 35        gg)z>No existing cython_optimize signature may change or disappear.z%scipy.optimize.cython_optimize._zerosz	REMOVED  z (was )z	CHANGED  z
  expected: z
  actual:   
z7scipy.optimize.cython_optimize._zeros.__pyx_capi__ has z ABI breakage(s):
N)
	_EXPECTED	importlibimport_moduler   r   appendjoinpytestfaillen)expectedmodactualerrorsr   expected_sigjoineds          r   "test_cython_optimize_abi_stabilityr$   A   s    @AH

!
!"I
JC3FF&nn.MMD86,)9; \\)MMD8 $+. /%|.0 / 6"Ec&k] S!!'*	
 r   )__doc__ctypesr   importlib.resourcesjsonr   scipyshow_configCYTHON_BLAS_ILP64	pythonapiPyCapsule_GetNamer	   c_char_prestype	py_objectargtypesr   	resourcesfilesjoinpath	_sig_fileas_file_floads	read_textr   r$    r   r   <module>r;      s   "       
7#$89&ABUV  $$66 "OO  $../   %%&<=FF 	   +r

2<<>*I ,
	 ,+s   5!C""
C0