Virtual Packages

Conda allows for the registering of virtual packages in the index data via the plugin system. This mechanism lets users write plugins that provide version identification for properties only known at runtime (e.g., OS information).

class CondaVirtualPackage(name: str, version: str | None, build: str | None)

A conda virtual package.

Parameters
  • name -- Virtual package name (e.g., my_custom_os).

  • version -- Virtual package version (e.g., 1.2.3).

  • version -- Virtual package build string (e.g., x86_64).

build: str | None

Alias for field number 2

name: str

Alias for field number 0

version: str | None

Alias for field number 1

conda_virtual_packages(self) collections.abc.Iterable[conda.plugins.types.CondaVirtualPackage]

Register virtual packages in Conda.

Returns

An iterable of virtual package entries.

Example:

from conda import plugins


@plugins.hookimpl
def conda_virtual_packages():
    yield plugins.CondaVirtualPackage(
        name="my_custom_os",
        version="1.2.3",
        build="x86_64",
    )