Environment#
Environment
#
Information about a specific environment in the lock-file.
__init__(name, requirements)
#
Create a new environment.
__repr__()
#
Returns a representation of the Environment.
channels()
#
Returns the channels that are used by this environment. Note that the order of the channels is significant. The first channel is the highest priority channel.
Examples#
conda_repodata_records_for_platform(platform)
#
Takes all the conda packages, converts them to [RepoDataRecord
] and returns them or
returns an error if the conversion failed. Returns None
if the specified platform is not
defined for this environment.
Examples#
packages(platform)
#
Returns all the packages for a specific platform in this environment.
Examples#
packages_by_platform()
#
Returns a list of all packages and platforms defined for this environment.
Examples#
pypi_packages_for_platform(platform)
#
Returns all the pypi packages and their associated environment data for the specified
platform. Returns None
if the platform is not defined for this environment.
Examples#
>>> from rattler import LockFile, Platform
>>> lock_file = LockFile.from_path("../test-data/test.lock")
>>> env = lock_file.default_environment()
>>> osx_pypi_pkgs = env.pypi_packages_for_platform(Platform("osx-arm64"))
>>> osx_pypi_pkgs
[...]
>>> osx_pypi_pkgs[0]
(PypiPackageData(), PypiPackageEnvironmentData())
>>>