
    ϶vgK                       U d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZmZmZ dd	lmZ d
dlmZ d
dlmZ ddl m!Z! ddl"m#Z# de$fddddddddfddddddddfddddddddfddd d!d"d#d$dffZ%ej&        '                    d%e%d& e%D             '          d(             Z(ej)        dd)            Z*d* Z+d+ Z,d, Z-d- Z. G d. d/          Z/ e0d0d1d2d3ii e0d1g4           e,d5g d6d2gd7i          8           e0d9 e0d:;          <           e0d=d> ed?          i e0d@d>gfgA           e,d5g d6d>gdBi          8           e0dCdD edE          i e0 e/dFdCdDgG          gH           e,dIdJdKg d6igi          8           e0dLdM edN          i e0dMgO           e,d5dMdKg d6igi          8           e0dP edQ           edR          dS e0dTdUgV           e,d5dKdWdXdYdZd[dTdUgigii          8           e0d\d] e,d5dKg d^ii           ed_          `           e0dadbej1        z   edc          d           e0dedfej1        z  g           e0dhdidjdki edl          m           e0dndjdoej1        z  i edp          q           e0drdsdjdti edu          m           e0dvd1dwd2d3iii e0d1gdxgy           e,d5dzdKg d{id1d2dwd2gigigi          8           e0d|d}d2d~ii e0d}gd}gy           e,d5dzdKg d{id}d2gigi          8           e0dd1d3d> ed          idi e0d1gddgfg           e,d5g d6d2d@d>gigd7i          8          fZ2de3d<   ej&        '                    de2d e2D             '          d             Z4d Z5d Z6d Z7d Z8dS )zwheel tests    )annotationsN)Any)path	parse_tag)canonicalize_name)PY_MAJORDistributionPathMetadata)Wheel   )tempdir)DALS)get_config_var)get_platformzinvalid.whlz&simplewheel-2.0-1-py2.py3-none-any.whlsimplewheelz2.01zpy2.py3noneany)project_nameversionbuild
py_versionabiplatformz$simple.dist-0.1-py2.py3-none-any.whlzsimple.distz0.1z example_pkg_a-1-py3-none-any.whlexample_pkg_apy3z9PyQt5-5.9-5.9.1-cp35.cp36.cp37-abi3-manylinux1_x86_64.whlPyQt5z5.9z5.9.1zcp35.cp36.cp37abi3manylinux1_x86_64)filenameinfoc                    g | ]
}|d          S )r    .0ts     X/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/setuptools/tests/test_wheel.py
<listcomp>r)   Q   s    0P0P0P!10P0P0P    )idsc                   t          j        |          r=t          j        |          5  t	          |            d d d            n# 1 swxY w Y   d S t	          |           fd|                                D             |k    sJ d S )Nc                2    i | ]}|t          |          S r$   )getattr)r&   kws     r(   
<dictcomp>z#test_wheel_info.<locals>.<dictcomp>Y   s#    222Awq!}}222r*   )inspectisclasspytestraisesr   keys)r!   r"   r0   s     @r(   test_wheel_infor7   P   s     t ]4   	 	(OOO	 	 	 	 	 	 	 	 	 	 	 	 	 	 	hA2222diikk222d::::::s   AA
A
c              +    K   dt          d          |z                      d          i}| r|                    |            t                      5 }t	          j        ||           t          j        t          j	        dddf|           t          j
        t          j                            |dd                    d	         V  d d d            d S # 1 swxY w Y   d S )
Nsetup.pyz
            # -*- coding: utf-8 -*-
            from setuptools import setup
            import setuptools
            setup(**%r)
            utf-8-qbdist_wheelcwddist*.whlr   )r   encodeupdater   r   r   
subprocess
check_callsys
executableglobosjoin)extra_file_defskwargs	file_defs
source_dirs       r(   build_wheelrN   \   sB      	   &//I  *)))	 Fj
9j)))^Z}=:	
 	
 	
 	
 iZAABB1EEEEF F F F F F F F F F F F F F F F F Fs   A5CCCc           
        t                      }t          j        |           D ]\\  }}}|D ]S}|                    t          j                            t          j                            ||           |                     T]|S N)setrH   walkaddr   rI   relpath)rootcontentsdirpathdirnames	filenamesr!   s         r(   tree_setrZ   u   s|    uuH(* Q Q$9! 	Q 	QHLLbgoogt&D&DhOOPPPP	QOr*   c                x   t                      }|                                 D ]\  }t          |t                    rt	          |          }|D ]i}t          |t                    r|fdt	          |          D             z  }6|                    t          j                            |                     j|S )z8Flatten nested dicts and lists into a full list of pathsc                P    h | ]"}t           j                            |          #S r$   )rH   r   rI   )r&   valnodes     r(   	<setcomp>zflatten_tree.<locals>.<setcomp>   s)    QQQs27<<c22QQQr*   )	rQ   items
isinstancedictflatten_treerS   rH   r   rI   )treeoutputrV   elemr^   s       @r(   rc   rc   }   s    UUF**,, 5 5hh%% 	.#H--H 	5 	5D$%% 5QQQQl4>P>PQQQQ

27<<d334444		5
 Mr*   c                    d | D             S )Nc           	         h | ]G}|                     t          t                      t          d           pt          d                    HS )
EXT_SUFFIXSO)r   r   	shlib_ext)formatr	   r   r   )r&   xs     r(   r_   z&format_install_tree.<locals>.<setcomp>   s_         	
!^^$\22JnT6J6J 	 	
 	
  r*   r$   )rd   s    r(   format_install_treern      s%         r*   c                   t          |           }t          j                            ||                                          }|                    |           |@t          |          }t          |          }	|                    |	          sJ ||	z
              t          |t          j                            |d                    }
t          j        ||
          }|j        |k    sJ |j        |k    sJ ||                    d          rJ d S ||                    d                                          k    sJ d S )NEGG-INFO)metadatarequires.txt)r   rH   r   rI   egg_nameinstall_as_eggrn   rZ   issubsetr   r
   from_filenamer   r   has_metadataget_metadatalstrip)r!   install_dirinstall_tree_includesr   r   requires_txtr0   egg_pathinstall_treeexprq   r?   s               r(   _check_wheel_installr      s<    	hAw||K66HX(*+@AA{##$$S))==<#+====Hbgll8Z&H&HIIH%hBBBD,,,,<7""""$$^4444444 t00@@GGIIIIIIIIr*   c                      e Zd Zd ZddZdS )Recordc                "    || _         || _        d S rP   _id_fields)selfidrK   s      r(   __init__zRecord.__init__   s    r*   returnstrc                &    | j         d| j        dS )Nz(**)r   )r   s    r(   __repr__zRecord.__repr__   s    !XXXt|||44r*   N)r   r   )__name__
__module____qualname__r   r   r$   r*   r(   r   r      s7          5 5 5 5 5 5r*   r   basicfoo__init__.py )packagesfoo-1.0-py{py_version}.egg)PKG-INFORECORDWHEELtop_level.txt)rp   r   r   rL   setup_kwargsr~   r:   u   Description accentuée)description)r   r   datazdata.txtz.
                Some data...
                data_dir)
data_files)rp   r   	extensionzextension.can  
                #include "Python.h"

                #if PY_MAJOR_VERSION >= 3

                static struct PyModuleDef moduledef = {
                        PyModuleDef_HEAD_INIT,
                        "extension",
                        NULL,
                        0,
                        NULL,
                        NULL,
                        NULL,
                        NULL,
                        NULL
                };

                #define INITERROR return NULL

                PyMODINIT_FUNC PyInit_extension(void)

                #else

                #define INITERROR return

                void initextension(void)

                #endif
                {
                #if PY_MAJOR_VERSION >= 3
                    PyObject *module = PyModule_Create(&moduledef);
                #else
                    PyObject *module = Py_InitModule("extension", NULL);
                #endif
                    if (module == NULL)
                        INITERROR;
                #if PY_MAJOR_VERSION >= 3
                    return module;
                #endif
                }
                zsetuptools.Extension)namesources)ext_modulesz%foo-1.0-py{py_version}-{platform}.eggzextension{shlib_ext}rp   headerzheader.hz
                )headersscriptX
                #/usr/bin/python
                print('hello world!')
                N
                #/bin/sh
                echo 'hello world!'
                	script.py	script.shr   r   scriptsr   r   r   r   r   	requires1zfoobar==2.0)r   r   r   rr   r   z%
            foobar==2.0
            )r   install_requiresr~   r|   	requires2z:
        bar
        foo<=2.0; %r in sys_platform
        z2
            bar
            foo<=2.0
            )r   r   r|   	requires3z)
        bar; %r != sys_platform
        )r   r   	requires4z
        foo
        extrazfoobar>3zG
            foo

            [extra]
            foobar>3
            )r   r   extras_requirer|   	requires5zfoobar; %r != sys_platformz!
            [extra]
            )r   r   r|   requires_ensure_orderz9
        foo
        bar
        baz
        qux
        za
            foobar>3
            barbaz>4
            bazqux>5
            quxzap>6
            z
            foo
            bar
            baz
            qux

            [extra]
            foobar>3
            barbaz>4
            bazqux>5
            quxzap>6
            namespace_packagebarzfoo.bar)namespace_packagesr   z foo-1.0-py{py_version}-nspkg.pth)r   r   r   znamespace_packages.txtr   empty_namespace_packagefoobarz7__import__('pkg_resources').declare_namespace(__name__)data_in_packagez>
                        Some data...
                        )r   r   zfoo/data_dirzfoo/data_dir/data.txt)r   r   ztuple[dict[str, Any], ...]WHEEL_INSTALL_TESTSparamsc                    g | ]
}|d          S )r   r$   )r&   r   s     r(   r)   r)   ,  s    888&888r*   c           
     .   |                      dd          }|                      dd          }|                      dg           }|                      di           }|                      dd           }|                      d          }|                      d	i           }|                      d
i           }t          d|||||d|5 }	t                      5 }
t          |	|
||||           d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nr   r   r   1.0r   r   r|   r~   rL   r   r   r   r   r   rJ   r$   )getrN   r   r   )r   r   r   r   r   r|   r~   rL   r   r!   rz   s              r(   test_wheel_installr   )  s    ::fe,,LjjE**Gzz"4b99ZZ 0"55N::nd33L::n--L

;++I::nb11L 	
-)%	
 	
 	
 	

 		
 !k<w	
 	
 	

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
s6   D
C2&D
2C6	6D
9C6	:D

DDc            
     `   d} d}t          | |          5 }t                      5 }|                    | t          |                     }t	          j        ||           t          ||d t          |           |d            d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )NFoo_Barr   )r   r   )rN   r   replacer   shutilmover   )r   r   r!   rz   new_filenames        r(   test_wheel_install_pep_503r   G  sF   LG	
 	
 	

 		

 !''6G6U6UVVHl+++l++	
 	
 	

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
s5   B#AB?B#B	B#B	B##B'*B'c                    d} d}d                     | |          }t                      5 }t          j                            ||          }t          j        |d                                           t                      5 }t          j	        t                    5  t          ||d | |d            d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )N
nodistinfor   z{0}-{1}-py2.py3-none-any.whlr0   )rl   r   rH   r   rI   zipfileZipFilecloser4   r5   
ValueErrorr   )r   r   
wheel_namerM   
wheel_pathrz   s         r(   test_wheel_no_dist_dirr   ]  s   LG/66|WMMJ	 jW\\*j99

C((..000YY 	+z**  $T<$                	 	 	 	 	 	 	 	 	 	 	 	 	 	 		                 sZ   AC)?CB:.C:B>>CB>CC)C	C)C	C))C-0C-c                ~    d }|                      d|           t          d                                          sJ d S )Nc                 4    d t          d          D             S )Nc                6    h | ]}|j         |j        |j        fS r$   )interpreterr   r   r%   s     r(   r_   z=test_wheel_is_compatible.<locals>.sys_tags.<locals>.<setcomp>n  s5     
 
 
 ]AE1:.
 
 
r*   zcp36-cp36m-manylinux1_x86_64r   r$   r*   r(   sys_tagsz*test_wheel_is_compatible.<locals>.sys_tagsm  s,    
 
=>>
 
 
 	
r*   z$setuptools.wheel._get_supported_tagsz2onnxruntime-0.1.2-cp36-cp36m-manylinux1_x86_64.whl)setattrr   is_compatible)monkeypatchr   s     r(   test_wheel_is_compatibler   l  sQ    
 
 
 >IIIEFFTTVVVVVVVr*   c                    t           j        dd            } t          dt          d          t          d          dt          ddg          t	          d	d
dddddddgigii                    }|                    dd          }|                    dd          }|                    d          }|                    di           }|                    di           } | d||g i |d|5 }t                      5 }t          |||||d            t          |          }	t          j
        |          |	                                z  }
|
d
z  dz  dz  }|                                sJ t          j        dk    r>t          t!          j        |                                j                            dk    sJ d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nc              ;    K   dt          d          |z                      d          i}| r|                    |            t                      5 }t	          j        ||           t          j        |          dz  }t          j	        |d           t          j        t          j        dddf|           t          j        t          j                            |d	d
                    d         V  d d d            d S # 1 swxY w Y   d S )Nr9   z
                # -*- coding: utf-8 -*-
                from setuptools import setup
                import setuptools
                setup(**%r)
                r:   r   i  r;   r<   r=   r?   r@   r   )r   rA   rB   r   r   r   pathlibPathrH   chmodrC   rD   rE   rF   rG   rI   )rJ   rK   rL   rM   runshs        r(   rN   z$test_wheel_mode.<locals>.build_wheelx  sh         fWoo
	  	._---YY 	J*Jy*---L,,{:EHUE"""!T=Az    )BGLLVWEEFFqIIII	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	Js   B!C==DDr   r   r   r   r   r   r   r   rp   r   r   r   r   r   r   r   r   r   r   r~   rL   r   r   win320o777rP   r$   )
contextlibcontextmanagerrb   r   rc   r   r   r   r   r   r   rs   existsrE   r   octstatS_IMODEst_mode)rN   r   r   r   r~   rL   r   r!   rz   r0   base	script_shs               r(   test_wheel_moder   w  s   J J J J2    
 
  +.
 
 
 "(#k :;+
#
 
 
'  F@ ::fe,,LjjE**G::n--L

;++I::nb11L 	 	
%	
 	
 	
 	
J 		J !k<w	
 	
 	
 (OO|K((1::<<7:%	1K?	!!!!!<7""t|INN$4$4$<==>>'IIII)J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J J Js7   ,G;B<G7GG	G
G	GG"GrP   )9__doc__
__future__r   r   rG   r2   rH   r   r   r   rC   rE   r   typingr   r4   jaracor   packaging.tagsr   packaging.utilsr   pkg_resourcesr	   r
   r   setuptools.wheelr   contextsr   textwrapr   distutils.sysconfigr   distutils.utilr   r   WHEEL_INFO_TESTSmarkparametrizer7   r   rN   rZ   rc   rn   r   r   rb   r   r   __annotations__r   r   r   r   r   r$   r*   r(   <module>r     s
      " " " " " "       				        



               $ $ $ $ $ $ - - - - - - > > > > > > > > > > " " " " " "             . . . . . . ' ' ' ' ' ' J0)#	
 	

 	/)#	
 	

 	++	
 	

 	D#*+	
 	

G. b *0P0P?O0P0P0P   ; ; ; F F F F0      J J J,5 5 5 5 5 5 5 5 	D="-.TW
 
 
 "\(LLL%+ +#
     	DT0
 
 
   	D 
 T#j\23
 
 
 "\(LLL'L+ +#
    & 	D44(* *,
Z T*}o  
 
 
 "\3& ! ! !
6#
  mC C CH 	D 
 TL
 
 
 "\( ! ! !
+#
    2 	D   
 
 T +.
 
 
 "\(#k :;+
#
 
 
'  > 	D&!\(   +
#
 
 
 T
 
  ( 	D ,	
 T
 
   	D ,   	D Z
 T
 
  " 	D1CL@
 T
 

 
 
 	D"  
 T
 
!  > 	Dr*

 T %w[
 
 
 "\(2 ! ! ! %0+#
    @ 	D$M
 T (zZ
 
 
 "\(2 ! ! ! %+#
       B 	D!! !	 	
 TW'*A)BCD
 
 
 "\(   ""&%+ +#
  %$ $ $Q
m3  m m m m` 88$7888   

 
 

2
 
 
,  W W WUJ UJ UJ UJ UJr*   