
    h2              
           S SK Jr  S SKJrJr  S SKJrJr   SS\S\S\	S\\	   4S jjr
S\S\\   4S	 jrS
\S\S\	4S jrg)    )Optional)InvalidSpecifierSpecifierSet)InvalidVersionVersionversion
constraintprereleasesreturnc                     US   R                  5       (       a  SU 3n [        U5      n[        U 5      n X#l        X;   $ ! [        [        4 a     gf = f)a  Check if a version (e.g. "2.0.0") is compatible given a version
constraint (e.g. ">=1.9.0,<2.2.1"). If the constraint is a specific version,
it's interpreted as =={version}.

version (str): The version to check.
constraint (str): The constraint string.
prereleases (bool): Whether to allow prereleases. If set to False,
    prerelease versions will be considered incompatible.
RETURNS (bool / None): Whether the version is compatible, or None if the
    version or constraint are invalid.
r   z==N)isdigitr   r   r   r   r
   )r   r	   r
   specs       N/home/james-whalen/.local/lib/python3.13/site-packages/weasel/util/versions.pyis_compatible_versionr      se     !}*&
J''" #? n- s   ? AAc                 |     [        U 5      nUR                   SUR                   3$ ! [        [        4 a     gf = f)zGet the major + minor version (without patch or prerelease identifiers).

version (str): The version.
RETURNS (str): The major + minor version or None if version is invalid.
N.)r   	TypeErrorr   majorminor)r   vs     r   get_minor_versionr   !   sE    G ggYay!! ~& s   ( ;;	version_a	version_bc                 b    [        U 5      n[        U5      nUSL=(       a    USL=(       a    X#:H  $ )a6  Compare two versions and check if they match in major and minor, without
patch or prerelease identifiers. Used internally for compatibility checks
that should be insensitive to patch releases.

version_a (str): The first version
version_b (str): The second version.
RETURNS (bool): Whether the versions match.
N)r   )r   r   abs       r   is_minor_version_matchr   .   s2     	)$A)$AD=5Qd]5qv5    N)T)typingr   packaging.specifiersr   r   packaging.versionr   r   strboolr   r   r    r   r   <module>r%      sm     ? 5 8<!04d^4
"s 
"x} 
"6c 6c 6d 6r   