
    ig                       U d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z
 erddlmZ ddlmZmZ d	ed
<   	 ddlmZ n# e$ r	 ddlmZ Y nw xY wddZd dZedk    r ej                                                    Zedz                                  sJ edz  Zedz  Ze                    d          Zd  ee          D             Z eee          Z ej          e!e                     dS dS )!zhSync Requirements - Automatically upgrade test requirements pinned
versions from pre-commit config file.    )annotationsN)Path)TYPE_CHECKING)load)	Generator)CLoaderLoaderztype[_CLoader | _Loader]r	   )r   )r	   pre_commit_textstrreturn&Generator[tuple[str, str], None, None]c              #     K   t          | t                    }|d         D ]P}d|vsd|vr|d         }|                    dd          d         }|d                             d          }||fV  QdS )	z5Yield (name, rev) tuples from pre-commit config file.reposreporev/   vN)	load_yamlr	   rsplitremoveprefix)r
   pre_commit_configr   urlnamer   s         i/var/www/html/nodeJS/PythonScripts/venv3.11/lib/python3.11/site-packages/trio/_tools/sync_requirements.pyyield_pre_commit_version_datar      s       "/6::!'*  d!2!26lzz#q!!"%5k&&s++Ci     requirementsr   version_datadict[str, str]boolc                   d}|                      d                              d          }|                     dd          5 }|D ]}|                    d          sd|vr|                    |           2|                    dd          \  }}|                                }d	}	d
|v r2|                    d
d          \  }}	|                                }d|	z   }	|                    |          }
|
|                    |           | d|
 |	 }||k    r-|sd}t          d           t          | d| d| d|
            |                    |           	 ddd           n# 1 swxY w Y   |S )zeReturn if updated requirements file.

    Update requirements file to match versions in version_data.Futf-8encodingTw#z==r   
;z ;Nz5Changed test requirements version to match pre-commitz -> )		read_text
splitlinesopen
startswithwritesplitstripgetprint)r   r    changed	old_linesfileliner   restold_versionextraversionnew_lines               r   update_requirementsr=   )   s    G&&&88CCDIII			3		1	1 !T 	! 	!Ds## t4'7'7

4   D!,,JD$**,,KEd{{%)ZZQ%7%7"U)//11u"&&t,,G

4   22'2522H4 S"GQRRRCCCC$CC'CCDDDJJx    3	!! ! ! ! ! ! ! ! ! ! ! ! ! ! !6 Ns   DE**E.1E.__main__LICENSEz.pre-commit-config.yamlztest-requirements.txtr$   r%   c                f    i | ].\  }}|                     d                                d          |/S )z-mirrorz-pre-commit)removesuffix).0r   r;   s      r   
<dictcomp>rC   ]   sJ       D' 	)$$11-@@'  r   )r
   r   r   r   )r   r   r    r!   r   r"   )"__doc__
__future__r   syspathlibr   typingr   yamlr   r   collections.abcr   r   _CLoaderr	   _Loader__annotations__ImportErrorr   r=   __name__cwdabsolutesource_rootexists
pre_committest_requirementsr+   r
   pre_commit_versionsr4   exitint r   r   <module>rZ      s  ) ) ) # " " " " " 



                   " " " " " " %))))));;;;;;;;$$$$&&&&&&&      % % % %P z$(**%%''K )#++-----88J#&== **G*<<O ::?KK   "!"35HIIGCHSS\\# s   = A
A