Skip to content

PypiLockedPackage#

Bases: LockedPackage

A locked PyPI package in a lock file.

extras property #

extras

The extras enabled for the package. Note that the order doesn't matter.

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()
>>> env_data = pypi_packages[Platform("osx-arm64")][0]
>>> env_data.extras
set()
>>>

is_editable property #

is_editable

Whether the package should be installed in editable mode or not.

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.is_editable
False
>>>

requires_dist property #

requires_dist

A list of dependencies on other packages.

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.requires_dist
[]
>>>

requires_python property #

requires_python

The python version that this package requires.

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.requires_python
'>=3.7.0'
>>>

version property #

version

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

satisfies #

satisfies(spec)

Returns true if this package satisfies the given spec.

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.satisfies("charset-normalizer")
True
>>>