exclude_newer#

Helpers for applying the exclude_newer package policy.

Classes#

_CutoffParser

Resolve user-provided cutoff values into absolute POSIX timestamps.

_ChannelSelector

Resolved channel_settings channel selector.

_ChannelCutoff

Resolved channel-specific exclude_newer cutoff.

ExcludeNewerPolicy

Resolved exclude_newer configuration.

Functions#

_get_timestamp(→ float | None)

_get_value(→ Any)

class _CutoffParser#

Resolve user-provided cutoff values into absolute POSIX timestamps.

now: float#
static is_false_override(value: object) bool#
optional_cutoff(value: str | int | float | bool | None) float | None#
cutoff(value: str | int | float | bool) float#
duration_cutoff(duration_seconds: float, value: object) float#
static invalid(value: str) conda.exceptions.CondaValueError#
class _ChannelSelector#

Resolved channel_settings channel selector.

URL_GLOB_CHARS#
keys: frozenset[str]#
url_pattern: tuple[str, str] | None#
classmethod from_value(value: str) _ChannelSelector#
matches(record: conda.models.records.PackageRecord | collections.abc.Mapping[str, Any]) bool#
classmethod keys_for_record(record: conda.models.records.PackageRecord | collections.abc.Mapping[str, Any]) frozenset[str]#
classmethod keys_for(value: object) frozenset[str]#
static channel_from(value: object)#
classmethod url_match_parts(value: object) tuple[str, str] | None#
static normalize(value: object) str | None#
class _ChannelCutoff#

Resolved channel-specific exclude_newer cutoff.

SETTING_KEYS = ('exclude_newer', 'exclude-newer')#
selector: _ChannelSelector#
cutoff: float | None#
classmethod from_settings(settings: collections.abc.Mapping[str, Any], parser: _CutoffParser) _ChannelCutoff | None#
matches(record: conda.models.records.PackageRecord | collections.abc.Mapping[str, Any]) bool#
class ExcludeNewerPolicy#

Resolved exclude_newer configuration.

Cutoffs are stored as absolute POSIX timestamps. A package record is included when its indexed_timestamp or timestamp is missing or older than the effective cutoff for that package name.

global_cutoff: float | None = None#
channel_cutoffs: tuple[_ChannelCutoff, ...] = ()#
package_cutoffs: dict[str, float | None] | None = None#
now: float = 0.0#
classmethod from_values(exclude_newer: str | int | float | None, exclude_newer_package: collections.abc.Mapping[str, str | bool | int | float | None] | None, channel_settings: collections.abc.Iterable[collections.abc.Mapping[str, Any]] | None = None, now: float | None = None) ExcludeNewerPolicy#
property active: bool#
property has_global_cutoff: bool#
property has_package_overrides: bool#
property has_channel_overrides: bool#
_cutoff_for_record(record: conda.models.records.PackageRecord | collections.abc.Mapping[str, Any]) float | None#
should_include(record: conda.models.records.PackageRecord | collections.abc.Mapping[str, Any]) bool#
filter_records(records: collections.abc.Iterable[conda.models.records.PackageRecord]) tuple[conda.models.records.PackageRecord, ...]#
excluded_records(records: collections.abc.Iterable[conda.models.records.PackageRecord]) tuple[conda.models.records.PackageRecord, ...]#
_get_timestamp(record: conda.models.records.PackageRecord | collections.abc.Mapping[str, Any]) float | None#
_get_value(record: conda.models.records.PackageRecord | collections.abc.Mapping[str, Any], key: str) Any#