
    -i                        S r SSKrSSKrSSKJr  SSKJr  SSKrSSKrSSK	J
r
  SSKJr  \" \5      r\
R                  " 5        H5  u  ru  rr\R'                  S5       H  r\\   R+                  \5        M     M7     SS	S
.r\ H  rS\ 3\\'   M     S r SS jr\R4                  R7                  S\R                  5       5      S 5       rg)zCTests for the minimum dependencies in README.rst and pyproject.toml    N)defaultdict)Path)dependent_packages)parse_versionz, zbuild-system.requireszproject.dependencies)buildinstallzproject.optional-dependencies.c                  |   [         R                  " S5      n [        [        R                  5      R
                  R
                  nUS-  n[        R                  R                  U5      (       d  [        R                  " S5        UR                  S5       nU H  nU R                  U5      nU(       d  M  UR                  S5      UR                  S5      pvUR                  5       nU[        ;   d  MZ  [!        U5      n[!        [        U   S   5      nXx:X  a  M   U S35       e   S S S 5        g ! , (       d  f       g = f)NzE\.\. \|([A-Za-z-]+)MinVersion\| replace::( [0-9]+\.[0-9]+(\.[0-9]+)?)z
README.rstz%The README.rst file is not available.rr       has a mismatched version)recompiler   sklearn__file__parentospathexistspytestskipopenmatchgrouplowerr   r   )	patternreadme_pathreadme_fileflinematchedpackageversionmin_versions	            ]/var/www/html/venv/lib/python3.13/site-packages/sklearn/tests/test_min_dependencies_readme.pytest_min_dependencies_readmer%      s    
 jj	(G w''(//66K,K77>>+&& 	;<			#	!DmmD)G&}}Q/q1AWmmoG,,'0+,>w,G,JK-T':S/TT-  
		s   AD-1#D-D--
D;c                 4   [         R                  " S5      nUc  / n[        U   n[        [        R
                  5      R                  R                  nUS-  nUR                  5       (       d  [         R                  " S5        UR                  S5       nUR                  U5      nS S S 5        U R                  S5      n	Wn
U	 H  nX   n
M	     0 nU
 HI  nSU;   a  UR                  S5      u  pO(SU;   a  UR                  S5      u  pO[        U S35      eXU'   MK     [        U5      [        U5      :X  d   eUR                  5        H<  u  p[        U5      n[        [         U   S	   5      nX;   a  M,  UU:X  a  M4   U S
35       e   g ! , (       d  f       N= f)Ntomllibzpyproject.tomlz pyproject.toml is not available.rb.z>=z==zV not supported yet in this test. Only >= and == are supported for version requirementsr   r   )r   importorskip-min_depencies_tag_to_packages_without_versionr   r   r   r   r   r   r   loadsplitNotImplementedErrorsorteditemsr   r   )pyproject_sectionmin_dependencies_tagskip_version_check_forr'   expected_packagesroot_directorypyproject_toml_pathr   pyproject_tomlpyproject_section_keysinfokeypyproject_build_min_versionsrequirementr!   r"   expected_min_versions                    r$   check_pyproject_sectionr>   B   s    !!),G%!#E '**+2299N(+;;%%'' 	67		!	!$	'1 a 
( /44S9D%y & $& ;*006GW[ *006GW%-  H H 
 18W-  ./6:K3LLLL8>>@(,-?-H-KL,..U7);T0UU. A1 
(	's   F		
Fz'min_dependencies_tag, pyproject_sectionc                 0    US:X  a  S/OSn[        U UUS9  g)zFCheck versions in pyproject.toml is consistent with _min_dependencies.r   numpyN)r3   )r>   )r1   r2   r3   s      r$   $test_min_dependencies_pyproject_tomlrA   x   s&     +?'*IgYt5    )N)__doc__r   r   collectionsr   pathlibr   r   r   sklearn._min_dependenciesr   sklearn.utils.fixesr   listr+   r0   r!   r#   extrasr-   extraappend)min_dependencies_tag_to_pyproject_sectiontagr%   r>   markparametrizerA    rB   r$   <module>rQ      s    I 	 	 #    8 -0;D0A -&8&>&>&@"G"k6d#5e<CCGL $ 'A
 %%- ) 9C
(. .c2 9"UL EI3Vl --335			rB   