
    ?wgM              
         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mZ d dlmZ d dlmZ d dlZd dlZd dlmZ d dlZd dlmZmZ d dlmZ d d	lmZ d d
lm Z  h dZ!h dZ"ddhZ#dZ$e$ddide%jM                  e"e#z  d       ed      dd ed      ddid ed      ddd ed      ddddddddiid ed       ddd!d" ed#      d$d%d&Z'e
j                  d'k7  r ed(      d)d*d+e'd,<   d- Z(d. Z) ejT                  d/0      d1        Z+ejT                  d2        Z,d3 Z-d4 Z.d5Z/d6 Z0d7 Z1d8 Z2ejf                  ji                  d9d:d;d<e$jk                  d=d>      fg      d?        Z6d@ Z7dA Z8dB Z9dCZ:dDZ;ejf                  jy                  dE      dF        Z=dG Z>ejf                  ji                  dH e?ej                  j                                e?ej                        I      dJ        ZBdK ZCdL ZDdM ZEdN ZFdO ZGdP ZHdQ ZIdR ZJdS ZKejf                  ji                  dTdUdVg      ejf                  j                   ej                         dWk7  dXY      dZ               ZNd]d[ZOd\ ZPy)^    )annotationsN)suppress)cleandoc)ZipFile)tags)bdist_wheelget_abi_tag)Distribution)SetuptoolsDeprecationWarning)	run_setup>   dummy_dist-1.0.dist-info/WHEEL&dummy_dist-1.0.dist-info/top_level.txtdummy_dist-1.0.dist-info/RECORD!dummy_dist-1.0.dist-info/METADATA>
   
COPYING.md
NOTICE.rstAUTHORS.txtLICENCE.txtLICENSE.txtNOTICEAUTHORSCOPYINGLICENCELICENSEzLICENSE~zAUTHORS~zQfrom setuptools import setup

setup(
    name='dummy_dist',
    version='1.0',
)
	DUMMYFILE )setup.pylicensesu  
            from setuptools import setup

            setup(
                name="simple.dist",
                version="0.1",
                description="A testing distribution ☃",
                extras_require={"voting": ["beaglevote"]},
            )
            )r   
simpledistui  
            from setuptools import setup

            setup(
                name="complex-dist",
                version="0.1",
                description="Another testing distribution ☃",
                long_description="Another testing distribution ☃",
                author="Illustrious Author",
                author_email="illustrious@example.org",
                url="http://example.org/exemplary",
                packages=["complexdist"],
                setup_requires=["setuptools"],
                install_requires=["quux", "splort"],
                extras_require={"simple": ["simple.dist"]},
                entry_points={
                    "console_scripts": [
                        "complex-dist=complexdist:main",
                        "complex-dist2=complexdist:main",
                    ],
                },
            )
            __init__.pyzdef main(): return)r   complexdistz
            from setuptools import setup

            setup(
                name="headers.dist",
                version="0.1",
                description="A distribution with headers",
                headers=["header.h"],
            )
            )r   zheadersdist.pyzheader.hak  
            from setuptools import setup

            setup(
                name="testrepo",
                version="0.1",
                packages=["mypackage"],
                description="A test package with commas in file names",
                include_package_data=True,
                package_data={"mypackage.data": ["*"]},
            )
            )r    z	1,2,3.txt)r    data	mypackage)r   r#   ztestrepo-0.1.0u  
            from setuptools import setup

            setup(
                name="unicode.dist",
                version="0.1",
                description="A testing distribution ☃",
                packages=["unicodedist"],
                zip_safe=True,
            )
            )r       åäö_日本語.py)r   unicodedistu   
            [metadata]
            name = utf8-metadata-dist
            version = 42
            author_email = "John X. Ãørçeč" <john@utf8.org>, Γαμα קּ 東 <gama@utf8.org>
            long_description = file: README.rst
               UTF-8 描述 説明)	setup.cfgz
README.rst)
dummy-distzsimple-distzcomplex-distzheaders-distzcommasinfilenames-distzunicode-distzutf8-metadata-distwin32u  
            from setuptools import Extension, setup

            setup(
                name="extension.dist",
                version="0.1",
                description="A testing distribution ☃",
                ext_modules=[
                    Extension(
                        name="extension", sources=["extension.c"], py_limited_api=True
                    )
                ],
            )
            z![bdist_wheel]
py_limited_api=cp32z5#define Py_LIMITED_API 0x03020000
#include <Python.h>)r   r'   extension.czabi3extension-distc                    t         j                  j                  d      rt        dd      nt	        ddi      }|j                          t        |      }| j                         D ]  \  }}t        |||        |j                          |S )zHRun command in the same process so that it is easier to collect coverager   init)
stop_afterscript_namez%%build_meta%%)
ospathexistsr   r
   parse_config_filesr   itemssetattrfinalize_options)kwargsdist_objcmdattrvalues        X/var/www/horilla/myenv/lib/python3.12/site-packages/setuptools/tests/test_bdist_wheel.pybdist_wheel_cmdr<      s     77>>*% 	*0=*:;< 
 !
h
C||~ "eT5!"J    c                    | j                  |      }t        j                  j                  t        |   t        |             |S )N)prefix)mktempjaracor0   buildEXAMPLESstr)tmp_path_factorynamebasedirs      r;   	mkexamplerH      s6    %%d+G
KKhtnS\:Nr=   session)scopec                   | j                  d      }| j                  d      }t        D ]v  }t        | |      }||z  }t        j                  j                         j                  |      5  t        t        |      t        |            j                          d d d        x t        d |j                  d      D              S # 1 sw Y   xY w)NrB   dist	bdist_dirdist_dirc              3  2   K   | ]  }t        |        y wN)rD   ).0fnames     r;   	<genexpr>zwheel_paths.<locals>.<genexpr>   s     A#e*As   z*.whl)r@   rC   rH   rA   r0   DirectoryStackcontextr<   rD   runsortedglob)rE   
build_baserO   rF   example_dir	build_dirs         r;   wheel_pathsr]      s    !((1J&&v.H T 0$7%	[['')11+> 	Tc)ns8}MQQS	T 	TT A(--*@AAA	T 	Ts   *.CC	c                    t        | d      S )Nr(   )rH   )rE   s    r;   
dummy_distr_      s    %|44r=   c                    t        d | D              }t        |      j                         D ]  }d|j                  vrJ  y)z0Make sure entry point scripts are not generated.c              3  *   K   | ]  }d |v s|  yw)complex_distN rR   r0   s     r;   rT   z"test_no_scripts.<locals>.<genexpr>        G$0FG   	z.data/scripts/N)nextr   infolistfilename)r]   r0   entrys      r;   test_no_scriptsrk      s@    GGGD'') 6u~~5556r=   c                    t        d | D              }t        |      5 }|j                  d      }d d d        dj                         v sJ y # 1 sw Y   xY w)Nc              3  *   K   | ]  }d |v s|  yw)zunicode.distNrc   rd   s     r;   rT   z&test_unicode_record.<locals>.<genexpr>   re   rf   z!unicode.dist-0.1.dist-info/RECORDr$   )rg   r   readencode)r]   r0   zfrecords       r;   test_unicode_recordrr      sX    GGGD	 >"<=> !'')V333> >s   AAu   Metadata-Version: 2.1
Name: helloworld
Version: 42
Author-email: "John X. Ãørçeč" <john@utf8.org>, Γαμα קּ 東 <gama@utf8.org>


UTF-8 描述 説明
c                R   | j                  |       |dz  }|dz  }|j                          |dz  j                  t        d       |dz  j	                           G d dt
              } |       }|j                  ||       |d	z  j                  d      }d
|v sJ d|v sJ d|v sJ y )Nzdummy_dist.egg-infodummy_dist.dist-infozPKG-INFOutf-8encodingzdependency_links.txtc                  &    e Zd ZdZd Zed        Zy);test_preserve_unicode_metadata.<locals>.simpler_bdist_wheelz1Avoid messing with setuptools/distutils internalsc                     y rQ   rc   selfs    r;   __init__zDtest_preserve_unicode_metadata.<locals>.simpler_bdist_wheel.__init__  s    r=   c                    g S rQ   rc   r{   s    r;   license_pathszItest_preserve_unicode_metadata.<locals>.simpler_bdist_wheel.license_paths  s    Ir=   N)__name__
__module____qualname____doc__r}   propertyr   rc   r=   r;   simpler_bdist_wheelry     s    ?	 
	 
	r=   r   METADATAu"   Author-email: "John X. Ãørçeč"u   Γαμα קּ 東 r&   )chdirmkdir
write_textUTF8_PKG_INFOtouchr   egg2dist	read_text)monkeypatchtmp_pathegginfodistinfor   cmd_objmetadatas          r;   test_preserve_unicode_metadatar     s    h..G00HMMOz%%mg%F%%,,.k  "#GWh':%00'0BH/8;;;(*** H,,,r=   c                .   |j                  |        t        t        |            j                          t	        d      5 }t
        D ch c]  }d|z   	 }}t        |j                               t        |z  k(  sJ 	 d d d        y c c}w # 1 sw Y   y xY w)NrN   $dist/dummy_dist-1.0-py3-none-any.whldummy_dist-1.0.dist-info/)	r   r<   rD   rW   r   DEFAULT_LICENSE_FILESsetnamelistDEFAULT_FILES)r_   r   r   wfrS   license_filess         r;   test_licenses_defaultr   '  s    j!c(m,002	7	8 CB=R
49'%/
 
 2;;=!]]%BBBB	C C
C Cs    	B	B'BBBc                B   | j                  d      j                  dd       |j                  |        t        t	        |            j                          t        d      5 }dh}t        |j                               t        |z  k(  sJ 	 d d d        y # 1 sw Y   y xY w)Nr'   z*[metadata]
license_file=licenses/DUMMYFILEru   rv   r   r   z"dummy_dist-1.0.dist-info/DUMMYFILE
joinpathr   r   r<   rD   rW   r   r   r   r   )r_   r   r   r   r   s        r;   test_licenses_deprecatedr   1  s    $//5 0  j!c(m,002	7	8 CB=>2;;=!]]%BBBBC C Cs   ")BB)config_fileconfig)r'   z-[metadata]
license_files=licenses/*
  LICENSE)r'   z,[metadata]
license_files=licenses/*, LICENSEr   )z2  license_files=['licenses/DUMMYFILE', 'LICENSE'])c                j   | j                  |      j                  |d       |j                  |        t        t	        |            j                          t        d      5 }dD ch c]  }d|z   	 }}t        |j                               t        |z  k(  sJ 	 d d d        y c c}w # 1 sw Y   y xY w)Nru   rv   r   r   >   r   r   r   r   )r_   r   r   r   r   r   rS   r   s           r;   test_licenses_overrider   >  s     $///Ij!c(m,002	7	8 CB=U
49'%/
 
 2;;=!]]%BBBB	C C
C Cs   "B)'B$3'B)$B))B2c                6   | j                  d      j                  dd       |j                  |        t        t	        |            j                          t        d      5 }t        |j                               t        k(  sJ 	 d d d        y # 1 sw Y   y xY w)Nr'   z[metadata]
license_files=
ru   rv   r   r   r   )r_   r   r   r   s       r;   test_licenses_disabledr   V  s    $//& 0  j!c(m,002	7	8 3B2;;=!]2223 3 3s   "#BBc                    |j                  |        t        t        |      d      j                          t	        d      5 }t        |j                               }d|v sJ d|v sJ 	 d d d        y # 1 sw Y   y xY w)N2rN   build_numberz&dist/dummy_dist-1.0-2-py3-none-any.whlr   r   )r   r<   rD   rW   r   r   r   )r_   r   r   r   	filenamess        r;   test_build_numberr   `  sw    j!c(m#>BBD	9	: @b&	0I===2i???@ @ @s   &A11A:c                   |j                  |        t        j                  t        d      5  t	        t        |      d      j                          d d d        t        j                  j                  d      sJ y # 1 sw Y   +xY w)Nz.*universal is deprecatedmatchT)rN   	universalz(dist/dummy_dist-1.0-py2.py3-none-any.whl)
r   pytestwarnsr   r<   rD   rW   r/   r0   r1   )r_   r   r   s      r;   test_universal_deprecatedr   i  si    j!	2:U	V G#h-4@DDFG 77>>DEEE	G Gs   %A<<Ba&  #include <Python.h>

static PyMethodDef methods[] = {
  { NULL, NULL, 0, NULL }
};

static struct PyModuleDef module_def = {
  PyModuleDef_HEAD_INIT,
  "extension",
  "Dummy extension module",
  -1,
  methods
};

PyMODINIT_FUNC PyInit_extension(void) {
  return PyModule_Create(&module_def);
}
u   from __future__ import annotations

from setuptools import Extension, setup

setup(
    name="extension.dist",
    version="0.1",
    description="A testing distribution ☃",
    ext_modules=[Extension(name="extension", sources=["extension.c"])],
)
zEonce:Config variable '.*' is unset.*, Python ABI tag may be incorrectc                N   |j                  d      }|dz  j                  t        d       |dz  j                  t        d       |j	                  d      }|j	                  d      }| j                  |       t        t        |      t        |            j                          y	)
z=Test that building a binary wheel with the limited ABI works.extension_distr   ru   rv   r*   rB   rL   rM   N)	r@   r   EXTENSION_SETUPPYEXTENSION_EXAMPLEr   r   r<   rD   rW   )r   r   rE   
source_dirr\   rO   s         r;   test_limited_abir     s    
 "(()9:J*(():W(M-++,=+P!!'*I  (Hj!c)ns8}EIIKr=   c                   t        |j                  d            }t        j                  t        |       |       |j	                  |       t        j                  |      D ]O  \  }}}|D ]D  }t        j                  t
        j                  j                  ||      t        j                         F Q t               j                          y )Ndummy)rD   r   shutilcopytreer   r/   walkchmodr0   joinstatS_IREADr<   rW   )r_   r   r   rG   root_dirsfilesrS   s           r;   test_build_from_readonly_treer     s    (##G,-G
OOC
OW-g !ggg. >eU 	>EHHRWW\\$.=	>> r=   )optioncompress_type)idsc                >   |j                  |        t        t        |      |      j                          t	        d      5 }t        |j                               }d|v sJ d|v sJ |j                  D ]  }|j                  |k(  rJ  	 d d d        y # 1 sw Y   y xY w)N)rN   compressionr   r   r   )	r   r<   rD   rW   r   r   r   filelistr   )r_   r   r   r   r   r   r   zinfos           r;   test_compressionr     s     j!c(m@DDF	7	8 8B&	0I===2i???[[ 	8E&&-777	8	8 8 8s   ABBBc                    | D ]J  }t        |      5 }t        d |j                  D              }|j                  |      }d|vsJ 	 d d d        L y # 1 sw Y   WxY w)Nc              3  X   K   | ]"  }|j                   j                  d       s| $ yw)WHEELN)ri   endswith)rR   fns     r;   rT   z.test_wheelfile_line_endings.<locals>.<genexpr>  s!     WB9M9Mg9VRWs    **   )r   rg   r   rn   )r]   r0   r   	wheelfilewheelfile_contentss        r;   test_wheelfile_line_endingsr     sf     3T] 	3bW"++WWI!#!3 2222	3 	33	3 	3s   4AA	c                   |j                  dd       |j                  |        t        t        |      d      j	                          t        d      5 }|j                  D ]  }|j                  dk\  rJ  	 d d d        y # 1 sw Y   y xY w)NSOURCE_DATE_EPOCH02ar   z'dist/dummy_dist-1.0-2a-py3-none-any.whl)i     r   r   r   r   )setenvr   r<   rD   rW   r   r   	date_time)r_   r   r   r   r   s        r;   test_unix_epoch_timestampsr     s~    *C0j!c(m$?CCE	:	; <r[[ 	<E??&;;;;	<< < <s   B 3B  B	c                j   | j                  t        dd        | j                  t        dd        t               dk(  sJ | j                  t        dd d       t               d	k(  sJ | j                  t        dd
        t               dk(  sJ | j                  t        d       t               dk(  sJ y )Ninterpreter_namec                      y)Ncprc   rc   r=   r;   <lambda>z*test_get_abi_tag_windows.<locals>.<lambda>      r=   get_config_varc                     y)Nzcp313-win_amd64rc   xs    r;   r   z*test_get_abi_tag_windows.<locals>.<lambda>  r   r=   cp313gettotalrefcountc                      y)Nr   rc   rc   r=   r;   r   z*test_get_abi_tag_windows.<locals>.<lambda>  r   r=   Fcp313dc                     y)Nzcp313t-win_amd64rc   r   s    r;   r   z*test_get_abi_tag_windows.<locals>.<lambda>  r   r=   cp313tdcp313t)r4   r   	sysconfigr	   sysdelattrr   s    r;   test_get_abi_tag_windowsr     s    0,?	#35PQ=G###/EB=H$$$	#35QR=I%%%/0=H$$$r=   c                    | j                  t        dd        | j                  t        dd        t               dk(  sJ y )Nr   c                      yNpprc   rc   r=   r;   r   z+test_get_abi_tag_pypy_old.<locals>.<lambda>  r   r=   r   c                     y)Nzpypy36-pp73rc   r   s    r;   r   z+test_get_abi_tag_pypy_old.<locals>.<lambda>  r   r=   pypy36_pp73)r4   r   r   r	   r   s    r;   test_get_abi_tag_pypy_oldr     s9    0,?	#35LM=M)))r=   c                    | j                  t        dd        | j                  t        dd        t               dk(  sJ y )Nr   c                     y)Nzpypy37-pp73-darwinrc   r   s    r;   r   z+test_get_abi_tag_pypy_new.<locals>.<lambda>  r   r=   r   c                      yr   rc   rc   r=   r;   r   z+test_get_abi_tag_pypy_new.<locals>.<lambda>  r   r=   pypy37_pp73r4   r   r   r	   r   s    r;   test_get_abi_tag_pypy_newr    s9    	#35ST0,?=M)))r=   c                    | j                  t        dd        | j                  t        dd        t               dk(  sJ y )Nr   c                     y)Nz"graalpy231-310-native-x86_64-linuxrc   r   s    r;   r   z*test_get_abi_tag_graalpy.<locals>.<lambda>  r   r=   r   c                      y)Ngraalpyrc   rc   r=   r;   r   z*test_get_abi_tag_graalpy.<locals>.<lambda>  r   r=   graalpy231_310_nativer  r   s    r;   test_get_abi_tag_graalpyr    s@    #%S 02CD=3333r=   c                    | j                  t        dd        | j                  t        dd        t               dk(  sJ y )Nr   c                     y)Nzunknown-python-310rc   r   s    r;   r   z+test_get_abi_tag_fallback.<locals>.<lambda>  r   r=   r   c                      y)Nzunknown-pythonrc   rc   r=   r;   r   z+test_get_abi_tag_fallback.<locals>.<lambda>  r   r=   unknown_python_310r  r   s    r;   test_get_abi_tag_fallbackr    s;    	#35ST02JK=0000r=   c                Z    |j                  |        t        d      j                          y)z>Ensure building on platforms with a space in the name succeed.zisilon onefs)	plat_nameN)r   r<   rW   )r_   r   s     r;   test_platform_with_spacer    s!    j!n-113r=   c                   | j                  |       ddddd}|j                         D ]6  \  }}t        |dd      5 }|j                  t	        |             ddd       8 t               j                          d	}t        j                  j                  |      sJ t        t        |      j                               }d
D ]  }||v rJ  dD ]  }	|	|vrJ  y# 1 sw Y   xY w)z
    Setuptools allow authors to set PEP 440's local version segments
    using ``egg_info.tag_build``. This should be reflected not only in the
    ``.whl`` file name, but also in the ``.dist-info`` and ``.data`` dirs.
    See pypa/setuptools#3997.
    z]
            from setuptools import setup
            setup(headers=["hello.h"])
            z
            [metadata]
            name = test
            version = 1.0

            [options.data_files]
            hello/world = file.txt

            [egg_info]
            tag_build = +what
            tag_date = 0
            r   )r   r'   zfile.txtzhello.hwru   rv   Nz#dist/test-1.0+what-py3-none-any.whl)z"test-1.0+what.data/headers/hello.hz,test-1.0+what.data/data/hello/world/file.txtz test-1.0+what.dist-info/METADATAztest-1.0+what.dist-info/WHEEL)ztest.data/headers/hello.hz'test-1.0.data/data/hello/world/file.txtztest.dist-info/METADATAztest-1.0.dist-info/WHEEL)r   r3   openwriter   r<   rW   r/   r0   r1   r   r   r   )
r   r   r   filecontentfh
wheel_pathentriesexpectednot_expecteds
             r;   test_data_dir_with_tag_buildr     s    h %E(  (g$g. 	("HHXg&'	( 	((  7J77>>*%%%'*%..01G # 7"""# + 7***+#	( 	(s   CC#	)reportedr  )zlinux-x86_64
linux_i686)zlinux-aarch64linux_armv7lLinuxz!Only makes sense to test on Linux)reasonc                    |j                  t        dd        t        j                         }t	        |      }| |_        d|_        |j                         \  }}}||k(  sJ y )Ncalcsizec                     y)N   rc   r   s    r;   r   z'test_platform_linux32.<locals>.<lambda>:  r   r=   F)r4   struct
setuptoolsr
   r   r  root_is_pureget_tag)r!  r  r   rL   r8   _actuals          r;   test_platform_linux32r0  2  s\     
K8""$D
d
CCMC;;=LAq&Xr=   c                r   dd}t        t              5  | j                  t        j                  d       d d d        | j                  t        d|       t        j                  t        d      5  dd l
}d d d        | j                  t        j                  d       dd l}y # 1 sw Y   mxY w# 1 sw Y   :xY w)	Nc                Z    | dk(  rt        d|        t        j                  | g|i |S )NctypeszNo module named )ModuleNotFoundError	importlib
__import__)rF   argsr6   s      r;   _fake_importz$test_no_ctypes.<locals>._fake_importD  s8    8%(8&?@@##D:4:6::r=   zwheel.macosx_libfiler6  zNo module named ctypesr   r   zsetuptools.command.bdist_wheel)rF   rD   )r   KeyErrordelitemr   modulesr4   builtinsr   raisesr4  wheel.macosx_libfilesetuptools.command.bdist_wheel)r   r8  wheelr+  s       r;   test_no_ctypesrA  C  s    ; 
(	 ACKK)?@A ,=	*2J	K $#$
 %EF)A A
$ $s   !B!/B-!B*-B6c                   |j                  |        |dz  }|j                          |dz  j                  dd       |dz  j                  dd       t        t	        |      t	        |            j                          d	d
h}t        d      5 }t        |j                               }d d d        |z
  t               k(  sJ |D cg c]  }dt	        |      v s| c}rJ y # 1 sw Y   <xY wc c}w )Nrt   r   zname: helloworldru   rv   FOObar)rN   dist_info_dirzdummy_dist-1.0.dist-info/FOOr   r   zegg-info)	r   r   r   r<   rD   rW   r   r   r   )r_   r   r   r   r  r   files_foundr0   s           r;   test_dist_info_providedrG  Y  s    j!00HNN
&&'9G&L
 !!%'!:c(m3x=IMMO&)H 
7	8 )B"++-() k!SU***!,H
c$i0GHHHH) )
 Is   C$C0C0$C-)returnNone)Q
__future__r   r<  r5  os.pathr/   platformr   r   r*  r   r   
contextlibr   inspectr   zipfiler   jaraco.pathrA   r   	packagingr   r+  r?  r   r	   setuptools.distr
   setuptools.warningsr   distutils.corer   r   r   OTHER_IGNORED_FILESSETUPPY_EXAMPLEdictfromkeysrC   r<   rH   fixturer]   r_   rk   rr   r   r   r   r   markparametrizereplacer   r   r   r   r   r   filterwarningsr   r   listsupported_compressionsr3   r   r   r   r   r   r  r  r  r  r   skipifsystemr0  rA  rG  rc   r=   r;   <module>rb     s   "        
         C ( < $    $ "% ---0CCR
H 	
   
2 &';<5: 	
 " 
 $&R8

 -,
'0 

 (*"E" 
 ,Qtn <<7 
  :O%&H!", i 	B !	B 5 564-8C
C HF##I	
	CC3@F &  KLL
 	+	+	1	1	34[//0  
8
83<	%**4144+n #%FG HOO )L  	*,Ir=   