§
    ­¸j¤  ã                  óH   — d Z ddlmZ ddlZddlZddlmZmZ ddd
„Zdd„Z	dS )z'Package version and git-status helpers.é    )ÚannotationsN)ÚPackageNotFoundErrorÚversionÚrfdetrÚpackage_nameÚstrÚreturnú
str | Nonec                óD   — 	 t          | ¦  «        S # t          $ r Y dS w xY w)a  Get the current version of the specified package.

    Args:
        package_name: The name of the package to get the version for. Defaults to ``'rfdetr'``.

    Returns:
        The version string of the specified package, or ``None`` if the version cannot be determined.
    N)r   r   )r   s    úh/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/rfdetr/utilities/package.pyÚget_versionr      s7   € ðÝ�|Ñ$Ô$Ð$øÝð ð ð Øˆtˆtðøøøs   ‚ ‘
žc                 óÔ  ‡— t           j                             t           j                             t          ¦  «        ¦  «        Šdˆfd„} 	  | g d¢¦  «        }t          j        g d¢‰dd	d	¬
¦  «        }|j        dvr)t          j        |j        g d¢|j	        |j
        ¬¦  «        ‚|j        dk    }|rdnd} | g d¢¦  «        }d|› d|› d|› �S # t
          j        t          f$ r Y dS w xY w)zªReturn a short status string for the current git repo, or 'unknown' if unavailable.

    Returns:
        String describing the current git HEAD, status, and branch.
    Úcommandú	list[str]r	   r   c                óz   •— t          j        | ‰¬¦  «                             d¦  «                             ¦   «         S )N)ÚcwdÚascii)Ú
subprocessÚcheck_outputÚdecodeÚstrip)r   r   s    €r   Ú_runzget_sha.<locals>._run&   s3   ø€ ÝÔ& w°CÐ8Ñ8Ô8×?Ò?ÀÑHÔH×NÒNÑPÔPÐPó    )Úgitú	rev-parseÚHEAD)r   z
diff-indexz--quietr   z--FT)r   ÚcheckÚcapture_outputÚtext)r   é   )Ú
returncodeÚcmdÚoutputÚstderrr    zhas uncommitted changesÚclean)r   r   z--abbrev-refr   zsha: z
, status: z
, branch: ÚunknownN)r   r   r	   r   )ÚosÚpathÚdirnameÚabspathÚ__file__r   Úrunr!   ÚCalledProcessErrorÚstdoutr$   ÚFileNotFoundError)r   ÚshaÚdiff_resultÚhas_diffÚstatusÚbranchr   s         @r   Úget_shar5      sS  ø€ õ Œ'�/Š/�"œ'Ÿ/š/­(Ñ3Ô3Ñ
4Ô
4€CðQð Qð Qð Qð Qð QðØˆdÐ/Ð/Ð/Ñ0Ô0ˆÝ ”nØ:Ð:Ð:ØØØØð
ñ 
ô 
ˆð Ô!¨Ð/Ð/ÝÔ/Ø&Ô1ØBÐBÐBØ"Ô)Ø"Ô)ð	ñ ô ð ð Ô)¨QÒ.ˆØ.6ÐCÐ*Ð*¸GˆØ�ÐBÐBÐBÑCÔCˆØ@�sÐ@Ð@ fÐ@Ð@¸Ð@Ð@Ð@øÝÔ)Õ+<Ð=ð ð ð Øˆyˆyðøøøs   Á
BC ÃC'Ã&C')r   )r   r   r	   r
   )r	   r   )
Ú__doc__Ú
__future__r   r'   r   Úimportlib.metadatar   r   r   r5   © r   r   ú<module>r:      sƒ   ðð .Ð -à "Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø Ð Ð Ð Ø <Ð <Ð <Ð <Ð <Ð <Ð <Ð <ðð ð ð ð ð ð  ð  ð  ð  ð  r   