Skip to content

LockedPackage#

Bases: ABC

Base class for any package in a lock file.

hashes: Optional[PackageHashes] property #

Hashes of the file pointed to by url.

Examples#

>>> from rattler import LockFile, Platform
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> pypi_packages = env.pypi_packages()
>>> data = pypi_packages[Platform("osx-arm64")][0]
>>> data.hashes
PackageHashes()
>>>

location: str property #

Returns the location of the package as recorded in the lock-file.

Examples#

>>> from rattler import Platform, LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> lock_package = env.packages(Platform("osx-arm64"))[0]
>>> lock_package.location
'https://conda.anaconda.org/...'
>>>

name: str property #

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#

>>> from rattler import Platform, LockFile
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> lock_package = env.packages(Platform("osx-arm64"))[0]
>>> lock_package.name
'tzdata'
>>>

__repr__() #

Returns a representation of the LockedPackage.