diff --git a/libmamba/include/mamba/core/download.hpp b/libmamba/include/mamba/core/download.hpp index 4e582f3f06..fe29d5d9b1 100644 --- a/libmamba/include/mamba/core/download.hpp +++ b/libmamba/include/mamba/core/download.hpp @@ -97,7 +97,7 @@ namespace mamba bool sort = true; termination_function on_unexpected_termination = std::nullopt; }; - + class DownloadMonitor { public: @@ -118,8 +118,12 @@ namespace mamba DownloadMonitor() = default; }; - MultiDownloadResult - download(MultiDownloadRequest requests, const Context& context, DownloadOptions options = {}, DownloadMonitor* monitor = nullptr); + MultiDownloadResult download( + MultiDownloadRequest requests, + const Context& context, + DownloadOptions options = {}, + DownloadMonitor* monitor = nullptr + ); } diff --git a/libmamba/src/api/channel_loader.cpp b/libmamba/src/api/channel_loader.cpp index 7cb365de17..1b1bee9b5c 100644 --- a/libmamba/src/api/channel_loader.cpp +++ b/libmamba/src/api/channel_loader.cpp @@ -102,7 +102,7 @@ namespace mamba expected_t download_res; if (DownloadProgressBar::can_monitor(ctx)) { - DownloadProgressBar check_monitor({true, true}); + DownloadProgressBar check_monitor({ true, true }); DownloadProgressBar index_monitor; download_res = MSubdirData::download_indexes(subdirs, ctx, &check_monitor, &index_monitor); } @@ -120,7 +120,6 @@ namespace mamba { return tl::unexpected(mamba_aggregated_error(std::move(error_list))); } - } if (ctx.offline) diff --git a/libmamba/src/core/download.cpp b/libmamba/src/core/download.cpp index 7a3058a91e..0ea31aba6c 100644 --- a/libmamba/src/core/download.cpp +++ b/libmamba/src/core/download.cpp @@ -790,8 +790,12 @@ namespace mamba { } - MultiDownloadResult - download(MultiDownloadRequest requests, const Context& context, DownloadOptions options, DownloadMonitor* monitor) + MultiDownloadResult download( + MultiDownloadRequest requests, + const Context& context, + DownloadOptions options, + DownloadMonitor* monitor + ) { if (!context.remote_fetch_params.curl_initialized) { diff --git a/libmamba/src/core/download_progress_bar.cpp b/libmamba/src/core/download_progress_bar.cpp index 5df58b7376..5dec212e9e 100644 --- a/libmamba/src/core/download_progress_bar.cpp +++ b/libmamba/src/core/download_progress_bar.cpp @@ -8,7 +8,7 @@ namespace mamba : m_options(std::move(options)) { } - + void DownloadProgressBar::reset_options(MonitorOptions options) { m_options = std::move(options); @@ -43,7 +43,7 @@ namespace mamba { pbar_manager.watch_print(); } - + options.on_unexpected_termination = [this]() { on_unexpected_termination(); }; } diff --git a/libmamba/src/core/subdirdata.cpp b/libmamba/src/core/subdirdata.cpp index c9b95322b0..5749e747fa 100644 --- a/libmamba/src/core/subdirdata.cpp +++ b/libmamba/src/core/subdirdata.cpp @@ -473,7 +473,7 @@ namespace mamba } } download(std::move(check_requests), context, {}, check_monitor); - + if (is_sig_interrupted()) { return make_unexpected("Interrupted by user", mamba_error_code::user_interrupted); diff --git a/libmambapy/libmambapy/__init__.pyi b/libmambapy/libmambapy/__init__.pyi index f15f57224d..8c25c81089 100644 --- a/libmambapy/libmambapy/__init__.pyi +++ b/libmambapy/libmambapy/__init__.pyi @@ -1,5 +1,4 @@ from __future__ import annotations -import libmambapy.bindings import typing __all__ = [ @@ -112,6 +111,8 @@ __all__ = [ "SpecBase", "SpecImpl", "SubdirData", + "SubdirIndex", + "SubdirIndexEntry", "TimeRef", "Transaction", "cache_fn_url", @@ -125,58 +126,33 @@ __all__ = [ "ostream_redirect", "sign", "simplify_conflicts", - "transmute" + "transmute", ] - -class Channel(): +class Channel: def __init__(self, arg0: str) -> None: ... def __repr__(self) -> str: ... def platform_url(self, platform: str, with_credentials: bool = True) -> str: ... - def platform_urls(self, with_credentials: bool = True) -> typing.List[typing.Tuple[str, str]]: ... - def urls(self, with_credentials: bool = True) -> typing.List[str]: ... + def platform_urls(self, with_credentials: bool = True) -> list[tuple[str, str]]: ... + def urls(self, with_credentials: bool = True) -> list[str]: ... @property - def auth(self) -> typing.Optional[str]: - """ - :type: typing.Optional[str] - """ + def auth(self) -> str | None: ... @property - def canonical_name(self) -> str: - """ - :type: str - """ + def canonical_name(self) -> str: ... @property - def location(self) -> str: - """ - :type: str - """ + def location(self) -> str: ... @property - def name(self) -> str: - """ - :type: str - """ + def name(self) -> str: ... @property - def package_filename(self) -> typing.Optional[str]: - """ - :type: typing.Optional[str] - """ + def package_filename(self) -> str | None: ... @property - def platforms(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ + def platforms(self) -> list[str]: ... @property - def scheme(self) -> str: - """ - :type: str - """ + def scheme(self) -> str: ... @property - def token(self) -> typing.Optional[str]: - """ - :type: typing.Optional[str] - """ - pass -class ChannelPriority(): + def token(self) -> str | None: ... + +class ChannelPriority: """ Members: @@ -186,32 +162,30 @@ class ChannelPriority(): Disabled """ - def __eq__(self, other: object) -> bool: ... + + Disabled: typing.ClassVar[ChannelPriority] # value = + Flexible: typing.ClassVar[ChannelPriority] # value = + Strict: typing.ClassVar[ChannelPriority] # value = + __members__: typing.ClassVar[ + dict[str, ChannelPriority] + ] # value = {'Flexible': , 'Strict': , 'Disabled': } + def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: int) -> None: ... def __int__(self) -> int: ... - def __ne__(self, other: object) -> bool: ... + def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... @property - def name(self) -> str: - """ - :type: str - """ + def name(self) -> str: ... @property - def value(self) -> int: - """ - :type: int - """ - Disabled: libmambapy.bindings.ChannelPriority # value = - Flexible: libmambapy.bindings.ChannelPriority # value = - Strict: libmambapy.bindings.ChannelPriority # value = - __members__: dict # value = {'Flexible': , 'Strict': , 'Disabled': } - pass -class CompressedProblemsGraph(): - class ConflictMap(): + def value(self) -> int: ... + +class CompressedProblemsGraph: + class ConflictMap: def __bool__(self) -> bool: ... def __contains__(self, arg0: int) -> bool: ... def __init__(self) -> None: ... @@ -219,610 +193,256 @@ class CompressedProblemsGraph(): def __len__(self) -> int: ... def add(self, arg0: int, arg1: int) -> bool: ... def clear(self) -> None: ... - def conflicts(self, arg0: int) -> typing.Set[int]: ... + def conflicts(self, arg0: int) -> set[int]: ... def has_conflict(self, arg0: int) -> bool: ... def in_conflict(self, arg0: int, arg1: int) -> bool: ... - pass - class ConstraintListNode(): + + class ConstraintListNode: def __bool__(self) -> bool: ... def __init__(self) -> None: ... def __iter__(self) -> typing.Iterator: ... def __len__(self) -> int: ... def add(self, arg0: ProblemsGraph.ConstraintNode) -> None: ... - def build_strings_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... + def build_strings_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... def clear(self) -> None: ... def name(self) -> str: ... - def versions_and_build_strings_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... - def versions_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... - pass - class DependencyList(): + def versions_and_build_strings_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... + def versions_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... + + class DependencyList: def __bool__(self) -> bool: ... def __init__(self) -> None: ... def __iter__(self) -> typing.Iterator: ... def __len__(self) -> int: ... def add(self, arg0: MatchSpec) -> None: ... - def build_strings_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... + def build_strings_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... def clear(self) -> None: ... def name(self) -> str: ... - def versions_and_build_strings_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... - def versions_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... - pass - class PackageListNode(): + def versions_and_build_strings_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... + def versions_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... + + class PackageListNode: def __bool__(self) -> bool: ... def __init__(self) -> None: ... def __iter__(self) -> typing.Iterator: ... def __len__(self) -> int: ... def add(self, arg0: ProblemsGraph.PackageNode) -> None: ... - def build_strings_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... + def build_strings_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... def clear(self) -> None: ... def name(self) -> str: ... - def versions_and_build_strings_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... - def versions_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... - pass - class RootNode(): + def versions_and_build_strings_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... + def versions_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... + + class RootNode: def __init__(self) -> None: ... - pass - class UnresolvedDependencyListNode(): + + class UnresolvedDependencyListNode: def __bool__(self) -> bool: ... def __init__(self) -> None: ... def __iter__(self) -> typing.Iterator: ... def __len__(self) -> int: ... def add(self, arg0: ProblemsGraph.UnresolvedDependencyNode) -> None: ... - def build_strings_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... + def build_strings_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... def clear(self) -> None: ... def name(self) -> str: ... - def versions_and_build_strings_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... - def versions_trunc(self, sep: str = '|', etc: str = '...', threshold: int = 5, remove_duplicates: bool = True) -> typing.Tuple[str, int]: ... - pass - def conflicts(self) -> ProblemsGraph.ConflictMap: ... + def versions_and_build_strings_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... + def versions_trunc( + self, + sep: str = "|", + etc: str = "...", + threshold: int = 5, + remove_duplicates: bool = True, + ) -> tuple[str, int]: ... + @staticmethod @typing.overload - def from_problems_graph(arg0: ProblemsGraph, arg1: typing.Callable[[ProblemsGraph, int, int], bool]) -> CompressedProblemsGraph: ... + def from_problems_graph( + arg0: ProblemsGraph, + arg1: typing.Callable[[libmambapy.bindings.ProblemsGraph, int, int], bool], + ) -> CompressedProblemsGraph: ... @staticmethod @typing.overload def from_problems_graph(arg0: ProblemsGraph) -> CompressedProblemsGraph: ... - def graph(self) -> typing.Tuple[typing.Dict[int, typing.Union[ProblemsGraph.RootNode, CompressedProblemsGraph.PackageListNode, CompressedProblemsGraph.UnresolvedDependencyListNode, CompressedProblemsGraph.ConstraintListNode]], typing.Dict[typing.Tuple[int, int], CompressedProblemsGraph.DependencyList]]: ... + def conflicts(self) -> ProblemsGraph.ConflictMap: ... + def graph( + self, + ) -> tuple[ + dict[ + int, + ProblemsGraph.RootNode + | CompressedProblemsGraph.PackageListNode + | CompressedProblemsGraph.UnresolvedDependencyListNode + | CompressedProblemsGraph.ConstraintListNode, + ], + dict[tuple[int, int], CompressedProblemsGraph.DependencyList], + ]: ... def root_node(self) -> int: ... def tree_message(self) -> str: ... - pass -class Context(): - class OutputParams(): + +class Context: + class OutputParams: + json: bool + quiet: bool + verbosity: int def __init__(self) -> None: ... - @property - def json(self) -> bool: - """ - :type: bool - """ - @json.setter - def json(self, arg0: bool) -> None: - pass - @property - def quiet(self) -> bool: - """ - :type: bool - """ - @quiet.setter - def quiet(self, arg0: bool) -> None: - pass - @property - def verbosity(self) -> int: - """ - :type: int - """ - @verbosity.setter - def verbosity(self, arg0: int) -> None: - pass - pass - class PrefixParams(): + + class PrefixParams: + conda_prefix: Path + root_prefix: Path + target_prefix: Path def __init__(self) -> None: ... - @property - def conda_prefix(self) -> Path: - """ - :type: Path - """ - @conda_prefix.setter - def conda_prefix(self, arg0: Path) -> None: - pass - @property - def root_prefix(self) -> Path: - """ - :type: Path - """ - @root_prefix.setter - def root_prefix(self, arg0: Path) -> None: - pass - @property - def target_prefix(self) -> Path: - """ - :type: Path - """ - @target_prefix.setter - def target_prefix(self, arg0: Path) -> None: - pass - pass - class RemoteFetchParams(): + + class RemoteFetchParams: + connect_timeout_secs: int + max_retries: int + proxy_servers: dict[str, str] + retry_backoff: int + retry_timeout: int + ssl_verify: str + user_agent: str def __init__(self) -> None: ... - @property - def connect_timeout_secs(self) -> int: - """ - :type: int - """ - @connect_timeout_secs.setter - def connect_timeout_secs(self, arg0: int) -> None: - pass - @property - def max_retries(self) -> int: - """ - :type: int - """ - @max_retries.setter - def max_retries(self, arg0: int) -> None: - pass - @property - def proxy_servers(self) -> typing.Dict[str, str]: - """ - :type: typing.Dict[str, str] - """ - @proxy_servers.setter - def proxy_servers(self, arg0: typing.Dict[str, str]) -> None: - pass - @property - def retry_backoff(self) -> int: - """ - :type: int - """ - @retry_backoff.setter - def retry_backoff(self, arg0: int) -> None: - pass - @property - def retry_timeout(self) -> int: - """ - :type: int - """ - @retry_timeout.setter - def retry_timeout(self, arg0: int) -> None: - pass - @property - def ssl_verify(self) -> str: - """ - :type: str - """ - @ssl_verify.setter - def ssl_verify(self, arg0: str) -> None: - pass - @property - def user_agent(self) -> str: - """ - :type: str - """ - @user_agent.setter - def user_agent(self, arg0: str) -> None: - pass - pass - class ThreadsParams(): + + class ThreadsParams: + download_threads: int + extract_threads: int def __init__(self) -> None: ... - @property - def download_threads(self) -> int: - """ - :type: int - """ - @download_threads.setter - def download_threads(self, arg0: int) -> None: - pass - @property - def extract_threads(self) -> int: - """ - :type: int - """ - @extract_threads.setter - def extract_threads(self, arg0: int) -> None: - pass - pass + add_pip_as_python_dependency: bool + always_yes: bool + channel_alias: str + channel_priority: ChannelPriority + channels: list[str] + conda_prefix: Path + connect_timeout_secs: int + custom_channels: dict[str, str] + custom_multichannels: dict[str, list[str]] + default_channels: list[str] + download_only: bool + download_threads: int + dry_run: bool + envs_dirs: list[Path] + experimental_sat_error_message: bool + extract_threads: int + json: bool + local_repodata_ttl: int + max_retries: int + offline: bool + output_params: Context.OutputParams + pkgs_dirs: list[Path] + platform: str + prefix_params: Context.PrefixParams + proxy_servers: dict[str, str] + quiet: bool + remote_fetch_params: Context.RemoteFetchParams + retry_backoff: int + retry_timeout: int + root_prefix: Path + ssl_verify: str + target_prefix: Path + threads_params: Context.ThreadsParams + use_index_cache: bool + use_lockfiles: bool + use_only_tar_bz2: bool + user_agent: str + verbosity: int def __init__(self) -> None: ... def set_log_level(self, arg0: LogLevel) -> None: ... def set_verbosity(self, arg0: int) -> None: ... - @property - def add_pip_as_python_dependency(self) -> bool: - """ - :type: bool - """ - @add_pip_as_python_dependency.setter - def add_pip_as_python_dependency(self, arg0: bool) -> None: - pass - @property - def always_yes(self) -> bool: - """ - :type: bool - """ - @always_yes.setter - def always_yes(self, arg0: bool) -> None: - pass - @property - def channel_alias(self) -> str: - """ - :type: str - """ - @channel_alias.setter - def channel_alias(self, arg0: str) -> None: - pass - @property - def channel_priority(self) -> ChannelPriority: - """ - :type: ChannelPriority - """ - @channel_priority.setter - def channel_priority(self, arg0: ChannelPriority) -> None: - pass - @property - def channels(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ - @channels.setter - def channels(self, arg0: typing.List[str]) -> None: - pass - @property - def conda_prefix(self) -> Path: - """ - :type: Path - """ - @conda_prefix.setter - def conda_prefix(self, arg1: Path) -> None: - pass - @property - def connect_timeout_secs(self) -> int: - """ - :type: int - """ - @connect_timeout_secs.setter - def connect_timeout_secs(self, arg1: int) -> None: - pass - @property - def custom_channels(self) -> typing.Dict[str, str]: - """ - :type: typing.Dict[str, str] - """ - @custom_channels.setter - def custom_channels(self, arg0: typing.Dict[str, str]) -> None: - pass - @property - def custom_multichannels(self) -> typing.Dict[str, typing.List[str]]: - """ - :type: typing.Dict[str, typing.List[str]] - """ - @custom_multichannels.setter - def custom_multichannels(self, arg0: typing.Dict[str, typing.List[str]]) -> None: - pass - @property - def default_channels(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ - @default_channels.setter - def default_channels(self, arg0: typing.List[str]) -> None: - pass - @property - def download_only(self) -> bool: - """ - :type: bool - """ - @download_only.setter - def download_only(self, arg0: bool) -> None: - pass - @property - def download_threads(self) -> int: - """ - :type: int - """ - @download_threads.setter - def download_threads(self, arg1: int) -> None: - pass - @property - def dry_run(self) -> bool: - """ - :type: bool - """ - @dry_run.setter - def dry_run(self, arg0: bool) -> None: - pass - @property - def envs_dirs(self) -> typing.List[Path]: - """ - :type: typing.List[Path] - """ - @envs_dirs.setter - def envs_dirs(self, arg0: typing.List[Path]) -> None: - pass - @property - def experimental_sat_error_message(self) -> bool: - """ - :type: bool - """ - @experimental_sat_error_message.setter - def experimental_sat_error_message(self, arg1: bool) -> None: - pass - @property - def extract_threads(self) -> int: - """ - :type: int - """ - @extract_threads.setter - def extract_threads(self, arg1: int) -> None: - pass - @property - def json(self) -> bool: - """ - :type: bool - """ - @json.setter - def json(self, arg1: bool) -> None: - pass - @property - def local_repodata_ttl(self) -> int: - """ - :type: int - """ - @local_repodata_ttl.setter - def local_repodata_ttl(self, arg0: int) -> None: - pass - @property - def max_retries(self) -> int: - """ - :type: int - """ - @max_retries.setter - def max_retries(self, arg1: int) -> None: - pass - @property - def offline(self) -> bool: - """ - :type: bool - """ - @offline.setter - def offline(self, arg0: bool) -> None: - pass - @property - def output_params(self) -> Context.OutputParams: - """ - :type: Context.OutputParams - """ - @output_params.setter - def output_params(self, arg0: Context.OutputParams) -> None: - pass - @property - def pkgs_dirs(self) -> typing.List[Path]: - """ - :type: typing.List[Path] - """ - @pkgs_dirs.setter - def pkgs_dirs(self, arg0: typing.List[Path]) -> None: - pass - @property - def platform(self) -> str: - """ - :type: str - """ - @platform.setter - def platform(self, arg0: str) -> None: - pass - @property - def prefix_params(self) -> Context.PrefixParams: - """ - :type: Context.PrefixParams - """ - @prefix_params.setter - def prefix_params(self, arg0: Context.PrefixParams) -> None: - pass - @property - def proxy_servers(self) -> typing.Dict[str, str]: - """ - :type: typing.Dict[str, str] - """ - @proxy_servers.setter - def proxy_servers(self, arg1: typing.Dict[str, str]) -> None: - pass - @property - def quiet(self) -> bool: - """ - :type: bool - """ - @quiet.setter - def quiet(self, arg1: bool) -> None: - pass - @property - def remote_fetch_params(self) -> Context.RemoteFetchParams: - """ - :type: Context.RemoteFetchParams - """ - @remote_fetch_params.setter - def remote_fetch_params(self, arg0: Context.RemoteFetchParams) -> None: - pass - @property - def retry_backoff(self) -> int: - """ - :type: int - """ - @retry_backoff.setter - def retry_backoff(self, arg1: int) -> None: - pass - @property - def retry_timeout(self) -> int: - """ - :type: int - """ - @retry_timeout.setter - def retry_timeout(self, arg1: int) -> None: - pass - @property - def root_prefix(self) -> Path: - """ - :type: Path - """ - @root_prefix.setter - def root_prefix(self, arg1: Path) -> None: - pass - @property - def ssl_verify(self) -> str: - """ - :type: str - """ - @ssl_verify.setter - def ssl_verify(self, arg1: str) -> None: - pass - @property - def target_prefix(self) -> Path: - """ - :type: Path - """ - @target_prefix.setter - def target_prefix(self, arg1: Path) -> None: - pass - @property - def threads_params(self) -> Context.ThreadsParams: - """ - :type: Context.ThreadsParams - """ - @threads_params.setter - def threads_params(self, arg0: Context.ThreadsParams) -> None: - pass - @property - def use_index_cache(self) -> bool: - """ - :type: bool - """ - @use_index_cache.setter - def use_index_cache(self, arg0: bool) -> None: - pass - @property - def use_lockfiles(self) -> bool: - """ - :type: bool - """ - @use_lockfiles.setter - def use_lockfiles(self, arg1: bool) -> None: - pass - @property - def use_only_tar_bz2(self) -> bool: - """ - :type: bool - """ - @use_only_tar_bz2.setter - def use_only_tar_bz2(self, arg0: bool) -> None: - pass - @property - def user_agent(self) -> str: - """ - :type: str - """ - @user_agent.setter - def user_agent(self, arg1: str) -> None: - pass - @property - def verbosity(self) -> int: - """ - :type: int - """ - @verbosity.setter - def verbosity(self, arg1: int) -> None: - pass - pass -class DownloadTargetList(): + +class DownloadTargetList: def __init__(self) -> None: ... def download(self, arg0: int) -> bool: ... - pass -class ExtraPkgInfo(): + +class ExtraPkgInfo: + noarch: str + repo_url: str def __init__(self) -> None: ... - @property - def noarch(self) -> str: - """ - :type: str - """ - @noarch.setter - def noarch(self, arg0: str) -> None: - pass - @property - def repo_url(self) -> str: - """ - :type: str - """ - @repo_url.setter - def repo_url(self, arg0: str) -> None: - pass - pass -class History(): + +class History: def __init__(self, arg0: Path) -> None: ... - def get_requested_specs_map(self) -> typing.Dict[str, MatchSpec]: ... - pass -class Key(): + def get_requested_specs_map(self) -> dict[str, MatchSpec]: ... + +class Key: + keytype: str + keyval: str + scheme: str @staticmethod def from_ed25519(arg0: str) -> Key: ... @property - def json_str(self) -> str: - """ - :type: str - """ - @property - def keytype(self) -> str: - """ - :type: str - """ - @keytype.setter - def keytype(self, arg0: str) -> None: - pass - @property - def keyval(self) -> str: - """ - :type: str - """ - @keyval.setter - def keyval(self, arg0: str) -> None: - pass - @property - def scheme(self) -> str: - """ - :type: str - """ - @scheme.setter - def scheme(self, arg0: str) -> None: - pass - pass -class RoleBase(): - def all_keys(self) -> typing.Dict[str, RoleFullKeys]: ... - @property - def expired(self) -> bool: - """ - :type: bool - """ - @property - def expires(self) -> str: - """ - :type: str - """ - @property - def file_ext(self) -> str: - """ - :type: str - """ - @property - def spec_version(self) -> SpecBase: - """ - :type: SpecBase - """ - @property - def type(self) -> str: - """ - :type: str - """ - @property - def version(self) -> int: - """ - :type: int - """ - pass -class LockFile(): + def json_str(self) -> str: ... + +class KeyMgr(RoleBase, RoleBaseExtension): + def __init__(self, arg0: str, arg1: RoleFullKeys, arg2: SpecBase) -> None: ... + +class LockFile: def __init__(self, arg0: Path) -> None: ... - pass -class LogLevel(): + +class LogLevel: """ Members: @@ -840,266 +460,148 @@ class LogLevel(): OFF """ - def __eq__(self, other: object) -> bool: ... + + CRITICAL: typing.ClassVar[LogLevel] # value = + DEBUG: typing.ClassVar[LogLevel] # value = + ERROR: typing.ClassVar[LogLevel] # value = + INFO: typing.ClassVar[LogLevel] # value = + OFF: typing.ClassVar[LogLevel] # value = + TRACE: typing.ClassVar[LogLevel] # value = + WARNING: typing.ClassVar[LogLevel] # value = + __members__: typing.ClassVar[ + dict[str, LogLevel] + ] # value = {'TRACE': , 'DEBUG': , 'INFO': , 'WARNING': , 'ERROR': , 'CRITICAL': , 'OFF': } + def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: int) -> None: ... def __int__(self) -> int: ... - def __ne__(self, other: object) -> bool: ... + def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... @property - def name(self) -> str: - """ - :type: str - """ + def name(self) -> str: ... @property - def value(self) -> int: - """ - :type: int - """ - CRITICAL: libmambapy.bindings.LogLevel # value = - DEBUG: libmambapy.bindings.LogLevel # value = - ERROR: libmambapy.bindings.LogLevel # value = - INFO: libmambapy.bindings.LogLevel # value = - OFF: libmambapy.bindings.LogLevel # value = - TRACE: libmambapy.bindings.LogLevel # value = - WARNING: libmambapy.bindings.LogLevel # value = - __members__: dict # value = {'TRACE': , 'DEBUG': , 'INFO': , 'WARNING': , 'ERROR': , 'CRITICAL': , 'OFF': } - pass -class MambaNativeException(Exception, BaseException): + def value(self) -> int: ... + +class MambaNativeException(Exception): pass -class MatchSpec(): + +class MatchSpec: @typing.overload def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: str) -> None: ... def conda_build_form(self) -> str: ... - pass -class MultiPackageCache(): - def __init__(self, arg0: typing.List[Path]) -> None: ... + +class MultiPackageCache: + def __init__(self, arg0: list[Path]) -> None: ... def get_tarball_path(self, arg0: PackageInfo, arg1: bool) -> Path: ... @property - def first_writable_path(self) -> Path: - """ - :type: Path - """ - pass -class PackageInfo(): + def first_writable_path(self) -> Path: ... + +class PackageInfo: + build_number: int + build_string: str + channel: str + constrains: list[str] + defaulted_keys: set[str] + depends: list[str] + fn: str + license: str + md5: str + name: str + noarch: str + sha256: str + signatures: str + size: int + subdir: str + timestamp: int + track_features: str + url: str + version: str @typing.overload def __init__(self, name: str) -> None: ... @typing.overload - def __init__(self, name: str, version: str, build_string: str, build_number: int) -> None: ... - @property - def build_number(self) -> int: - """ - :type: int - """ - @build_number.setter - def build_number(self, arg0: int) -> None: - pass - @property - def build_string(self) -> str: - """ - :type: str - """ - @build_string.setter - def build_string(self, arg0: str) -> None: - pass - @property - def channel(self) -> str: - """ - :type: str - """ - @channel.setter - def channel(self, arg0: str) -> None: - pass - @property - def constrains(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ - @constrains.setter - def constrains(self, arg0: typing.List[str]) -> None: - pass - @property - def defaulted_keys(self) -> typing.Set[str]: - """ - :type: typing.Set[str] - """ - @defaulted_keys.setter - def defaulted_keys(self, arg0: typing.Set[str]) -> None: - pass - @property - def depends(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ - @depends.setter - def depends(self, arg0: typing.List[str]) -> None: - pass - @property - def fn(self) -> str: - """ - :type: str - """ - @fn.setter - def fn(self, arg0: str) -> None: - pass - @property - def license(self) -> str: - """ - :type: str - """ - @license.setter - def license(self, arg0: str) -> None: - pass - @property - def md5(self) -> str: - """ - :type: str - """ - @md5.setter - def md5(self, arg0: str) -> None: - pass - @property - def name(self) -> str: - """ - :type: str - """ - @name.setter - def name(self, arg0: str) -> None: - pass - @property - def noarch(self) -> str: - """ - :type: str - """ - @noarch.setter - def noarch(self, arg0: str) -> None: - pass - @property - def sha256(self) -> str: - """ - :type: str - """ - @sha256.setter - def sha256(self, arg0: str) -> None: - pass - @property - def signatures(self) -> str: - """ - :type: str - """ - @signatures.setter - def signatures(self, arg0: str) -> None: - pass - @property - def size(self) -> int: - """ - :type: int - """ - @size.setter - def size(self, arg0: int) -> None: - pass - @property - def subdir(self) -> str: - """ - :type: str - """ - @subdir.setter - def subdir(self, arg0: str) -> None: - pass - @property - def timestamp(self) -> int: - """ - :type: int - """ - @timestamp.setter - def timestamp(self, arg0: int) -> None: - pass - @property - def track_features(self) -> str: - """ - :type: str - """ - @track_features.setter - def track_features(self, arg1: str) -> None: - pass - @property - def url(self) -> str: - """ - :type: str - """ - @url.setter - def url(self, arg0: str) -> None: - pass - @property - def version(self) -> str: - """ - :type: str - """ - @version.setter - def version(self, arg0: str) -> None: - pass - pass -class Path(): + def __init__( + self, name: str, version: str, build_string: str, build_number: int + ) -> None: ... + +class Path: def __init__(self, arg0: str) -> None: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... - pass -class RoleBaseExtension(): - @property - def timestamp(self) -> str: - """ - :type: str - """ - pass -class Pool(): + +class PkgMgr(RoleBase, RoleBaseExtension): + def __init__(self, arg0: str, arg1: RoleFullKeys, arg2: SpecBase) -> None: ... + +class Pool: def __init__(self) -> None: ... def create_whatprovides(self) -> None: ... - def id2pkginfo(self, id: int) -> typing.Optional[PackageInfo]: ... + def id2pkginfo(self, id: int) -> PackageInfo | None: ... @typing.overload def matchspec2id(self, ms: MatchSpec) -> int: ... @typing.overload def matchspec2id(self, ms: str) -> int: ... - def select_solvables(self, id: int, sorted: bool = False) -> typing.List[int]: ... + def select_solvables(self, id: int, sorted: bool = False) -> list[int]: ... def set_debuglevel(self) -> None: ... - pass -class PrefixData(): + +class PrefixData: def __init__(self, arg0: Path) -> None: ... - def add_packages(self, arg0: typing.List[PackageInfo]) -> None: ... + def add_packages(self, arg0: list[PackageInfo]) -> None: ... @property - def package_records(self) -> typing.Dict[str, PackageInfo]: - """ - :type: typing.Dict[str, PackageInfo] - """ - pass -class ProblemsGraph(): - class ConflictMap(): - pass + def package_records(self) -> dict[str, PackageInfo]: ... + +class ProblemsGraph: + class ConflictMap: + def __bool__(self) -> bool: ... + def __contains__(self, arg0: int) -> bool: ... + def __init__(self) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def add(self, arg0: int, arg1: int) -> bool: ... + def clear(self) -> None: ... + def conflicts(self, arg0: int) -> set[int]: ... + def has_conflict(self, arg0: int) -> bool: ... + def in_conflict(self, arg0: int, arg1: int) -> bool: ... + class ConstraintNode(MatchSpec): pass + class PackageNode(PackageInfo): pass - class RootNode(): - pass + + class RootNode: + def __init__(self) -> None: ... + class UnresolvedDependencyNode(MatchSpec): pass - def conflicts(self) -> ProblemsGraph.ConflictMap: ... @staticmethod def from_solver(arg0: Solver, arg1: Pool) -> ProblemsGraph: ... - def graph(self) -> typing.Tuple[typing.Dict[int, typing.Union[ProblemsGraph.RootNode, ProblemsGraph.PackageNode, ProblemsGraph.UnresolvedDependencyNode, ProblemsGraph.ConstraintNode]], typing.Dict[typing.Tuple[int, int], MatchSpec]]: ... + def conflicts(self) -> ProblemsGraph.ConflictMap: ... + def graph( + self, + ) -> tuple[ + dict[ + int, + ProblemsGraph.RootNode + | ProblemsGraph.PackageNode + | ProblemsGraph.UnresolvedDependencyNode + | ProblemsGraph.ConstraintNode, + ], + dict[tuple[int, int], MatchSpec], + ]: ... def root_node(self) -> int: ... - pass -class Query(): + +class Query: def __init__(self, arg0: Pool) -> None: ... def depends(self, arg0: str, arg1: QueryFormat) -> str: ... def find(self, arg0: str, arg1: QueryFormat) -> str: ... def whoneeds(self, arg0: str, arg1: QueryFormat) -> str: ... - pass -class QueryFormat(): + +class QueryFormat: """ Members: @@ -1113,165 +615,109 @@ class QueryFormat(): RECURSIVETABLE """ - def __eq__(self, other: object) -> bool: ... + + JSON: typing.ClassVar[QueryFormat] # value = + PRETTY: typing.ClassVar[QueryFormat] # value = + RECURSIVETABLE: typing.ClassVar[ + QueryFormat + ] # value = + TABLE: typing.ClassVar[QueryFormat] # value = + TREE: typing.ClassVar[QueryFormat] # value = + __members__: typing.ClassVar[ + dict[str, QueryFormat] + ] # value = {'JSON': , 'TREE': , 'TABLE': , 'PRETTY': , 'RECURSIVETABLE': } + def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: int) -> None: ... def __int__(self) -> int: ... - def __ne__(self, other: object) -> bool: ... + def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... @property - def name(self) -> str: - """ - :type: str - """ + def name(self) -> str: ... @property - def value(self) -> int: - """ - :type: int - """ - JSON: libmambapy.bindings.QueryFormat # value = - PRETTY: libmambapy.bindings.QueryFormat # value = - RECURSIVETABLE: libmambapy.bindings.QueryFormat # value = - TABLE: libmambapy.bindings.QueryFormat # value = - TREE: libmambapy.bindings.QueryFormat # value = - __members__: dict # value = {'JSON': , 'TREE': , 'TABLE': , 'PRETTY': , 'RECURSIVETABLE': } - pass -class Repo(): + def value(self) -> int: ... + +class Repo: @typing.overload def __init__(self, arg0: Pool, arg1: str, arg2: str, arg3: str) -> None: ... @typing.overload def __init__(self, arg0: Pool, arg1: PrefixData) -> None: ... - def add_extra_pkg_info(self, arg0: typing.Dict[str, ExtraPkgInfo]) -> None: ... + def add_extra_pkg_info(self, arg0: dict[str, ExtraPkgInfo]) -> None: ... def clear(self, arg0: bool) -> bool: ... def name(self) -> str: ... - def priority(self) -> typing.Tuple[int, int]: ... + def priority(self) -> tuple[int, int]: ... def set_installed(self) -> None: ... def set_priority(self, arg0: int, arg1: int) -> None: ... def size(self) -> int: ... - pass -class KeyMgr(RoleBase, RoleBaseExtension): - def __init__(self, arg0: str, arg1: RoleFullKeys, arg2: SpecBase) -> None: ... - pass -class PkgMgr(RoleBase, RoleBaseExtension): - def __init__(self, arg0: str, arg1: RoleFullKeys, arg2: SpecBase) -> None: ... - pass -class RoleFullKeys(): + +class RoleBase: + def all_keys(self) -> dict[str, RoleFullKeys]: ... + @property + def expired(self, arg1: TimeRef) -> bool: ... + @property + def expires(self) -> str: ... + @property + def file_ext(self) -> str: ... + @property + def spec_version(self) -> SpecBase: ... + @property + def type(self) -> str: ... + @property + def version(self) -> int: ... + +class RoleBaseExtension: + @property + def timestamp(self) -> str: ... + +class RoleFullKeys: + keys: dict[str, Key] + threshold: int @typing.overload def __init__(self) -> None: ... @typing.overload - def __init__(self, keys: typing.Dict[str, Key], threshold: int) -> None: ... - @property - def keys(self) -> typing.Dict[str, Key]: - """ - :type: typing.Dict[str, Key] - """ - @keys.setter - def keys(self, arg0: typing.Dict[str, Key]) -> None: - pass - @property - def threshold(self) -> int: - """ - :type: int - """ - @threshold.setter - def threshold(self, arg0: int) -> None: - pass - pass + def __init__(self, keys: dict[str, Key], threshold: int) -> None: ... + class RootImpl(RoleBase, RoleBaseExtension): def __init__(self, json_str: str) -> None: ... def create_key_mgr(self, json_str: str) -> KeyMgr: ... def update(self, json_str: str) -> RootRole: ... + +class RootRole: pass -class RootRole(): - pass -class Solver(): - def __init__(self, arg0: Pool, arg1: typing.List[typing.Tuple[int, int]]) -> None: ... + +class Solver: + def __init__(self, arg0: Pool, arg1: list[tuple[int, int]]) -> None: ... def add_constraint(self, arg0: str) -> None: ... def add_global_job(self, arg0: int) -> None: ... - def add_jobs(self, arg0: typing.List[str], arg1: int) -> None: ... + def add_jobs(self, arg0: list[str], arg1: int) -> None: ... def add_pin(self, arg0: str) -> None: ... - def all_problems_structured(self) -> typing.List[SolverProblem]: ... + def all_problems_structured(self) -> list[SolverProblem]: ... def all_problems_to_str(self) -> str: ... def explain_problems(self) -> str: ... def is_solved(self) -> bool: ... def must_solve(self) -> None: ... def problems_to_str(self) -> str: ... - def set_flags(self, arg0: typing.List[typing.Tuple[int, int]]) -> None: ... - def set_postsolve_flags(self, arg0: typing.List[typing.Tuple[int, int]]) -> None: ... + def set_flags(self, arg0: list[tuple[int, int]]) -> None: ... + def set_postsolve_flags(self, arg0: list[tuple[int, int]]) -> None: ... def solve(self) -> bool: ... def try_solve(self) -> bool: ... - pass -class SolverProblem(): + +class SolverProblem: + dep: str | None + dep_id: int + description: str + source: PackageInfo | None + source_id: int + target: PackageInfo | None + target_id: int + type: SolverRuleinfo def __str__(self) -> str: ... - @property - def dep(self) -> typing.Optional[str]: - """ - :type: typing.Optional[str] - """ - @dep.setter - def dep(self, arg0: typing.Optional[str]) -> None: - pass - @property - def dep_id(self) -> int: - """ - :type: int - """ - @dep_id.setter - def dep_id(self, arg0: int) -> None: - pass - @property - def description(self) -> str: - """ - :type: str - """ - @description.setter - def description(self, arg0: str) -> None: - pass - @property - def source(self) -> typing.Optional[PackageInfo]: - """ - :type: typing.Optional[PackageInfo] - """ - @source.setter - def source(self, arg0: typing.Optional[PackageInfo]) -> None: - pass - @property - def source_id(self) -> int: - """ - :type: int - """ - @source_id.setter - def source_id(self, arg0: int) -> None: - pass - @property - def target(self) -> typing.Optional[PackageInfo]: - """ - :type: typing.Optional[PackageInfo] - """ - @target.setter - def target(self, arg0: typing.Optional[PackageInfo]) -> None: - pass - @property - def target_id(self) -> int: - """ - :type: int - """ - @target_id.setter - def target_id(self, arg0: int) -> None: - pass - @property - def type(self) -> SolverRuleinfo: - """ - :type: SolverRuleinfo - """ - @type.setter - def type(self, arg0: SolverRuleinfo) -> None: - pass - pass -class SolverRuleinfo(): + +class SolverRuleinfo: """ Members: @@ -1333,69 +779,151 @@ class SolverRuleinfo(): SOLVER_RULE_STRICT_REPO_PRIORITY """ - def __eq__(self, other: object) -> bool: ... + + SOLVER_RULE_BEST: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_BLACK: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_CHOICE: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_DISTUPGRADE: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_FEATURE: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_INFARCH: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_JOB: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_JOB_UNKNOWN_PACKAGE: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_JOB_UNSUPPORTED: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_LEARNT: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_CONFLICTS: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_CONSTRAINS: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_INSTALLED_OBSOLETES: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_NOT_INSTALLABLE: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_OBSOLETES: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_RECOMMENDS: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_REQUIRES: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_SAME_NAME: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_PKG_SELF_CONFLICT: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_RECOMMENDS: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_STRICT_REPO_PRIORITY: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_UNKNOWN: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_UPDATE: typing.ClassVar[ + SolverRuleinfo + ] # value = + SOLVER_RULE_YUMOBS: typing.ClassVar[ + SolverRuleinfo + ] # value = + __members__: typing.ClassVar[ + dict[str, SolverRuleinfo] + ] # value = {'SOLVER_RULE_UNKNOWN': , 'SOLVER_RULE_PKG': , 'SOLVER_RULE_PKG_NOT_INSTALLABLE': , 'SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP': , 'SOLVER_RULE_PKG_REQUIRES': , 'SOLVER_RULE_PKG_SELF_CONFLICT': , 'SOLVER_RULE_PKG_CONFLICTS': , 'SOLVER_RULE_PKG_SAME_NAME': , 'SOLVER_RULE_PKG_OBSOLETES': , 'SOLVER_RULE_PKG_IMPLICIT_OBSOLETES': , 'SOLVER_RULE_PKG_INSTALLED_OBSOLETES': , 'SOLVER_RULE_PKG_RECOMMENDS': , 'SOLVER_RULE_PKG_CONSTRAINS': , 'SOLVER_RULE_UPDATE': , 'SOLVER_RULE_FEATURE': , 'SOLVER_RULE_JOB': , 'SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP': , 'SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM': , 'SOLVER_RULE_JOB_UNKNOWN_PACKAGE': , 'SOLVER_RULE_JOB_UNSUPPORTED': , 'SOLVER_RULE_DISTUPGRADE': , 'SOLVER_RULE_INFARCH': , 'SOLVER_RULE_CHOICE': , 'SOLVER_RULE_LEARNT': , 'SOLVER_RULE_BEST': , 'SOLVER_RULE_YUMOBS': , 'SOLVER_RULE_RECOMMENDS': , 'SOLVER_RULE_BLACK': , 'SOLVER_RULE_STRICT_REPO_PRIORITY': } + def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: int) -> None: ... def __int__(self) -> int: ... - def __ne__(self, other: object) -> bool: ... + def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... @property - def name(self) -> str: - """ - :type: str - """ + def name(self) -> str: ... @property - def value(self) -> int: - """ - :type: int - """ - SOLVER_RULE_BEST: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_BLACK: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_CHOICE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_DISTUPGRADE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_FEATURE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_INFARCH: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB_UNKNOWN_PACKAGE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB_UNSUPPORTED: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_LEARNT: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_CONFLICTS: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_CONSTRAINS: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_INSTALLED_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_NOT_INSTALLABLE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_RECOMMENDS: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_REQUIRES: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_SAME_NAME: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_SELF_CONFLICT: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_RECOMMENDS: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_STRICT_REPO_PRIORITY: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_UNKNOWN: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_UPDATE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_YUMOBS: libmambapy.bindings.SolverRuleinfo # value = - __members__: dict # value = {'SOLVER_RULE_UNKNOWN': , 'SOLVER_RULE_PKG': , 'SOLVER_RULE_PKG_NOT_INSTALLABLE': , 'SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP': , 'SOLVER_RULE_PKG_REQUIRES': , 'SOLVER_RULE_PKG_SELF_CONFLICT': , 'SOLVER_RULE_PKG_CONFLICTS': , 'SOLVER_RULE_PKG_SAME_NAME': , 'SOLVER_RULE_PKG_OBSOLETES': , 'SOLVER_RULE_PKG_IMPLICIT_OBSOLETES': , 'SOLVER_RULE_PKG_INSTALLED_OBSOLETES': , 'SOLVER_RULE_PKG_RECOMMENDS': , 'SOLVER_RULE_PKG_CONSTRAINS': , 'SOLVER_RULE_UPDATE': , 'SOLVER_RULE_FEATURE': , 'SOLVER_RULE_JOB': , 'SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP': , 'SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM': , 'SOLVER_RULE_JOB_UNKNOWN_PACKAGE': , 'SOLVER_RULE_JOB_UNSUPPORTED': , 'SOLVER_RULE_DISTUPGRADE': , 'SOLVER_RULE_INFARCH': , 'SOLVER_RULE_CHOICE': , 'SOLVER_RULE_LEARNT': , 'SOLVER_RULE_BEST': , 'SOLVER_RULE_YUMOBS': , 'SOLVER_RULE_RECOMMENDS': , 'SOLVER_RULE_BLACK': , 'SOLVER_RULE_STRICT_REPO_PRIORITY': } - pass -class SpecBase(): + def value(self) -> int: ... + +class SpecBase: pass + class SpecImpl(SpecBase): def __init__(self) -> None: ... - pass -class SubdirData(): - def __init__(self, arg0: Channel, arg1: str, arg2: str, arg3: MultiPackageCache, arg4: str) -> None: ... + +class SubdirData: def cache_path(self) -> str: ... def create_repo(self, arg0: Pool) -> Repo: ... - def download_and_check_targets(self, arg0: DownloadTargetList) -> bool: ... def loaded(self) -> bool: ... - pass -class TimeRef(): + +class SubdirIndex: + def __getitem__(self, arg0: int) -> SubdirIndexEntry: ... + def __init__(self) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def create( + self, + arg0: Channel, + arg1: str, + arg2: str, + arg3: MultiPackageCache, + arg4: str, + arg5: str, + ) -> None: ... + def download(self) -> bool: ... + +class SubdirIndexEntry: + def __init__(self) -> None: ... + @property + def channel(self) -> Channel: ... + @property + def platform(self) -> str: ... + @property + def subdir(self) -> SubdirData: ... + @property + def url(self) -> str: ... + +class TimeRef: @typing.overload def __init__(self) -> None: ... @typing.overload @@ -1403,119 +931,118 @@ class TimeRef(): def set(self, arg0: int) -> None: ... def set_now(self) -> None: ... def timestamp(self) -> str: ... - pass -class Transaction(): + +class Transaction: @typing.overload def __init__(self, arg0: Solver, arg1: MultiPackageCache) -> None: ... @typing.overload def __init__(self, arg0: Pool, arg1: Solver, arg2: MultiPackageCache) -> None: ... def execute(self, arg0: PrefixData) -> bool: ... def fetch_extract_packages(self) -> bool: ... - def find_python_version(self) -> typing.Tuple[str, str]: ... + def find_python_version(self) -> tuple[str, str]: ... def log_json(self) -> None: ... def print(self) -> None: ... def prompt(self) -> bool: ... - def to_conda(self) -> typing.Tuple[typing.Tuple[typing.List[str], typing.List[str]], typing.List[typing.Tuple[str, str, str]], typing.List[typing.Tuple[str, str]]]: ... - pass -class ostream_redirect(): + def to_conda( + self, + ) -> tuple[ + tuple[list[str], list[str]], list[tuple[str, str, str]], list[tuple[str, str]] + ]: ... + +class ostream_redirect: def __enter__(self) -> None: ... def __exit__(self, *args) -> None: ... def __init__(self, stdout: bool = True, stderr: bool = True) -> None: ... - pass -def cache_fn_url(arg0: str) -> str: - pass -def cancel_json_output() -> None: - pass -def clean(arg0: int) -> None: - pass -def create_cache_dir(arg0: Path) -> str: - pass -def generate_ed25519_keypair() -> typing.Tuple[str, str]: - pass -def get_channels(arg0: typing.List[str]) -> typing.List[Channel]: - pass -def get_virtual_packages() -> typing.List[PackageInfo]: - pass -def init_console() -> None: - pass -def sign(data: str, secret_key: str) -> str: - pass -def simplify_conflicts(arg0: ProblemsGraph) -> ProblemsGraph: - pass -def transmute(source_package: Path, destination_package: Path, compression_level: int, compression_threads: int = 1) -> bool: - pass -MAMBA_CLEAN_ALL = 1 -MAMBA_CLEAN_INDEX = 2 -MAMBA_CLEAN_LOCKS = 16 -MAMBA_CLEAN_PKGS = 4 -MAMBA_CLEAN_TARBALLS = 8 -MAMBA_DOWNLOAD_FAILFAST = 1 -MAMBA_DOWNLOAD_SORT = 2 -MAMBA_FORCE_REINSTALL = 4 -MAMBA_NO_DEPS = 1 -MAMBA_ONLY_DEPS = 2 -SOLVER_ALLOWUNINSTALL = 2816 -SOLVER_CLEANDEPS = 262144 -SOLVER_DISFAVOR = 3328 -SOLVER_DISTUPGRADE = 1792 -SOLVER_DROP_ORPHANED = 2304 -SOLVER_ERASE = 512 -SOLVER_ESSENTIAL = 131072 -SOLVER_FAVOR = 3072 -SOLVER_FLAG_ADD_ALREADY_RECOMMENDED = 8 -SOLVER_FLAG_ALLOW_ARCHCHANGE = 2 -SOLVER_FLAG_ALLOW_DOWNGRADE = 1 -SOLVER_FLAG_ALLOW_NAMECHANGE = 10 -SOLVER_FLAG_ALLOW_UNINSTALL = 4 -SOLVER_FLAG_ALLOW_VENDORCHANGE = 3 -SOLVER_FLAG_BEST_OBEY_POLICY = 12 -SOLVER_FLAG_BREAK_ORPHANS = 19 -SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE = 15 -SOLVER_FLAG_DUP_ALLOW_DOWNGRADE = 14 -SOLVER_FLAG_DUP_ALLOW_NAMECHANGE = 17 -SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE = 16 -SOLVER_FLAG_FOCUS_BEST = 24 -SOLVER_FLAG_FOCUS_INSTALLED = 20 -SOLVER_FLAG_IGNORE_RECOMMENDED = 7 -SOLVER_FLAG_INSTALL_ALSO_UPDATES = 26 -SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES = 11 -SOLVER_FLAG_KEEP_ORPHANS = 18 -SOLVER_FLAG_NEED_UPDATEPROVIDE = 22 -SOLVER_FLAG_NO_AUTOTARGET = 13 -SOLVER_FLAG_NO_INFARCHCHECK = 9 -SOLVER_FLAG_NO_UPDATEPROVIDE = 5 -SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED = 27 -SOLVER_FLAG_SPLITPROVIDES = 6 -SOLVER_FLAG_STRICT_REPO_PRIORITY = 28 -SOLVER_FLAG_STRONG_RECOMMENDS = 25 -SOLVER_FLAG_URPM_REORDER = 23 -SOLVER_FLAG_YUM_OBSOLETES = 21 -SOLVER_FORCEBEST = 1048576 -SOLVER_INSTALL = 256 -SOLVER_JOBMASK = 65280 -SOLVER_LOCK = 1536 -SOLVER_MULTIVERSION = 1280 -SOLVER_NOAUTOSET = 536870912 -SOLVER_NOOP = 0 -SOLVER_NOTBYUSER = 4194304 -SOLVER_ORUPDATE = 524288 -SOLVER_SELECTMASK = 255 -SOLVER_SETARCH = 67108864 -SOLVER_SETEV = 16777216 -SOLVER_SETEVR = 33554432 -SOLVER_SETMASK = 2130706432 -SOLVER_SETNAME = 1073741824 -SOLVER_SETREPO = 268435456 -SOLVER_SETVENDOR = 134217728 -SOLVER_SOLVABLE = 1 -SOLVER_SOLVABLE_ALL = 6 -SOLVER_SOLVABLE_NAME = 2 -SOLVER_SOLVABLE_ONE_OF = 4 -SOLVER_SOLVABLE_PROVIDES = 3 -SOLVER_SOLVABLE_REPO = 5 -SOLVER_TARGETED = 2097152 -SOLVER_UPDATE = 768 -SOLVER_USERINSTALLED = 2560 -SOLVER_VERIFY = 2048 -SOLVER_WEAK = 65536 -SOLVER_WEAKENDEPS = 1024 + +def cache_fn_url(arg0: str) -> str: ... +def cancel_json_output() -> None: ... +def clean(arg0: int) -> None: ... +def create_cache_dir(arg0: Path) -> str: ... +def generate_ed25519_keypair() -> tuple[str, str]: ... +def get_channels(arg0: list[str]) -> list[Channel]: ... +def get_virtual_packages() -> list[PackageInfo]: ... +def init_console() -> None: ... +def sign(data: str, secret_key: str) -> str: ... +def simplify_conflicts(arg0: ProblemsGraph) -> ProblemsGraph: ... +def transmute( + source_package: Path, + destination_package: Path, + compression_level: int, + compression_threads: int = 1, +) -> bool: ... + +MAMBA_CLEAN_ALL: int = 1 +MAMBA_CLEAN_INDEX: int = 2 +MAMBA_CLEAN_LOCKS: int = 16 +MAMBA_CLEAN_PKGS: int = 4 +MAMBA_CLEAN_TARBALLS: int = 8 +MAMBA_DOWNLOAD_FAILFAST: int = 1 +MAMBA_DOWNLOAD_SORT: int = 2 +MAMBA_FORCE_REINSTALL: int = 4 +MAMBA_NO_DEPS: int = 1 +MAMBA_ONLY_DEPS: int = 2 +SOLVER_ALLOWUNINSTALL: int = 2816 +SOLVER_CLEANDEPS: int = 262144 +SOLVER_DISFAVOR: int = 3328 +SOLVER_DISTUPGRADE: int = 1792 +SOLVER_DROP_ORPHANED: int = 2304 +SOLVER_ERASE: int = 512 +SOLVER_ESSENTIAL: int = 131072 +SOLVER_FAVOR: int = 3072 +SOLVER_FLAG_ADD_ALREADY_RECOMMENDED: int = 8 +SOLVER_FLAG_ALLOW_ARCHCHANGE: int = 2 +SOLVER_FLAG_ALLOW_DOWNGRADE: int = 1 +SOLVER_FLAG_ALLOW_NAMECHANGE: int = 10 +SOLVER_FLAG_ALLOW_UNINSTALL: int = 4 +SOLVER_FLAG_ALLOW_VENDORCHANGE: int = 3 +SOLVER_FLAG_BEST_OBEY_POLICY: int = 12 +SOLVER_FLAG_BREAK_ORPHANS: int = 19 +SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE: int = 15 +SOLVER_FLAG_DUP_ALLOW_DOWNGRADE: int = 14 +SOLVER_FLAG_DUP_ALLOW_NAMECHANGE: int = 17 +SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE: int = 16 +SOLVER_FLAG_FOCUS_BEST: int = 24 +SOLVER_FLAG_FOCUS_INSTALLED: int = 20 +SOLVER_FLAG_IGNORE_RECOMMENDED: int = 7 +SOLVER_FLAG_INSTALL_ALSO_UPDATES: int = 26 +SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES: int = 11 +SOLVER_FLAG_KEEP_ORPHANS: int = 18 +SOLVER_FLAG_NEED_UPDATEPROVIDE: int = 22 +SOLVER_FLAG_NO_AUTOTARGET: int = 13 +SOLVER_FLAG_NO_INFARCHCHECK: int = 9 +SOLVER_FLAG_NO_UPDATEPROVIDE: int = 5 +SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED: int = 27 +SOLVER_FLAG_SPLITPROVIDES: int = 6 +SOLVER_FLAG_STRICT_REPO_PRIORITY: int = 28 +SOLVER_FLAG_STRONG_RECOMMENDS: int = 25 +SOLVER_FLAG_URPM_REORDER: int = 23 +SOLVER_FLAG_YUM_OBSOLETES: int = 21 +SOLVER_FORCEBEST: int = 1048576 +SOLVER_INSTALL: int = 256 +SOLVER_JOBMASK: int = 65280 +SOLVER_LOCK: int = 1536 +SOLVER_MULTIVERSION: int = 1280 +SOLVER_NOAUTOSET: int = 536870912 +SOLVER_NOOP: int = 0 +SOLVER_NOTBYUSER: int = 4194304 +SOLVER_ORUPDATE: int = 524288 +SOLVER_SELECTMASK: int = 255 +SOLVER_SETARCH: int = 67108864 +SOLVER_SETEV: int = 16777216 +SOLVER_SETEVR: int = 33554432 +SOLVER_SETMASK: int = 2130706432 +SOLVER_SETNAME: int = 1073741824 +SOLVER_SETREPO: int = 268435456 +SOLVER_SETVENDOR: int = 134217728 +SOLVER_SOLVABLE: int = 1 +SOLVER_SOLVABLE_ALL: int = 6 +SOLVER_SOLVABLE_NAME: int = 2 +SOLVER_SOLVABLE_ONE_OF: int = 4 +SOLVER_SOLVABLE_PROVIDES: int = 3 +SOLVER_SOLVABLE_REPO: int = 5 +SOLVER_TARGETED: int = 2097152 +SOLVER_UPDATE: int = 768 +SOLVER_USERINSTALLED: int = 2560 +SOLVER_VERIFY: int = 2048 +SOLVER_WEAK: int = 65536 +SOLVER_WEAKENDEPS: int = 1024 diff --git a/libmambapy/src/main.cpp b/libmambapy/src/main.cpp index 98fb15987f..a26ba47662 100644 --- a/libmambapy/src/main.cpp +++ b/libmambapy/src/main.cpp @@ -13,11 +13,13 @@ #include #include #include +#include #include "mamba/api/clean.hpp" #include "mamba/api/configuration.hpp" #include "mamba/core/channel.hpp" #include "mamba/core/context.hpp" +#include "mamba/core/download_progress_bar.hpp" #include "mamba/core/execution.hpp" #include "mamba/core/fetch.hpp" #include "mamba/core/output.hpp" @@ -171,6 +173,98 @@ namespace mambapy }; Singletons singletons; + + // MSubdirData objects are movable only, and they need to be moved into + // a std::vector before we call MSudbirData::download. Since we cannot + // replicate the move semantics in Python, we encapsulate the creation + // and the storage of MSubdirData objects in this class, to avoid + // potential dangling references in Python. + class SubdirIndex + { + public: + + struct Entry + { + mamba::MSubdirData* p_subdirdata = nullptr; + std::string m_platform = ""; + const mamba::Channel* p_channel = nullptr; + std::string m_url = ""; + }; + + using entry_list = std::vector; + using iterator = entry_list::const_iterator; + + void create( + mamba::ChannelContext& channel_context, + const mamba::Channel& channel, + const std::string& platform, + const std::string& full_url, + mamba::MultiPackageCache& caches, + const std::string& repodata_fn, + const std::string url + ) + { + using namespace mamba; + m_subdirs.push_back(extract( + MSubdirData::create(channel_context, channel, platform, full_url, caches, repodata_fn) + )); + m_entries.push_back({ nullptr, platform, &channel, url }); + for (size_t i = 0; i < m_subdirs.size(); ++i) + { + m_entries[i].p_subdirdata = &(m_subdirs[i]); + } + } + + bool download() + { + using namespace mamba; + // TODO: expose DownloadProgressBar to libmambapy and remove this + // logic + Context& ctx = mambapy::singletons.context(); + expected_t download_res; + if (DownloadProgressBar::can_monitor(ctx)) + { + DownloadProgressBar check_monitor({ true, true }); + DownloadProgressBar index_monitor; + download_res = MSubdirData::download_indexes( + m_subdirs, + ctx, + &check_monitor, + &index_monitor + ); + } + else + { + download_res = MSubdirData::download_indexes(m_subdirs, ctx); + } + return download_res.has_value(); + } + + std::size_t size() const + { + return m_entries.size(); + } + + const Entry& operator[](std::size_t index) const + { + return m_entries[index]; + } + + iterator begin() const + { + return m_entries.begin(); + } + + iterator end() const + { + return m_entries.end(); + } + + private: + + std::vector m_subdirs; + entry_list m_entries; + }; } PYBIND11_MODULE(bindings, m) @@ -518,24 +612,6 @@ PYBIND11_MODULE(bindings, m) ); py::class_(m, "SubdirData") - .def(py::init( - [](const Channel& channel, - const std::string& platform, - const std::string& url, - MultiPackageCache& caches, - const std::string& repodata_fn) -> MSubdirData - { - auto sres = MSubdirData::create( - mambapy::singletons.channel_context(), - channel, - platform, - url, - caches, - repodata_fn - ); - return extract(std::move(sres)); - } - )) .def( "create_repo", [](MSubdirData& subdir, MPool& pool) -> MRepo @@ -545,17 +621,48 @@ PYBIND11_MODULE(bindings, m) .def( "cache_path", [](const MSubdirData& self) -> std::string { return extract(self.cache_path()); } - ) + ); + + using mambapy::SubdirIndex; + using SubdirIndexEntry = SubdirIndex::Entry; + + py::class_(m, "SubdirIndexEntry") + .def(py::init<>()) + .def_readonly("subdir", &SubdirIndexEntry::p_subdirdata, py::return_value_policy::reference) + .def_readonly("platform", &SubdirIndexEntry::m_platform) + .def_readonly("channel", &SubdirIndexEntry::p_channel, py::return_value_policy::reference) + .def_readonly("url", &SubdirIndexEntry::m_url); + + py::class_(m, "SubdirIndex") + .def(py::init<>()) .def( - "download_and_check_targets", - [](MSubdirData& self, MultiDownloadTarget& /*multi_download*/) -> bool + "create", + [](SubdirIndex& self, + const Channel& channel, + const std::string& platform, + const std::string& full_url, + MultiPackageCache& caches, + const std::string& repodata_fn, + const std::string url) { - MultiDownloadRequest check_requests = self.build_check_requests(); - std::size_t check_size = check_requests.size(); - download(std::move(check_requests), mambapy::singletons.context()); - // multi_download.download(MAMBA_NO_CLEAR_PROGRESS_BARS); - return check_size; + self.create( + mambapy::singletons.channel_context(), + channel, + platform, + full_url, + caches, + repodata_fn, + url + ); } + ) + .def("download", &SubdirIndex::download) + .def("__len__", &SubdirIndex::size) + .def("__getitem__", &SubdirIndex::operator[]) + .def( + "__iter__", + [](SubdirIndex& self) { return py::make_iterator(self.begin(), self.end()); }, + py::keep_alive<0, 1>() ); m.def("cache_fn_url", &cache_fn_url); diff --git a/mamba/mamba/utils.py b/mamba/mamba/utils.py index 32566d46ab..7baeb1992e 100644 --- a/mamba/mamba/utils.py +++ b/mamba/mamba/utils.py @@ -57,10 +57,6 @@ def get_index( # Remove duplicates but retain order all_channels = list(OrderedDict.fromkeys(all_channels)) - dlist = api.DownloadTargetList() - - index = [] - def fixup_channel_spec(spec): at_count = spec.count("@") if at_count > 1: @@ -78,33 +74,15 @@ def fixup_channel_spec(spec): pkgs_dirs = api.MultiPackageCache(context.pkgs_dirs) api.create_cache_dir(str(pkgs_dirs.first_writable_path)) + index = api.SubdirIndex() for channel in api.get_channels(all_channels): for channel_platform, url in channel.platform_urls(with_credentials=True): full_url = CondaHttpAuth.add_binstar_token(url) - - sd = api.SubdirData( - channel, channel_platform, full_url, pkgs_dirs, repodata_fn + index.create( + channel, channel_platform, full_url, pkgs_dirs, repodata_fn, url ) - needs_finalising = sd.download_and_check_targets(dlist) - index.append( - ( - sd, - { - "platform": channel_platform, - "url": url, - "channel": channel, - "needs_finalising": needs_finalising, - }, - ) - ) - - for sd, info in index: - if info["needs_finalising"]: - sd.finalize_checks() - dlist.add(sd) - - is_downloaded = dlist.download(api.MAMBA_DOWNLOAD_FAILFAST) + is_downloaded = index.download() if not is_downloaded: raise RuntimeError("Error downloading repodata.") @@ -141,16 +119,16 @@ def load_channels( subprio_index = len(index) if has_priority: # first, count unique channels - n_channels = len(set([entry["channel"].canonical_name for _, entry in index])) - current_channel = index[0][1]["channel"].canonical_name + n_channels = len(set([entry.channel.canonical_name for entry in index])) + current_channel = index[0].channel.canonical_name channel_prio = n_channels - for subdir, entry in index: + for entry in index: # add priority here if has_priority: - if entry["channel"].canonical_name != current_channel: + if entry.channel.canonical_name != current_channel: channel_prio -= 1 - current_channel = entry["channel"].canonical_name + current_channel = entry.channel.canonical_name priority = channel_prio else: priority = 0 @@ -160,19 +138,19 @@ def load_channels( subpriority = subprio_index subprio_index -= 1 - if not subdir.loaded() and entry["platform"] != "noarch": + if not entry.subdir.loaded() and entry.platform != "noarch": # ignore non-loaded subdir if channel is != noarch continue if context.verbosity != 0 and not context.json: print( "Channel: {}, platform: {}, prio: {} : {}".format( - entry["channel"], entry["platform"], priority, subpriority + entry.channel, entry.platform, priority, subpriority ) ) - print("Cache path: ", subdir.cache_path()) + print("Cache path: ", entry.subdir.cache_path()) - repo = subdir.create_repo(pool) + repo = entry.subdir.create_repo(pool) repo.set_priority(priority, subpriority) repos.append(repo) @@ -301,13 +279,13 @@ def to_conda_channel(channel, platform): def to_package_record_from_subjson(entry, pkg, jsn_string): - channel_url = entry["url"] + channel_url = entry.url info = json.loads(jsn_string) info["fn"] = pkg - info["channel"] = to_conda_channel(entry["channel"], entry["platform"]) + info["channel"] = to_conda_channel(entry.channel, entry.platform) info["url"] = join_url(channel_url, pkg) if not info.get("subdir"): - info["subdir"] = entry["platform"] + info["subdir"] = entry.platform package_record = PackageRecord(**info) return package_record @@ -360,9 +338,9 @@ def compute_final_precs( final_precs = IndexedSet(prefix_records) lookup_dict = {} - for _, entry in index: + for entry in index: lookup_dict[ - entry["channel"].platform_url(entry["platform"], with_credentials=False) + entry.channel.platform_url(entry.platform, with_credentials=False) ] = entry i_rec: PackageRecord