channel#

Defines Channel and MultiChannel objects and other channel-related functions.

Object inheritance:

Inheritance diagram of Channel, MultiChannel

Classes#

ChannelType

This metaclass does basic caching and enables static constructor method usage with a

Channel

Channel:

MultiChannel

Channel:

Functions#

tokenized_startswith(→ bool)

tokenized_conda_url_startswith(→ bool)

_get_channel_for_name(→ Channel)

_read_channel_configuration(→ tuple[str | None, ...)

parse_conda_channel_url(→ Channel)

get_conda_build_local_url(...)

prioritize_channels(→ dict[str, tuple[str, int]])

all_channel_urls(→ boltons.setutils.IndexedSet)

offline_keep(→ bool)

get_channel_objs(→ tuple[Channel, Ellipsis])

Return current channels as Channel objects

class ChannelType#

Bases: type

This metaclass does basic caching and enables static constructor method usage with a single arg.

__call__(*args, **kwargs)#

Call self as a function.

class Channel(scheme: str | None = None, auth: str | None = None, location: str | None = None, token: str | None = None, name: str | None = None, platform: str | None = None, package_filename: str | None = None)#

Channel: scheme <> auth <> location <> token <> channel <> subchannel <> platform <> package_filename

Package Spec: channel <> subchannel <> namespace <> package_name

property channel_location: str | None#
property channel_name: str#
property subdir: str | None#
property canonical_name: str#
property base_url: str | None#
property base_urls: tuple[str | None]#
property subdir_url: str#
property url_channel_wtf: tuple[str | None, str]#
_cache_#
static _reset_state() None#
static from_url(url: str) Channel#
static from_channel_name(channel_name: str) Channel#
static from_value(value: str | None) Channel#

Construct a new Channel from a single value.

Parameters:

value --

Anyone of the following forms:

None, or one of the special strings "<unknown>", "None:///<unknown>", or "None":

represents the unknown channel, used for packages with unknown origin.

A URL including a scheme like file:// or https://:

represents a channel URL.

A local directory path:

represents a local channel; relative paths must start with ./.

A package file (i.e. the path to a file ending in .conda or .tar.bz2):

represents a channel for a single package

A known channel name:

represents a known channel, e.g. from the users .condarc file or the global configuration.

Returns:

A channel object.

static make_simple_channel(channel_alias: Channel, channel_url: str, name: str | None = None) Channel#
urls(with_credentials: bool = False, subdirs: collections.abc.Iterable[str] | None = None) list[str]#
url(with_credentials: bool = False) str | None#
__str__() str#

Return str(self).

__repr__() str#

Return repr(self).

__eq__(other: Any) bool#

Return self==value.

__hash__() int#

Return hash(self).

__nonzero__() bool#
__bool__() bool#
__json__() dict[str, Any]#
dump() dict[str, str | None]#
class MultiChannel(name: str, channels: collections.abc.Iterable[Channel], platform: str | None = None)#

Bases: Channel

Channel: scheme <> auth <> location <> token <> channel <> subchannel <> platform <> package_filename

Package Spec: channel <> subchannel <> namespace <> package_name

property channel_location: None#
property canonical_name: str#
property base_url: None#
property base_urls: tuple[str | None, Ellipsis]#
urls(with_credentials: bool = False, subdirs: collections.abc.Iterable[str] | None = None) list[str]#
url(with_credentials: bool = False) None#
dump() dict[str, str | tuple[dict[str, Any], Ellipsis]]#
tokenized_startswith(test_iterable: collections.abc.Iterable[Any], startswith_iterable: collections.abc.Iterable[Any]) bool#
tokenized_conda_url_startswith(test_url: collections.abc.Iterable[str], startswith_url: collections.abc.Iterable[str]) bool#
_get_channel_for_name(channel_name: str) Channel#
_read_channel_configuration(scheme: str | None, host: str | None, port: str | None, path: str | None) tuple[str | None, str | None, str | None, str | None, str | None]#
parse_conda_channel_url(url: str) Channel#
get_conda_build_local_url() tuple[conda.common.path.PathType]#
prioritize_channels(channels: collections.abc.Iterable[Channel | str], with_credentials: bool = True, subdirs: collections.abc.Iterable[str] | None = None) dict[str, tuple[str, int]]#
all_channel_urls(channels: collections.abc.Iterable[str | Channel], subdirs: collections.abc.Iterable[str] | None = None, with_credentials: bool = True) boltons.setutils.IndexedSet#
offline_keep(url: Any) bool#
get_channel_objs(ctx: conda.base.context.Context) tuple[Channel, Ellipsis]#

Return current channels as Channel objects