§
    ´¯¸jI  ã                   ót   — d Z ddlZddlmZ ddlmZ dZdZdZ	dZ
d	Zd
ededz  fd„Zdefd„Z e¦   «         ZdS )zÏVersion and package metadata helpers for portalocker.

This module resolves the runtime version by preferring installed package
metadata and falling back to parsing the local ``pyproject.toml`` when
needed.
é    N)Úmetadata)ÚPathÚportalockerzRick van Hattemzwolph@wol.phz+Wraps the portalocker recipe for easy usagez$https://github.com/WoLpH/portalockerÚpathÚreturnc                 ó°   — 	 |                       d¬¦  «        }n# t          $ r Y dS w xY wt          j        d|¦  «        }|r|                     d¦  «        ndS )a¥  Read the version from a ``pyproject.toml`` file if available.

    This uses a small regex parser that looks for the ``[project]`` table
    and extracts the ``version`` value. It's intentionally minimal to avoid
    runtime dependencies while keeping types precise.

    Args:
        path: Path to the ``pyproject.toml`` file.

    Returns:
        The version string if it could be determined, otherwise ``None``.
    zutf-8)ÚencodingNz6(?ms)^\[project\].*?^version\s*=\s*['\"]([^'\"]+)['\"]é   )Ú	read_textÚ	ExceptionÚreÚsearchÚgroup)r   ÚcontentÚmatchs      úe/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/portalocker/__about__.pyÚ_read_pyproject_versionr      sr   € ðØ—.’.¨'�.Ñ2Ô2ˆˆøÝð ð ð Øˆtˆtðøøøõ ŒIØAØñô €Eð #Ð,ˆ5�;Š;�q‰>Œ>ˆ>¨Ð,s   ‚ ™
'¦'c                  óâ   — 	 t          j        t          ¦  «        S # t          $ r Y nw xY wt	          t
          ¦  «                             ¦   «         j        j        } t          | dz  ¦  «        }|pdS )a"  Return the package version at runtime.

    Prefers installed package metadata. When running from a source tree it
    falls back to parsing the ``pyproject.toml`` ``[project].version``
    field.

    Returns:
        The resolved version string. Returns ``'0.0.0'`` as a last resort.
    zpyproject.tomlz0.0.0)	Úimportlib_metadataÚversionÚ__package_name__r   r   Ú__file__ÚresolveÚparentr   )Úrootr   s     r   Úget_versionr   ,   sv   € ðÝ!Ô)Õ*:Ñ;Ô;Ð;øÝð ð ð Øˆðøøøõ •‰>Œ>×!Ò!Ñ#Ô#Ô*Ô1€DÝ% dÐ-=Ñ&=Ñ>Ô>€GØÐ�gÐs   ‚ ›
(§()Ú__doc__r   Ú	importlibr   r   Úpathlibr   r   Ú
__author__Ú	__email__Ú__description__Ú__url__Ústrr   r   Ú__version__© ó    r   ú<module>r(      sª   ððð ð 
€	€	€	Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø Ð Ð Ð Ð Ð à Ð Ø€
Ø€	Ø?€Ø
0€ð- $ð -¨3°©:ð -ð -ð -ð -ð2�Sð ð ð ð ð( ˆk‰mŒm€€€r'   