o
    M,h                  
   @  s   d dl mZ d dlmZ d dlmZ d dlmZ zd dlZW n e	y4 Z
 z
ee
 W Y dZ
[
ndZ
[
ww d dlmZmZ erEd dlmZ dd	d
ZdddZdddZdS )    )annotations)Path)TYPE_CHECKING)skip_if_optional_else_raiseN)update_requirementsyield_pre_commit_version_datareturnNonec                  C  s    d} t t| }|dksJ d S )Nz
repos:
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.11.0
  - repo: https://github.com/psf/black-pre-commit-mirror
    rev: 25.1.0
  - bad: data
))zruff-pre-commitz0.11.0)zblack-pre-commit-mirrorz25.1.0)tupler   )textresults r   t/var/www/www-root/data/www/bot.pdev.uz/venv/lib/python3.10/site-packages/trio/_tests/tools/test_sync_requirements.py"test_yield_pre_commit_version_data   s   r   tmp_pathr   c                 C  sN   | d }|  r
J |jddd t|dddsJ |jdddks%J d S )	Nrequirements.txt# comment
  # also comment but spaces line start
waffles are delicious no equals
black==3.1.4 ; specific version thingy
mypy==1.15.0
ruff==1.2.5
# required by soupy catutf-8encodingz3.1.5z1.2.7blackruffz# comment
  # also comment but spaces line start
waffles are delicious no equals
black==3.1.5 ; specific version thingy
mypy==1.15.0
ruff==1.2.7
# required by soupy catexists
write_textr   	read_text)r   requirements_filer   r   r   test_update_requirements'   s   

r   c                 C  sR   | d }|  r
J d}|j|dd t|dddrJ |jdd|ks'J d S )Nr   r   r   r   z3.1.4z1.2.5r   r   )r   r   originalr   r   r   #test_update_requirements_no_changesC   s   
r    )r   r	   )r   r   r   r	   )
__future__r   pathlibr   typingr   trio._tests.pytest_pluginr   yamlImportErrorerrortrio._tools.sync_requirementsr   r   r   r   r    r   r   r   r   <module>   s     

