Ë
    8Ò^j…"  ã                   ó@  — d 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Zddl	Z	ddl
mZ ddlmZ ddd	d
œZdZdZdZdZdZdZd„ Zd„ Zd„ Zd„ Zej2                  j5                  deeg«      d„ «       Zej2                  j5                  dedfedfedfedfg«      d„ «       Zy)zCTests for the minimum dependencies in README.rst and pyproject.tomlé    N)Údefaultdict)ÚPath)Údependent_packages)Úparse_version)z1.3.0Úinstall)z1.10.0zbuild, install)z3.0.1Úmaintenance)ÚjoblibÚscipyz
conda-lockzô
[project]
dependencies = ["joblib>=1.3.0", "scipy>=1.10.0"]
[project.optional-dependencies]
build = ["scipy>=1.10.0"]
install = ["joblib>=1.3.0", "scipy>=1.10.0"]
maintenance = ["conda-lock==3.0.1"]
[build-system]
requires = ["scipy>=1.10.0"]
a  
[project]
dependencies = ["joblib>=1.3.0,<2.0", "scipy>=1.10.0"]
[project.optional-dependencies]
build = ["scipy>=1.10.0,<1.19.0"]
install = ["joblib>=1.3.0,<2.0", "scipy>=1.10.0"]
maintenance = ["conda-lock==3.0.1"]
[build-system]
requires = ["scipy>=1.10.0,<1.19.0"]
zÑ
[project]
dependencies = ["scipy<1.10.0"]
[project.optional-dependencies]
build = ["scipy>=1.10.0"]
install = ["scipy>=1.10.0"]
maintenance = ["conda-lock==3.0.1"]
[build-system]
requires = ["scipy>=1.10.0"]
zÒ
[project]
dependencies = ["scipy>=1.10.0"]
[project.optional-dependencies]
build = ["scipy>=1.10.0"]
install = ["scipy>=1.10.0"]
maintenance = ["conda-lock==3.0.1"]
[build-system]
requires = ["scipy>=1.10.0"]
a$  
[project]
dependencies = ["joblib>=1.3.0", "scipy>=1.10.0"]
[project.optional-dependencies]
build = ["scipy>=1.10.0", "package_not_in_min_dependencies_py_file>=4.2"]
install = ["joblib>=1.3.0", "scipy>=1.10.0"]
maintenance = ["conda-lock==3.0.1"]
[build-system]
requires = ["scipy>=1.10.0"]
zõ
[project]
dependencies = ["joblib>=1.42.0", "scipy>=1.10.0"]
[project.optional-dependencies]
build = ["scipy>=1.10.0"]
install = ["joblib>=1.3.0", "scipy>=1.10.0"]
maintenance = ["conda-lock==3.0.1"]
[build-system]
requires = ["scipy>=1.10.0"]
c                  ó`  — t        j                  d«      } t        t        j                  «      j
                  j
                  }|dz  }t        j                  j                  |«      st        j                  d«       |j                  d«      5 }|D ]‡  }| j                  |«      }|sŒ|j                  d«      |j                  d«      }}|j                  «       }|t        v sŒRt!        |«      }t!        t        |   d   «      }|› d|› d	|› �}	||k(  rŒ‚J |	«       ‚ 	 d d d «       y # 1 sw Y   y xY w)
NzE\.\. \|([A-Za-z-]+)MinVersion\| replace::( [0-9]+\.[0-9]+(\.[0-9]+)?)z
README.rstz%The README.rst file is not available.Úré   é   r   zK has inconsistent minimum versions in README.rst and _min_dependencies.py: ú != )Ú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_versionÚmessages
             úu/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/sklearn/tests/test_min_dependencies_readme.pyÚtest_min_dependencies_readmer)   Z   s+  € ô
 �j‰jð	(ó€Gô ”w×'Ñ'Ó(×/Ñ/×6Ñ6€KØ Ñ,€Kä�7‰7�>‰>˜+Ô&ô 	�‰Ð;Ô<à	×	Ñ	˜#Ó	ð 7 !Øò 	7ˆDØ—m‘m DÓ)ˆGáØà&Ÿ}™}¨QÓ/°·±¸qÓ1A�WˆGØ—m‘m“oˆGàÔ,Ò,Ü'¨Ó0�Ü+Ô,>¸wÑ,GÈÑ,JÓK�ð �ið  .Ø.5¨Y°d¸;¸-ðIð ð  +Ó-Ð6¨wÓ6Ð-ñ#	7÷7÷ 7ñ 7ús   ÂAD$Ã"/D$ÄD$Ä$D-c                 óÞ   — t        t        «      }| j                  «       D ]2  \  }\  }}|j                  d«      D ]  }||   j	                  |«       Œ Œ4 dddœ}|D ]  }d|› �}|||<   Œ ||fS )Nz, Úbuildr   )úbuild-system.requireszproject.dependencieszproject.optional-dependencies.)r   ÚlistÚitemsÚsplitÚappend)	ÚdependenciesÚ0min_dependencies_tag_to_packages_without_versionr$   r&   ÚtagsÚtÚ)pyproject_section_to_min_dependencies_tagÚtagÚsections	            r(   Ú#extract_packages_and_pyproject_tagsr8   ƒ   s«   € Ü7BÄ4Ó7HÐ4Ø(4×(:Ñ(:Ó(<ò PÑ$ˆÑ$�+˜tØ—‘˜DÓ!ò 	PˆAØ<¸QÑ?×FÑFÀwÕOñ	PðPð
 ")Ø )ñ1Ð-ð @ò AˆØ2°3°%Ð8ˆØ=@Ð1°'Ò:ðAð
 	9Ø1ðð ó    c                 óL  — t        |«      \  }}|j                  «       D �]  \  }}|dk(  rdgng }||   }|j                  d«      }| }	|D ]  }
|	|
   }	Œ	 i }d}|	D ]R  }t        j                  ||«      }|€t        |› d|›d�«      ‚|j                  d«      |j                  d«      }}|||<   ŒT d	|› d
�}t        |«      t        |«      k(  sJ |«       ‚|j                  «       D ]<  \  }}t        |«      }t        ||   d   «      }||v rŒ'|› d|› d|› �}||k(  rŒ7J |«       ‚ �Œ y )Nr,   Únumpyú.z([\w-]+)\s*[>=]=\s*([\d\w.]+)z does not match expected regex z7. Only >= and == are supported for version requirementsr   r   zPackages in z! differ from _min_dependencies.pyr   zO has inconsistent minimum versions in pyproject.toml and _min_dependencies.py: r   )	r8   r.   r/   r   ÚsearchÚNotImplementedErrorr   Úsortedr   )Úpyproject_tomlÚmin_dependenciesÚpackagesÚpyproject_tagsÚpyproject_sectionÚmin_dependencies_tagÚskip_version_check_forÚexpected_packagesÚpyproject_section_keysÚinfoÚkeyÚpyproject_build_min_versionsr   Úrequirementr   r$   r%   ÚmsgÚexpected_min_versionr'   s                       r(   Úcheck_pyproject_sectionsrO   —   s·  € ÜBÐCSÓTÑ€Hˆnà3A×3GÑ3GÓ3Ió -<Ñ/ÐÐ/ð
 +Ð.EÒEˆW‰IÈ2ð 	ð %Ð%9Ñ:Ðà!2×!8Ñ!8¸Ó!=ÐØˆà)ò 	ˆCØ˜‘9‰Dð	ð (*Ð$à2ˆØò 
	<ˆKÜ—I‘I˜g {Ó3ˆEØˆ}Ü)Ø"�mÐ#BÀ7À+ð NLð Lóð ð
  %Ÿ{™{¨1›~¨u¯{©{¸1«~�WˆGà4;Ð(¨Ò1ð
	<ð Ð.Ð/Ð/PÐQˆäÐ2Ó3´vÐ>OÓ7PÒPÐUÐRUÓUÐPà <× BÑ BÓ Dò 
	<ÑˆG�WÜ# GÓ,ˆGÜ#0Ð1AÀ'Ñ1JÈ1Ñ1MÓ#NÐ ØÐ0Ñ0Øð �)ð *Ø*1¨°$Ð7KÐ6LðNð ð Ð2Ó2Ð;°GÓ;Ð2ò
	<ñG-<r9   c                  óH  — t        t        j                  «      j                  j                  } | dz  }|j	                  «       st        j                  d«       |j                  d«      5 }t        j                  |«      }ddd«       t        t        «       y# 1 sw Y   ŒxY w)zFCheck versions in pyproject.toml is consistent with _min_dependencies.zpyproject.tomlz pyproject.toml is not available.ÚrbN)r   r   r   r   r   r   r   r   ÚtomllibÚloadrO   r   )Úroot_directoryÚpyproject_toml_pathr!   r@   s       r(   Ú$test_min_dependencies_pyproject_tomlrV   Ê   s†   € ô œ'×*Ñ*Ó+×2Ñ2×9Ñ9€NØ(Ð+;Ñ;Ðà×%Ñ%Ô'ô 	�‰Ð6Ô7à	×	!Ñ	! $Ó	'ð )¨1Ü Ÿ™ a›ˆ÷)ô ˜^Ô-?Õ@÷)ð )ús   Á)BÂB!Úexample_pyprojectc                 óN   — t        j                  | «      }t        |t        «       y)z-Test the version check for matching packages.N)rR   ÚloadsrO   ÚTOY_MIN_DEPENDENCIES_PY_INFO)rW   r@   s     r(   Ú%test_check_matching_pyproject_sectionr[   Û   s   € ô —]‘]Ð#4Ó5€Nä˜^Ô-IÕJr9   z)example_non_matching_pyproject, error_msgzZ.* does not match expected regex .*. Only >= and == are supported for version requirementsz/Packages in .* differ from _min_dependencies.pyzY.* has inconsistent minimum versions in pyproject.toml and _min_dependencies.py: .* != .*c                 ó®   — t        j                  | «      }t        j                  t        |¬«      5  t        |t        «       ddd«       y# 1 sw Y   yxY w)z>Test the version check for non-matching packages and versions.)r   N)rR   rY   r   ÚraisesÚ	ExceptionrO   rZ   )Úexample_non_matching_pyprojectÚ	error_msgr@   s      r(   Ú)test_check_non_matching_pyproject_sectionra   ê   sE   € ô8 —]‘]Ð#AÓB€Nä	�‰”y¨	Ô	2ñ OÜ  Ô1MÔN÷O÷ Oñ Oús   ±AÁA)Ú__doc__r   r   rR   Úcollectionsr   Úpathlibr   r   r   Úsklearn._min_dependenciesr   Úsklearn.utils.fixesr   rZ   ÚTOY_MATCHING_PYPROJECT_SECTIONSÚ0TOY_MATCHING_PYPROJECT_SECTIONS_WITH_UPPER_BOUNDÚ#TOY_WRONG_SYMBOL_PYPROJECT_SECTIONSÚ&TOY_MISSING_PACKAGE_PYPROJECT_SECTIONSÚ)TOY_ADDITIONAL_PACKAGE_PYPROJECT_SECTIONSÚ+TOY_NON_MATCHING_VERSION_PYPROJECT_SECTIONSr)   r8   rO   rV   ÚmarkÚparametrizer[   ra   © r9   r(   ú<module>rp      s  ðÙ Iã 	Û 	Û Ý #Ý ã ã Ý 8Ý -ð
 #Ø)Ø*ñ Ð ð	#Ð ð	4Ð 0ð	'Ð #ð	*Ð &ð	-Ð )ð	/Ð +ò&7òRò(0<òfAð" ‡�×ÑØà'Ø8ðóñKóðKð ‡�×ÑØ/ð 0ðDð	
ð 3Ø=ð	
ð
 6Ø=ð	
ð
 8ð.ð	
ðóñ.Oó/ñ.Or9   