ó
    �2¨jI  ã                   óp   • S r SSKrSSKJr  SSKJr  SrSrSr	Sr
S	rS
\S\S-  4S jrS\4S jr\" 5       rg)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                 ó¤   •  U R                  SS9n[        R                  " SU5      nU(       a  UR	                  S5      $ S$ ! [         a     gf = f)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      Ú£C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\portalocker/__about__.pyÚ_read_pyproject_versionr      sX   € ðØ—.‘.¨'�.Ð2ˆô �IŠIØAØó€Eö #ˆ5�;‰;�q‹>Ð,¨Ð,øô ó Ùðús   ‚A Á
AÁAc                  óì   •  [         R                  " [        5      $ ! [         a     Of = f[	        [
        5      R                  5       R                  R                  n [        U S-  5      nU=(       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   ,   sf   € ðÜ!×)Ò)Ô*:Ó;Ð;øÜó Ùðúô ”‹>×!Ñ!Ó#×*Ñ*×1Ñ1€DÜ% dÐ-=Ñ&=Ó>€GØ×�gÐs   ‚ œ
)¨))Ú__doc__r   Ú	importlibr   r   Úpathlibr   r   Ú
__author__Ú	__email__Ú__description__Ú__url__Ústrr   r   Ú__version__© ó    r   Ú<module>r(      s[   ðñó 
Ý 4Ý à Ð Ø€
Ø€	Ø?€Ø
0€ð- $ð -¨3°©:ô -ð2�Sô ñ( ‹m�r'   