+
    ,jF                         ^ RI Ht ^ RIHt ^ RIHtHt ^ RIHtH	t	H
t
 ^ RIHt ^ RIHt ^ RIHt  ! R R	]4      t ! R
 R]]4      t ! R R]4      t ! R R]4      t ! R R]4      tR# )    )annotations)ABC)OptionalList)PackageRecordVersionRepoDataRecord)PyLockedPackage)PackageHashes)	MatchSpecc                      ] tR t^t$ RtR]R&   ]R R l4       t]R R l4       t]R R	 l4       t	R
 R lt
]R R l4       tRtR# )LockedPackagez,
Base class for any package in a lock file.
r
   _packagec                   V ^8  d   QhRR/#    returnstr )formats   "4lib/python3.14/site-packages/rattler/lock/package.py__annotate__LockedPackage.__annotate__   s     " "c "    c                .    V P                   P                  # )a  
Returns the name of the package as recorded in the lock-file.

Note that this might not perse be the normalized name according to the specific ecosystem for the package.

Examples
--------
```python
>>> from rattler import LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> platforms = env.platforms()
>>> lock_package = env.packages(platforms[0])[0]
>>> lock_package.name
'tzdata'
>>>
```
)r   nameselfs   &r   r   LockedPackage.name   s    ( }}!!!r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   *   s     & &# &r   c                .    V P                   P                  # )a|  
Returns the location of the package as recorded in the lock-file.

Examples
--------
```python
>>> from rattler import LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> platforms = env.platforms()
>>> lock_package = env.packages(platforms[0])[0]
>>> lock_package.location
'https://conda.anaconda.org/...'
>>>
```
)r   locationr   s   &r   r"   LockedPackage.location)   s    $ }}%%%r   c                   V ^8  d   QhRR/# )r   r   zOptional[PackageHashes]r   )r   s   "r   r   r   >   s     K K/ Kr   c                V    \         P                  ! V P                  P                  4      # )aG  
Hashes of the file pointed to by `url`.

Examples
--------
```python
>>> from rattler import LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> pypi_packages = env.pypi_packages()
>>> data = pypi_packages["osx-arm64"][0]
>>> data.hashes
PackageHashes()
>>>
```
)r   _from_py_package_hashesr   hashesr   s   &r   r'   LockedPackage.hashes=   s    $ 44T]]5I5IJJr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   Q   s     W W# Wr   c                j    \        V 4      P                   RV P                  : RV P                  : R2# )z0
Returns a representation of the LockedPackage.
z(name=z
,location=))type__name__r   r"   r   s   &r   __repr__LockedPackage.__repr__Q   s2     t*%%&fTYYMDMMCTTUVVr   c                    V ^8  d   QhRRRR/# )r   py_pkgr
   r   r   r   )r   s   "r   r   r   X   s      _  r   c                0   VP                   '       d   \        P                  \        4      pMcVP                  '       d   \        P                  \        4      pM7VP
                  '       d   \        P                  \        4      pM\        R4      hWn        V# )B
Construct Rattler LockedPackage from FFI PyLockedPackage object.
z[Cannot create LockedPackage from PyLockedPackage, the type of the package is not supported.)	is_conda_binaryCondaLockedBinaryPackage__new__is_conda_sourceCondaLockedSourcePackageis_pypiPypiLockedPackage	TypeErrorr   clsr1   pkgs   && r   _from_py_locked_package%LockedPackage._from_py_locked_packageW   st     !!!*223KLC###*223KLC^^^#++,=>Cm  
r   r   N)r-   
__module____qualname____firstlineno____doc____annotations__propertyr   r"   r'   r.   classmethodr?   __static_attributes__r   r   r   r   r      se     " "* & && K K&W  r   r   c                  R    ] tR t^ltRt]R R l4       t]R R l4       tR R ltRt	R	# )
CondaLockedPackagez(
A locked conda package in a lock file.
c                   V ^8  d   QhRR/# )r   r   zOptional[PackageRecord]r   )r   s   "r   r   CondaLockedPackage.__annotate__r   s     
8 
8 7 
8r   c                f    V P                   P                  pVf   R# \        P                  ! V4      # )z
Returns the metadata of the package as recorded in the lock-file.

For binary packages, this always returns a value. For source packages,
the record may not be present if the metadata hasn't been evaluated yet.
N)r   package_recordr   _from_py_record)r   	py_records   & r   rN   !CondaLockedPackage.package_recordq   s-     MM00	,,Y77r   c                   V ^8  d   QhRR/# )r   r   zOptional[Version]r   )r   s   "r   r   rL      s     4 4* 4r   c                f    V P                   P                  pVf   R# \        P                  ! V4      # )a  
Returns the version of the package as recorded in the lock-file.

For source packages without evaluated metadata, this may return None.

Examples
--------
```python
>>> from rattler import LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> platforms = env.platforms()
>>> lock_package = env.packages(platforms[0])[0]
>>> lock_package.version
Version("2024a")
>>>
```
N)r   conda_versionr   _from_py_version)r   
py_versions   & r   versionCondaLockedPackage.version~   s-    ( ]]00
''
33r   c                    V ^8  d   QhRRRR/# )r   speczMatchSpec | strr   boolr   )r   s   "r   r   rL      s     ? ?o ?$ ?r   c                    \        V\        4      '       d   \        V4      pV P                  P	                  VP
                  4      # )ab  
Returns true if this package satisfies the given `spec`.

Examples
--------
```python
>>> from rattler import LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> platforms = env.platforms()
>>> packages = env.packages(platforms[0])
>>> packages[0].satisfies("tzdata >=2024a")
True
>>>
```
)
isinstancer   r   r   conda_satisfies_match_specr   rZ   s   &&r   	satisfiesCondaLockedPackage.satisfies   s5    " dC  T?D}},,T-=-=>>r   r   N)
r-   rA   rB   rC   rD   rF   rN   rW   ra   rH   r   r   r   rJ   rJ   l   s9     
8 
8 4 40? ?r   rJ   c                  ~    ] tR t^tRt]R R l4       t]R R l4       t]R R l4       tR R	 lt	]
R
 R l4       tRtR# )r:   z'
A locked PyPI package in a lock file.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   PypiLockedPackage.__annotate__   s     * * *r   c                .    V P                   P                  # )zB
Returns the version of the package as recorded in the lock-file.
)r   pypi_versionr   s   &r   rW   PypiLockedPackage.version   s    
 }})))r   c                   V ^8  d   QhRR/# )r   r   z	List[str]r   )r   s   "r   r   re      s     0 0y 0r   c                .    V P                   P                  # )aC  
A list of dependencies on other packages.

Examples
--------
```python
>>> from rattler import LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> pypi_packages = env.pypi_packages()
>>> data = pypi_packages["osx-arm64"][0]
>>> data.requires_dist
[]
>>>
```
)r   pypi_requires_distr   s   &r   requires_distPypiLockedPackage.requires_dist   s    $ }}///r   c                   V ^8  d   QhRR/# )r   r   zOptional[str]r   )r   s   "r   r   re      s     2 2 2r   c                .    V P                   P                  # )aQ  
The python version that this package requires.

Examples
--------
```python
>>> from rattler import LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> pypi_packages = env.pypi_packages()
>>> data = pypi_packages["osx-arm64"][0]
>>> data.requires_python
'>=3.7.0'
>>>
```
)r   pypi_requires_pythonr   s   &r   requires_python!PypiLockedPackage.requires_python   s    $ }}111r   c                    V ^8  d   QhRRRR/# )r   rZ   r   r   r[   r   )r   s   "r   r   re      s     2 2c 2d 2r   c                8    V P                   P                  V4      # )af  
Returns true if this package satisfies the given `spec`.

Examples
--------
```python
>>> from rattler import LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> pypi_packages = env.pypi_packages()
>>> data = pypi_packages["osx-arm64"][0]
>>> data.satisfies("charset-normalizer")
True
>>>
```
)r   pypi_satisfiesr`   s   &&r   ra   PypiLockedPackage.satisfies   s    " }}++D11r   c                    V ^8  d   QhRRRR/# )r   r1   r
   r   r:   r   )r   s   "r   r   re      s      _ AR r   c                    VP                   '       d   \        P                  \        4      pM\        R4      hWn        V# )r3   z_Cannot create PypiLockedPackage from PyLockedPackage, the type of the package is not supported.)r9   r:   r6   r;   r   r<   s   && r   r?   )PypiLockedPackage._from_py_locked_package   s:    
 >>>#++,=>Cq  
r   r   N)r-   rA   rB   rC   rD   rF   rW   rl   rq   ra   rG   r?   rH   r   r   r   r:   r:      s\     * * 0 0& 2 2&2&  r   r:   c                      ] tR tRtRtRtR# )r8   i  z/
A locked conda source package in a lock file.
r   N)r-   rA   rB   rC   rD   rH   r   r   r   r8   r8     s    r   r8   c                  &    ] tR tRtRtR R ltRtR# )r5   i  z/
A locked conda binary package in a lock file.
c                   V ^8  d   QhRR/# )r   r   r	   r   )r   s   "r   r   %CondaLockedBinaryPackage.__annotate__  s     N N. Nr   c                V    \         P                  ! V P                  P                  4      # )zb
Returns the metadata of the package as recorded in the lock-file including location information.
)r	   rO   r   repo_data_recordr   s   &r   r   )CondaLockedBinaryPackage.repo_data_record  s     --dmm.L.LMMr   r   N)r-   rA   rB   rC   rD   r   rH   r   r   r   r5   r5     s    N Nr   r5   N)
__future__r   abcr   typingr   r   rattlerr   r   r	   rattler.rattlerr
   rattler.lock.hashr   rattler.match_specr   r   rJ   r:   r8   r5   r   r   r   <module>r      sf    "  ! : : + + (]C ]@?? ??DT Tn1 	N1 	Nr   