Ë
    nûàg   ã                   ó8  — d 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
mZ ddlZddlmZ dd	lmZmZ ej$                  j&                  Z ed
d«      \  Z	 defdefdefdefdefdefdefdefdefdefdefgZdddœZddiddidœZdddœZej4                  d d!fZd"Zej:                  d#„ «       Z ej:                  d$¬%«      d&„ «       Zej$                  jA                  d'e«      ej$                  jB                  d(„ «       «       Z"d)„ Z#d*„ Z$d+„ Z%d,„ Z&d-„ Z'y).a™  Integration tests for setuptools that focus on building packages via pip.

The idea behind these tests is not to exhaustively check all the possible
combinations of packages, operating systems, supporting libraries, etc, but
rather check a limited number of popular packages and how they interact with
the exposed public API. This way if any change in API is introduced, we hope to
identify backward compatibility problems before publishing a release.

The number of tested packages is purposefully kept small, to minimise duration
and the associated maintenance cost (changes in the way these packages define
their build process may require changes in the tests).
é    N)ÚEnum)Úglob)Úmd5)Úurlopen)ÚRequirementé   )ÚArchiveÚrunÚvÚLATESTÚpipÚpytestÚmypyÚbotocoreÚ
kiwisolverÚbrotliÚpyyamlúcharset-normalizerÚprotobufÚrequestsÚcelery)z
Cython<3.0)zmypy>=1.4.1)r   r   ÚPYYAML_FORCE_CYTHONÚ1ÚCHARSET_NORMALIZER_USE_MYPYCÚyamlzgoogle.protobuf)r   r   ú-mÚ
virtualenv)z--ignore-installedz--no-build-isolationc                 óØ   — t        g t        ¢t        | dz  «      ‘«       d„ | j                  d«      D «       }t	        j
                  dt        j                  j                  |«      ¬«      S )Nz.venvc              3   óF   K  — | ]  }t        |j                  «      –— Œ y ­w)N)ÚstrÚparent)Ú.0Úps     úq/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/setuptools/tests/integration/test_pip_install_sdist.pyú	<genexpr>zvenv_python.<locals>.<genexpr>f   s   è ø€ ÒM q”S˜Ÿ™—]ÑMùs   ‚!z.venv/*/python*Úpython)Úpath)	r
   Ú
VIRTUALENVr    r   ÚshutilÚwhichÚosÚpathsepÚjoin)Útmp_pathÚpossible_paths     r$   Úvenv_pythonr0   c   sQ   € äÐ.Œ*Ð.”c˜( WÑ,Ó-Ð.Ô/ÙM¨H¯M©MÐ:KÓ,LÔM€MÜ�<‰<˜¤r§z¡z§¡°}Ó'EÔFÐFó    T)Úautousec              #   óB  K  — t        j                  dt        | «      «      }t        j                  |d¬«       |j	                  dd«       d –— t        d«       t        d«       t        t
        | j                  d«      «       t        d	«       t        |d
ddg«       y ­w)NÚDOWNLOAD_PATHT)Úexist_okÚ	USE_MYPYCr   ú<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~zTemporary directory:Ú*zVirtual environment:r   r   Úfreeze)	r+   Úgetenvr    ÚmakedirsÚsetenvÚprintÚmapr   r
   )r.   r0   ÚmonkeypatchÚdownload_paths       r$   Ú_preparerA   j   s~   è ø€ ä—I‘I˜o¬s°8«}Ó=€MÜ‡K�K�¨Õ-ð ×Ñ�{ CÔ(ã	ô 
Ð
HÔIÜ	Ð
 Ô!ÜŒˆx�}‰}˜SÓ!Ô"Ü	Ð
 Ô!Üˆ�d˜E 8Ð,Õ-ùs   ‚BB)ÚpackageÚversionc                 ó�  — |ddf}t        | ||«      }t        | |«      }|r(t        d«       t        d|«       t        g |¢d‘|¢«       t        j                  | i «      }t        g |¢d‘d‘|‘«       t        g |¢d‘t        ¢|‘|«       t        j                  | | «      j                  dd«      }	d	|	› d
|	› d�}
t        |d|
g«       y )Nr   r   r7   zDependencies:Úinstallz--force-reinstallú-Ú_zimport z; print(getattr(z, '__version__', 0))z-c)	Úretrieve_sdistÚ
build_depsr=   r
   ÚEXTRA_ENV_VARSÚgetÚINSTALL_OPTIONSÚIMPORT_NAMEÚreplace)rB   rC   r.   r0   Úsetuptools_wheelÚvenv_pipÚsdistÚdepsÚenvÚpkgÚscripts              r$   Útest_install_sdistrV   }   sî   € ð ˜T 5Ð)€HÜ˜7 G¨XÓ6€EÜ�g˜uÓ%€DÙÜÐLÔMÜˆo˜tÔ$ÜÐ)ˆhÐ)˜	Ð) DÐ)Ô*ô ×
Ñ
˜W bÓ
)€CÜÐEˆ(ÐE�IÐEÐ2ÐEÐ4DÐEÔFÜÐ7ˆ(Ð7�IÐ7¤Ð7°Ð7¸Ô=ô �/‰/˜' 7Ó
+×
3Ñ
3°C¸Ó
=€CØ�s�eÐ+¨C¨5Ð0DÐE€FÜˆ�d˜FÐ#Õ$r1   c                 ó¤  — t        j                  dt        |«      «      }t        | |«      }t	        t         j
                  j                  || › d�«      «      D ]   }|d   |k7  sŒt        j                  |«       Œ" t         j
                  j                  ||d   «      }t         j
                  j                  |«      st        |d   ||d   «       |S )z5Either use cached sdist file or download it from PyPIr4   r8   ÚfilenameÚurlÚ
md5_digest)
r+   r:   r    Úretrieve_pypi_sdist_metadatar   r'   r-   ÚunlinkÚexistsÚdownload)rB   rC   r.   r@   ÚdistÚfileÚ	dist_files          r$   rH   rH   —   s­   € ô —I‘I˜o¬s°8«}Ó=€MÜ'¨°Ó9€Dô ”R—W‘W—\‘\ -°G°9¸A°Ó?Ó@ò ˆØ�
Ñ˜tÓ#Ü�I‰I�d�Oðô —‘—‘˜]¨D°Ñ,<Ó=€IÜ�7‰7�>‰>˜)Ô$Ü��e‘˜i¨¨lÑ);Ô<ØÐr1   c                 ó&  — |t         u r| n| › d|› �}t        d|› d�«      5 }t        j                  |«      }d d d «       d   d   rt	        d| › d|› d�«      ‚|d   d	   }|t         u r|d
   |   n|d   }t        d„ |«      \  }|S # 1 sw Y   ŒQxY w)Nú/zhttps://pypi.org/pypi/z/jsonÚinfoÚyankedzRelease for ú z was yankedrC   ÚreleasesÚurlsc                 ó   — | d   dk(  S )NÚpackagetyperQ   © )Úds    r$   ú<lambda>z.retrieve_pypi_sdist_metadata.<locals>.<lambda>¶   s   €   -Ñ 0°GÑ ;€ r1   )r   r   ÚjsonÚloadÚ
ValueErrorÚfilter)rB   rC   Úid_ÚfÚmetadataÚreleaserQ   s          r$   r[   r[   «   sº   € à¤Ñ&‰'¨w¨i°q¸¸	Ð,B€CÜ	Ð)¨#¨¨eÐ4Ó	5ð  ¸Ü—9‘9˜Q“<ˆ÷ ð �Ñ˜Ò!Ü˜<¨ y°°'°¸+ÐFÓGÐGà�vÑ˜yÑ)€GØ/6¼&Ñ/@ˆh�zÑ" 7Ò+ÀhÈvÑFV€GÜÑ;¸WÓE�H€UØ€L÷ ð  ús   ¡BÂBc                 óF  — t        | «      5 }|j                  «       }d d d «       t        «      j                  «       |k(  sJ ‚t	        |d«      5 }|j                  |«       d d d «       t        j                  j                  |«      sJ ‚y # 1 sw Y   ŒoxY w# 1 sw Y   Œ7xY w)NÚwb)	r   Úreadr   Ú	hexdigestÚopenÚwriter+   r'   r]   )rY   ÚdestrZ   rs   Údatas        r$   r^   r^   º   sŒ   € Ü	�‹ð ˜Ø�v‰v‹xˆ÷ô ˆt‹9×ÑÓ  JÒ.Ð.Ð.ä	ˆd�DÓ	ð ˜QØ	�‰�Œ÷ô �7‰7�>‰>˜$ÔÐÑ÷ð ú÷
ð ús   ŒBÁBÂBÂB c                 ó|  — ddl m} t        |«      }|j                  t	        |«      «      }|j                  di «      j                  dg «      }|t        j                  | g «      z  }|D �ci c]  }t        |«      j                  |“Œ }}|j                  «       D ��	cg c]  \  }}	|dk7  sŒ|	‘Œ c}	}S c c}w c c}	}w )z¡Find out what are the build dependencies for a package.

    "Manually" install them, since pip will not install build
    deps with `--no-build-isolation`.
    r   )Útomllibzbuild-systemÚrequiresÚ
setuptools)
Úsetuptools.compat.py310r   r	   ÚloadsÚ_read_pyprojectrK   ÚEXTRA_BUILD_DEPSr   ÚnameÚitems)
rB   Ú
sdist_filer   Úarchiverd   rR   rl   ÚrequirementsÚkr   s
             r$   rI   rI   Æ   s¨   € õ 0ä�jÓ!€GØ�=‰=œ¨Ó1Ó2€DØ�8‰8�N BÓ'×+Ñ+¨J¸Ó;€DØÔ× Ñ  ¨"Ó-Ñ-€Dà48Ö9¨q”K “N×'Ñ'¨Ñ*Ð9€LÐ9Ø&×,Ñ,Ó.×D‘$�!�Q°!°|Ó2CŠAÓDÐDùò :ùÛDs   Á+B3ÂB8Â+B8c                 ó2   ‡ — ˆ fd„‰ D «       }t        |d«      S )Nc              3   ó¢   •K  — | ]F  }t         j                  j                  ‰j                  |«      «      d k(  r‰j	                  |«      –— ŒH y­w)zpyproject.tomlN)r+   r'   ÚbasenameÚget_nameÚget_content)r"   Úmemberr‰   s     €r$   r%   z"_read_pyproject.<locals>.<genexpr>Ú   sG   øè ø€ ò àÜ�7‰7×Ñ˜G×,Ñ,¨VÓ4Ó5Ð9IÒIð 	×Ñ˜F×#ñùs   ƒAAÚ )Únext)r‰   Úcontentss   ` r$   r„   r„   Ù   s!   ø€ óàô€Hô
 �˜"ÓÐr1   )(Ú__doc__rn   r+   r)   ÚsysÚenumr   r   Úhashlibr   Úurllib.requestr   r   Úpackaging.requirementsr   Úhelpersr	   r
   ÚmarkÚintegrationÚ
pytestmarkr   ÚEXAMPLESr…   rJ   rM   Ú
executabler(   rL   Úfixturer0   rA   ÚparametrizeÚuses_networkrV   rH   r[   r^   rI   r„   rk   r1   r$   ú<module>r¤      s‹  ðñó Û 	Û Û 
Ý Ý Ý Ý "ã Ý .ç !à�[‰[×$Ñ$€
ñ ��hÓ�	€Ø #ð ˆF€OØˆvÐØˆVÐà�ÐØ�6ÐØˆvÐØˆvÐØ˜6Ð"Ø�ÐØ�ÐØˆvÐð€ð* Ø*ñÐ ð % cÐ*Ø9¸3Ð?ñ€ð Ø!ñ€ð �n‰n˜d LÐ1€
ð€ð ‡�ñGó ðGð €‡�˜Ôñ.ó ð.ð$ ‡�×ÑÐ/°Ó:Ø‡�×Ññ%ó ó ;ð%ò0ò(ò	 òEó&r1   